19#include <zephyr/devicetree_generated.h>
22#if !defined(_LINKER) && !defined(_ASMLANGUAGE)
87#define DT_INVALID_NODE _
144#define DT_PATH(...) DT_PATH_INTERNAL(__VA_ARGS__)
200#define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
240#define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
336#define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
361#define DT_PARENT(node_id) DT_CAT(node_id, _PARENT)
386#define DT_GPARENT(node_id) DT_PARENT(DT_PARENT(node_id))
423#define DT_CHILD(node_id, child) UTIL_CAT(node_id, DT_S_PREFIX(child))
466#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat) \
467 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
468 (DT_INST(0, compat)), \
498#define DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH)
524#define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
552#define DT_NODE_FULL_NAME_UNQUOTED(node_id) DT_CAT(node_id, _FULL_NAME_UNQUOTED)
580#define DT_NODE_FULL_NAME_TOKEN(node_id) DT_CAT(node_id, _FULL_NAME_TOKEN)
610#define DT_NODE_FULL_NAME_UPPER_TOKEN(node_id) DT_CAT(node_id, _FULL_NAME_UPPER_TOKEN)
638#define DT_NODE_CHILD_IDX(node_id) DT_CAT(node_id, _CHILD_IDX)
646#define DT_CHILD_NUM(node_id) DT_CAT(node_id, _CHILD_NUM)
656#define DT_CHILD_NUM_STATUS_OKAY(node_id) \
657 DT_CAT(node_id, _CHILD_NUM_STATUS_OKAY)
679#define DT_SAME_NODE(node_id1, node_id2) \
680 (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2)))
706#define DT_NODELABEL_STRING_ARRAY(node_id) \
707 { DT_FOREACH_NODELABEL(node_id, DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL) }
749#define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
783#define DT_PROP_LEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _LEN)
799#define DT_PROP_LEN_OR(node_id, prop, default_value) \
800 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
801 (DT_PROP_LEN(node_id, prop)), (default_value))
823#define DT_PROP_HAS_IDX(node_id, prop, idx) \
824 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
858#define DT_PROP_HAS_NAME(node_id, prop, name) \
859 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _NAME_, name, _EXISTS))
895#define DT_PROP_BY_IDX(node_id, prop, idx) \
896 DT_CAT5(node_id, _P_, prop, _IDX_, idx)
911#define DT_PROP_OR(node_id, prop, default_value) \
912 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
913 (DT_PROP(node_id, prop)), (default_value))
955#define DT_ENUM_IDX(node_id, prop) DT_CAT4(node_id, _P_, prop, _ENUM_IDX)
971#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
972 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
973 (DT_ENUM_IDX(node_id, prop)), (default_idx_value))
983#define DT_ENUM_HAS_VALUE(node_id, prop, value) \
984 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _ENUM_VAL_, value, _EXISTS))
1045#define DT_STRING_TOKEN(node_id, prop) \
1046 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
1061#define DT_STRING_TOKEN_OR(node_id, prop, default_value) \
1062 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1063 (DT_STRING_TOKEN(node_id, prop)), (default_value))
1122#define DT_STRING_UPPER_TOKEN(node_id, prop) \
1123 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
1139#define DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value) \
1140 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1141 (DT_STRING_UPPER_TOKEN(node_id, prop)), (default_value))
1183#define DT_STRING_UNQUOTED(node_id, prop) \
1184 DT_CAT4(node_id, _P_, prop, _STRING_UNQUOTED)
1200#define DT_STRING_UNQUOTED_OR(node_id, prop, default_value) \
1201 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1202 (DT_STRING_UNQUOTED(node_id, prop)), (default_value))
1251#define DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) \
1252 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_TOKEN)
1301#define DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx) \
1302 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UPPER_TOKEN)
1344#define DT_STRING_UNQUOTED_BY_IDX(node_id, prop, idx) \
1345 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UNQUOTED)
1400#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
1401 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
1422#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
1423 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
1436#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
1437 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
1493#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
1494 DT_CAT7(node_id, _P_, pha, _IDX_, idx, _VAL_, cell)
1519#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
1520 DT_PROP_OR(node_id, DT_CAT5(pha, _IDX_, idx, _VAL_, cell), default_value)
1529#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
1545#define DT_PHA_OR(node_id, pha, cell, default_value) \
1546 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1588#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1589 DT_CAT7(node_id, _P_, pha, _NAME_, name, _VAL_, cell)
1612#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1613 DT_PROP_OR(node_id, DT_CAT5(pha, _NAME_, name, _VAL_, cell), default_value)
1662#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1663 DT_CAT6(node_id, _P_, pha, _NAME_, name, _PH)
1714#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1715 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1728#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1776#define DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM)
1830#define DT_RANGES_HAS_IDX(node_id, idx) \
1831 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS))
1885#define DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) \
1886 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS))
1925#define DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) \
1926 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS)
1974#define DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) \
1975 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS)
2023#define DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) \
2024 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS)
2072#define DT_RANGES_LENGTH_BY_IDX(node_id, idx) \
2073 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH)
2114#define DT_FOREACH_RANGE(node_id, fn) \
2115 DT_CAT(node_id, _FOREACH_RANGE)(fn)
2162#define DT_NODE_VENDOR_BY_IDX(node_id, idx) \
2163 DT_CAT3(node_id, _COMPAT_VENDOR_IDX_, idx)
2177#define DT_NODE_VENDOR_HAS_IDX(node_id, idx) \
2178 IS_ENABLED(DT_CAT4(node_id, _COMPAT_VENDOR_IDX_, idx, _EXISTS))
2194#define DT_NODE_VENDOR_BY_IDX_OR(node_id, idx, default_value) \
2195 COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(node_id, idx), \
2196 (DT_NODE_VENDOR_BY_IDX(node_id, idx)), (default_value))
2206#define DT_NODE_VENDOR_OR(node_id, default_value) \
2207 DT_NODE_VENDOR_BY_IDX_OR(node_id, 0, default_value)
2238#define DT_NODE_MODEL_BY_IDX(node_id, idx) \
2239 DT_CAT3(node_id, _COMPAT_MODEL_IDX_, idx)
2253#define DT_NODE_MODEL_HAS_IDX(node_id, idx) \
2254 IS_ENABLED(DT_CAT4(node_id, _COMPAT_MODEL_IDX_, idx, _EXISTS))
2270#define DT_NODE_MODEL_BY_IDX_OR(node_id, idx, default_value) \
2271 COND_CODE_1(DT_NODE_MODEL_HAS_IDX(node_id, idx), \
2272 (DT_NODE_MODEL_BY_IDX(node_id, idx)), (default_value))
2282#define DT_NODE_MODEL_OR(node_id, default_value) \
2283 DT_NODE_MODEL_BY_IDX_OR(node_id, 0, default_value)
2302#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
2315#define DT_REG_HAS_IDX(node_id, idx) \
2316 IS_ENABLED(DT_CAT4(node_id, _REG_IDX_, idx, _EXISTS))
2329#define DT_REG_HAS_NAME(node_id, name) \
2330 IS_ENABLED(DT_CAT4(node_id, _REG_NAME_, name, _EXISTS))
2343#define DT_REG_ADDR_BY_IDX_RAW(node_id, idx) \
2344 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS)
2357#define DT_REG_ADDR_RAW(node_id) \
2358 DT_REG_ADDR_BY_IDX_RAW(node_id, 0)
2366#define DT_REG_ADDR_BY_IDX(node_id, idx) \
2367 DT_U32_C(DT_REG_ADDR_BY_IDX_RAW(node_id, idx))
2380#define DT_REG_SIZE_BY_IDX(node_id, idx) \
2381 DT_U32_C(DT_CAT4(node_id, _REG_IDX_, idx, _VAL_SIZE))
2390#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
2402#define DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR_BY_IDX_RAW(node_id, 0))
2411#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
2419#define DT_REG_ADDR_BY_NAME(node_id, name) \
2420 DT_U32_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS))
2430#define DT_REG_ADDR_BY_NAME_OR(node_id, name, default_value) \
2431 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2432 (DT_REG_ADDR_BY_NAME(node_id, name)), (default_value))
2446#define DT_REG_ADDR_BY_NAME_U64(node_id, name) \
2447 DT_U64_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS))
2455#define DT_REG_SIZE_BY_NAME(node_id, name) \
2456 DT_U32_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_SIZE))
2466#define DT_REG_SIZE_BY_NAME_OR(node_id, name, default_value) \
2467 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2468 (DT_REG_SIZE_BY_NAME(node_id, name)), (default_value))
2489#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
2515#define DT_NUM_NODELABELS(node_id) DT_CAT(node_id, _NODELABEL_NUM)
2523#define DT_IRQ_LEVEL(node_id) DT_CAT(node_id, _IRQ_LEVEL)
2535#define DT_IRQ_HAS_IDX(node_id, idx) \
2536 IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS))
2548#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
2549 IS_ENABLED(DT_CAT6(node_id, _IRQ_IDX_, idx, _VAL_, cell, _EXISTS))
2558#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
2569#define DT_IRQ_HAS_NAME(node_id, name) \
2570 IS_ENABLED(DT_CAT4(node_id, _IRQ_NAME_, name, _VAL_irq_EXISTS))
2607#define DT_IRQ_BY_IDX(node_id, idx, cell) \
2608 DT_CAT5(node_id, _IRQ_IDX_, idx, _VAL_, cell)
2625#define DT_IRQ_BY_NAME(node_id, name, cell) \
2626 DT_CAT5(node_id, _IRQ_NAME_, name, _VAL_, cell)
2635#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
2679#define DT_IRQ_INTC_BY_IDX(node_id, idx) \
2680 DT_CAT4(node_id, _IRQ_IDX_, idx, _CONTROLLER)
2726#define DT_IRQ_INTC_BY_NAME(node_id, name) \
2727 DT_CAT4(node_id, _IRQ_NAME_, name, _CONTROLLER)
2768#define DT_IRQ_INTC(node_id) \
2769 DT_IRQ_INTC_BY_IDX(node_id, 0)
2776#define DT_IRQN_L1_INTERNAL(node_id, idx) DT_IRQ_BY_IDX(node_id, idx, irq)
2778#define DT_IRQN_L2_INTERNAL(node_id, idx) \
2779 (IRQ_TO_L2(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2780 DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq))
2782#define DT_IRQN_L3_INTERNAL(node_id, idx) \
2783 (IRQ_TO_L3(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2784 IRQ_TO_L2(DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq)) | \
2785 DT_IRQ(DT_IRQ_INTC(DT_IRQ_INTC_BY_IDX(node_id, idx)), irq))
2787#define DT_IRQN_LVL_INTERNAL(node_id, idx, level) DT_CAT3(DT_IRQN_L, level, _INTERNAL)(node_id, idx)
2793#define DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx) \
2794 DT_IRQN_LVL_INTERNAL(node_id, idx, DT_IRQ_LEVEL(node_id))
2808#define DT_IRQN_BY_IDX(node_id, idx) \
2809 COND_CODE_1(IS_ENABLED(CONFIG_MULTI_LEVEL_INTERRUPTS), \
2810 (DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx)), \
2811 (DT_IRQ_BY_IDX(node_id, idx, irq)))
2823#define DT_IRQN(node_id) DT_IRQN_BY_IDX(node_id, 0)
2843#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
2851#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS))
2872#define DT_FOREACH_NODE(fn) DT_FOREACH_HELPER(fn)
2886#define DT_FOREACH_NODE_VARGS(fn, ...) DT_FOREACH_VARGS_HELPER(fn, __VA_ARGS__)
2899#define DT_FOREACH_STATUS_OKAY_NODE(fn) DT_FOREACH_OKAY_HELPER(fn)
2915#define DT_FOREACH_STATUS_OKAY_NODE_VARGS(fn, ...) DT_FOREACH_OKAY_VARGS_HELPER(fn, __VA_ARGS__)
2960#define DT_FOREACH_CHILD(node_id, fn) \
2961 DT_CAT(node_id, _FOREACH_CHILD)(fn)
3003#define DT_FOREACH_CHILD_SEP(node_id, fn, sep) \
3004 DT_CAT(node_id, _FOREACH_CHILD_SEP)(fn, sep)
3021#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
3022 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
3039#define DT_FOREACH_CHILD_SEP_VARGS(node_id, fn, sep, ...) \
3040 DT_CAT(node_id, _FOREACH_CHILD_SEP_VARGS)(fn, sep, __VA_ARGS__)
3057#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
3058 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
3076#define DT_FOREACH_CHILD_STATUS_OKAY_SEP(node_id, fn, sep) \
3077 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP)(fn, sep)
3098#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
3099 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
3119#define DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(node_id, fn, sep, ...) \
3120 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP_VARGS)(fn, sep, __VA_ARGS__)
3172#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
3173 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
3217#define DT_FOREACH_PROP_ELEM_SEP(node_id, prop, fn, sep) \
3218 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP)(fn, sep)
3240#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
3241 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
3259#define DT_FOREACH_PROP_ELEM_SEP_VARGS(node_id, prop, fn, sep, ...) \
3260 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP_VARGS)( \
3261 fn, sep, __VA_ARGS__)
3316#define DT_FOREACH_STATUS_OKAY(compat, fn) \
3317 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3318 (UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
3365#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3366 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3367 (DT_CAT(DT_FOREACH_OKAY_VARGS_, \
3368 compat)(fn, __VA_ARGS__)), \
3383#define DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3384 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3385 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
3386 compat)(fn, compat, __VA_ARGS__)), \
3428#define DT_FOREACH_NODELABEL(node_id, fn) DT_CAT(node_id, _FOREACH_NODELABEL)(fn)
3467#define DT_FOREACH_NODELABEL_VARGS(node_id, fn, ...) \
3468 DT_CAT(node_id, _FOREACH_NODELABEL_VARGS)(fn, __VA_ARGS__)
3494#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
3517#define DT_NODE_HAS_STATUS(node_id, status) \
3518 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
3540#define DT_NODE_HAS_STATUS_OKAY(node_id) DT_NODE_HAS_STATUS(node_id, okay)
3561#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
3562 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
3570#define DT_NUM_INST_STATUS_OKAY(compat) \
3571 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3572 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
3601#define DT_NODE_HAS_COMPAT(node_id, compat) \
3602 IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat))
3618#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
3619 UTIL_AND(DT_NODE_HAS_COMPAT(node_id, compat), DT_NODE_HAS_STATUS(node_id, status))
3634#define DT_NODE_HAS_PROP(node_id, prop) \
3635 IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS))
3654#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
3655 IS_ENABLED(DT_CAT8(node_id, _P_, pha, \
3656 _IDX_, idx, _VAL_, cell, _EXISTS))
3667#define DT_PHA_HAS_CELL(node_id, pha, cell) \
3668 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
3711#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
3741#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus))
3759#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
3768#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
3777#define DT_INST_GPARENT(inst) DT_GPARENT(DT_DRV_INST(inst))
3788#define DT_INST_CHILD(inst, child) \
3789 DT_CHILD(DT_DRV_INST(inst), child)
3800#define DT_INST_CHILD_NUM(inst) DT_CHILD_NUM(DT_DRV_INST(inst))
3811#define DT_INST_CHILD_NUM_STATUS_OKAY(inst) \
3812 DT_CHILD_NUM_STATUS_OKAY(DT_DRV_INST(inst))
3822#define DT_INST_NODELABEL_STRING_ARRAY(inst) DT_NODELABEL_STRING_ARRAY(DT_DRV_INST(inst))
3832#define DT_INST_NUM_NODELABELS(inst) DT_NUM_NODELABELS(DT_DRV_INST(inst))
3848#define DT_INST_FOREACH_CHILD(inst, fn) \
3849 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
3864#define DT_INST_FOREACH_CHILD_SEP(inst, fn, sep) \
3865 DT_FOREACH_CHILD_SEP(DT_DRV_INST(inst), fn, sep)
3882#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
3883 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3899#define DT_INST_FOREACH_CHILD_SEP_VARGS(inst, fn, sep, ...) \
3900 DT_FOREACH_CHILD_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3913#define DT_INST_FOREACH_CHILD_STATUS_OKAY(inst, fn) \
3914 DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), fn)
3930#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(inst, fn, sep) \
3931 DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_DRV_INST(inst), fn, sep)
3946#define DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, fn, ...) \
3947 DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3964#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(inst, fn, sep, ...) \
3965 DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3973#define DT_INST_ENUM_IDX(inst, prop) \
3974 DT_ENUM_IDX(DT_DRV_INST(inst), prop)
3984#define DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) \
3985 DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value)
3995#define DT_INST_ENUM_HAS_VALUE(inst, prop, value) \
3996 DT_ENUM_HAS_VALUE(DT_DRV_INST(inst), prop, value)
4004#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
4012#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
4023#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
4024 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
4034#define DT_INST_PROP_HAS_NAME(inst, prop, name) \
4035 DT_PROP_HAS_NAME(DT_DRV_INST(inst), prop, name)
4044#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
4045 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
4054#define DT_INST_PROP_OR(inst, prop, default_value) \
4055 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
4064#define DT_INST_PROP_LEN_OR(inst, prop, default_value) \
4065 DT_PROP_LEN_OR(DT_DRV_INST(inst), prop, default_value)
4076#define DT_INST_STRING_TOKEN(inst, prop) \
4077 DT_STRING_TOKEN(DT_DRV_INST(inst), prop)
4086#define DT_INST_STRING_UPPER_TOKEN(inst, prop) \
4087 DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop)
4097#define DT_INST_STRING_UNQUOTED(inst, prop) \
4098 DT_STRING_UNQUOTED(DT_DRV_INST(inst), prop)
4107#define DT_INST_STRING_TOKEN_BY_IDX(inst, prop, idx) \
4108 DT_STRING_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4117#define DT_INST_STRING_UPPER_TOKEN_BY_IDX(inst, prop, idx) \
4118 DT_STRING_UPPER_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4127#define DT_INST_STRING_UNQUOTED_BY_IDX(inst, prop, idx) \
4128 DT_STRING_UNQUOTED_BY_IDX(DT_DRV_INST(inst), prop, idx)
4138#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
4139 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
4152#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
4153 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
4163#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
4164 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
4175#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
4176 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
4186#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
4196#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
4197 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
4208#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
4209 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
4220#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
4221 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
4231#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
4232 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
4243#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
4244 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
4254#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
4263#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
4272#define DT_INST_REG_HAS_NAME(inst, name) DT_REG_HAS_NAME(DT_DRV_INST(inst), name)
4280#define DT_INST_REG_ADDR_BY_IDX_RAW(inst, idx) DT_REG_ADDR_BY_IDX_RAW(DT_DRV_INST(inst), idx)
4288#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
4296#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
4297 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
4305#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
4306 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
4316#define DT_INST_REG_ADDR_BY_NAME_OR(inst, name, default_value) \
4317 DT_REG_ADDR_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4331#define DT_INST_REG_ADDR_BY_NAME_U64(inst, name) \
4332 DT_REG_ADDR_BY_NAME_U64(DT_DRV_INST(inst), name)
4340#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
4341 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
4351#define DT_INST_REG_SIZE_BY_NAME_OR(inst, name, default_value) \
4352 DT_REG_SIZE_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4359#define DT_INST_REG_ADDR_RAW(inst) DT_INST_REG_ADDR_BY_IDX_RAW(inst, 0)
4366#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
4379#define DT_INST_REG_ADDR_U64(inst) DT_REG_ADDR_U64(DT_DRV_INST(inst))
4386#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
4394#define DT_INST_NUM_IRQS(inst) DT_NUM_IRQS(DT_DRV_INST(inst))
4402#define DT_INST_IRQ_LEVEL(inst) DT_IRQ_LEVEL(DT_DRV_INST(inst))
4411#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
4412 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
4420#define DT_INST_IRQ_INTC_BY_IDX(inst, idx) \
4421 DT_IRQ_INTC_BY_IDX(DT_DRV_INST(inst), idx)
4429#define DT_INST_IRQ_INTC_BY_NAME(inst, name) \
4430 DT_IRQ_INTC_BY_NAME(DT_DRV_INST(inst), name)
4439#define DT_INST_IRQ_INTC(inst) \
4440 DT_INST_IRQ_INTC_BY_IDX(inst, 0)
4449#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
4450 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
4458#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
4465#define DT_INST_IRQN(inst) DT_IRQN(DT_DRV_INST(inst))
4473#define DT_INST_IRQN_BY_IDX(inst, idx) DT_IRQN_BY_IDX(DT_DRV_INST(inst), idx)
4480#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
4489#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
4500#define DT_INST_STRING_TOKEN_OR(inst, name, default_value) \
4501 DT_STRING_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4511#define DT_INST_STRING_UPPER_TOKEN_OR(inst, name, default_value) \
4512 DT_STRING_UPPER_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4522#define DT_INST_STRING_UNQUOTED_OR(inst, name, default_value) \
4523 DT_STRING_UNQUOTED_OR(DT_DRV_INST(inst), name, default_value)
4555#define DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) \
4556 IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus))
4590#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
4591 DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(DT_DRV_COMPAT, bus)
4637#define DT_ANY_INST_HAS_PROP_STATUS_OKAY(prop) \
4638 COND_CODE_1(IS_EMPTY(DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop)), (0), (1))
4684#define DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(compat, prop) \
4685 (DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, DT_COMPAT_NODE_HAS_PROP_AND_OR, prop) 0)
4752#define DT_INST_FOREACH_STATUS_OKAY(fn) \
4753 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4754 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
4755 DT_DRV_COMPAT)(fn)), \
4770#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
4771 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4772 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
4773 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
4785#define DT_INST_FOREACH_NODELABEL(inst, fn) \
4786 DT_FOREACH_NODELABEL(DT_DRV_INST(inst), fn)
4799#define DT_INST_FOREACH_NODELABEL_VARGS(inst, fn, ...) \
4800 DT_FOREACH_NODELABEL_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
4812#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
4813 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
4827#define DT_INST_FOREACH_PROP_ELEM_SEP(inst, prop, fn, sep) \
4828 DT_FOREACH_PROP_ELEM_SEP(DT_DRV_INST(inst), prop, fn, sep)
4844#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
4845 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
4864#define DT_INST_FOREACH_PROP_ELEM_SEP_VARGS(inst, prop, fn, sep, ...) \
4865 DT_FOREACH_PROP_ELEM_SEP_VARGS(DT_DRV_INST(inst), prop, fn, sep, \
4874#define DT_INST_NODE_HAS_PROP(inst, prop) \
4875 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
4883#define DT_INST_NODE_HAS_COMPAT(inst, compat) \
4884 DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), compat)
4896#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
4897 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
4908#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
4909 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
4918#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
4928#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
4929 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
4938#define DT_INST_IRQ_HAS_CELL(inst, cell) \
4939 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
4947#define DT_INST_IRQ_HAS_NAME(inst, name) \
4948 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
4967#define DT_ANY_INST_HAS_PROP_STATUS_OKAY__(idx, prop) \
4968 COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, prop), (1,), ())
4981#define DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop) \
4982 DT_INST_FOREACH_STATUS_OKAY_VARGS(DT_ANY_INST_HAS_PROP_STATUS_OKAY__, prop)
4984#define DT_PATH_INTERNAL(...) \
4985 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
4991#define DT_S_PREFIX(name) _S_##name
5007#define DT_CAT(a1, a2) a1 ## a2
5009#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
5011#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
5013#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
5015#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
5017#define DT_CAT7(a1, a2, a3, a4, a5, a6, a7) \
5018 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
5020#define DT_CAT8(a1, a2, a3, a4, a5, a6, a7, a8) \
5021 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7 ## a8
5028#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
5030#define DT_DASH_PREFIX(name) _##name
5032#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
5033 IS_ENABLED(DT_CAT3(node_id, _STATUS_, status))
5038#define DT_COMPAT_NODE_HAS_PROP_AND_OR(inst, compat, prop) \
5039 DT_NODE_HAS_PROP(DT_INST(inst, compat), prop) ||
5045#if defined(_LINKER) || defined(_ASMLANGUAGE)
5046#define DT_U32_C(_v) (_v)
5048#define DT_U32_C(_v) UINT32_C(_v)
5055#if defined(_LINKER) || defined(_ASMLANGUAGE)
5056#define DT_U64_C(_v) (_v)
5058#define DT_U64_C(_v) UINT64_C(_v)
5064#define DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL(nodelabel) DT_STRINGIFY_INTERNAL(nodelabel),
5065#define DT_STRINGIFY_INTERNAL(arg) DT_STRINGIFY_INTERNAL_HELPER(arg)
5066#define DT_STRINGIFY_INTERNAL_HELPER(arg) #arg
Clocks Devicetree macro public API header file.
CAN devicetree macro public API header file.
DMA Devicetree macro public API header file.
GPIO Devicetree macro public API header file.
MBOX Devicetree macro public API header file.
Devicetree pin control helpers.
Reset Controller Devicetree macro public API header file.
SPI Devicetree macro public API header file.
Flash Devicetree macro public API header file.
IO channels devicetree macro public API header file.
Public interface for multi-level interrupts.
Devicetree node dependency ordinals.
PWMs Devicetree macro public API header file.