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_CHILD_IDX(node_id) DT_CAT(node_id, _CHILD_IDX)
560#define DT_CHILD_NUM(node_id) DT_CAT(node_id, _CHILD_NUM)
570#define DT_CHILD_NUM_STATUS_OKAY(node_id) \
571 DT_CAT(node_id, _CHILD_NUM_STATUS_OKAY)
593#define DT_SAME_NODE(node_id1, node_id2) \
594 (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2)))
620#define DT_NODELABEL_STRING_ARRAY(node_id) \
621 { DT_FOREACH_NODELABEL(node_id, DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL) }
663#define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
697#define DT_PROP_LEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _LEN)
713#define DT_PROP_LEN_OR(node_id, prop, default_value) \
714 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
715 (DT_PROP_LEN(node_id, prop)), (default_value))
737#define DT_PROP_HAS_IDX(node_id, prop, idx) \
738 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
772#define DT_PROP_HAS_NAME(node_id, prop, name) \
773 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _NAME_, name, _EXISTS))
809#define DT_PROP_BY_IDX(node_id, prop, idx) \
810 DT_CAT5(node_id, _P_, prop, _IDX_, idx)
825#define DT_PROP_OR(node_id, prop, default_value) \
826 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
827 (DT_PROP(node_id, prop)), (default_value))
869#define DT_ENUM_IDX(node_id, prop) DT_CAT4(node_id, _P_, prop, _ENUM_IDX)
885#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
886 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
887 (DT_ENUM_IDX(node_id, prop)), (default_idx_value))
897#define DT_ENUM_HAS_VALUE(node_id, prop, value) \
898 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _ENUM_VAL_, value, _EXISTS))
959#define DT_STRING_TOKEN(node_id, prop) \
960 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
975#define DT_STRING_TOKEN_OR(node_id, prop, default_value) \
976 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
977 (DT_STRING_TOKEN(node_id, prop)), (default_value))
1036#define DT_STRING_UPPER_TOKEN(node_id, prop) \
1037 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
1053#define DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value) \
1054 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1055 (DT_STRING_UPPER_TOKEN(node_id, prop)), (default_value))
1097#define DT_STRING_UNQUOTED(node_id, prop) \
1098 DT_CAT4(node_id, _P_, prop, _STRING_UNQUOTED)
1114#define DT_STRING_UNQUOTED_OR(node_id, prop, default_value) \
1115 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1116 (DT_STRING_UNQUOTED(node_id, prop)), (default_value))
1165#define DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) \
1166 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_TOKEN)
1215#define DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx) \
1216 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UPPER_TOKEN)
1258#define DT_STRING_UNQUOTED_BY_IDX(node_id, prop, idx) \
1259 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UNQUOTED)
1314#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
1315 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
1336#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
1337 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
1350#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
1351 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
1407#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
1408 DT_CAT7(node_id, _P_, pha, _IDX_, idx, _VAL_, cell)
1433#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
1434 DT_PROP_OR(node_id, DT_CAT5(pha, _IDX_, idx, _VAL_, cell), default_value)
1443#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
1459#define DT_PHA_OR(node_id, pha, cell, default_value) \
1460 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1502#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1503 DT_CAT7(node_id, _P_, pha, _NAME_, name, _VAL_, cell)
1526#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1527 DT_PROP_OR(node_id, DT_CAT5(pha, _NAME_, name, _VAL_, cell), default_value)
1576#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1577 DT_CAT6(node_id, _P_, pha, _NAME_, name, _PH)
1628#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1629 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1642#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1690#define DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM)
1744#define DT_RANGES_HAS_IDX(node_id, idx) \
1745 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS))
1799#define DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) \
1800 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS))
1839#define DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) \
1840 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS)
1888#define DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) \
1889 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS)
1937#define DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) \
1938 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS)
1986#define DT_RANGES_LENGTH_BY_IDX(node_id, idx) \
1987 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH)
2028#define DT_FOREACH_RANGE(node_id, fn) \
2029 DT_CAT(node_id, _FOREACH_RANGE)(fn)
2076#define DT_NODE_VENDOR_BY_IDX(node_id, idx) \
2077 DT_CAT3(node_id, _COMPAT_VENDOR_IDX_, idx)
2091#define DT_NODE_VENDOR_HAS_IDX(node_id, idx) \
2092 IS_ENABLED(DT_CAT4(node_id, _COMPAT_VENDOR_IDX_, idx, _EXISTS))
2108#define DT_NODE_VENDOR_BY_IDX_OR(node_id, idx, default_value) \
2109 COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(node_id, idx), \
2110 (DT_NODE_VENDOR_BY_IDX(node_id, idx)), (default_value))
2120#define DT_NODE_VENDOR_OR(node_id, default_value) \
2121 DT_NODE_VENDOR_BY_IDX_OR(node_id, 0, default_value)
2152#define DT_NODE_MODEL_BY_IDX(node_id, idx) \
2153 DT_CAT3(node_id, _COMPAT_MODEL_IDX_, idx)
2167#define DT_NODE_MODEL_HAS_IDX(node_id, idx) \
2168 IS_ENABLED(DT_CAT4(node_id, _COMPAT_MODEL_IDX_, idx, _EXISTS))
2184#define DT_NODE_MODEL_BY_IDX_OR(node_id, idx, default_value) \
2185 COND_CODE_1(DT_NODE_MODEL_HAS_IDX(node_id, idx), \
2186 (DT_NODE_MODEL_BY_IDX(node_id, idx)), (default_value))
2196#define DT_NODE_MODEL_OR(node_id, default_value) \
2197 DT_NODE_MODEL_BY_IDX_OR(node_id, 0, default_value)
2216#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
2229#define DT_REG_HAS_IDX(node_id, idx) \
2230 IS_ENABLED(DT_CAT4(node_id, _REG_IDX_, idx, _EXISTS))
2243#define DT_REG_HAS_NAME(node_id, name) \
2244 IS_ENABLED(DT_CAT4(node_id, _REG_NAME_, name, _EXISTS))
2252#define DT_REG_ADDR_BY_IDX(node_id, idx) \
2253 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS)
2266#define DT_REG_SIZE_BY_IDX(node_id, idx) \
2267 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_SIZE)
2276#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
2288#define DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR(node_id))
2297#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
2305#define DT_REG_ADDR_BY_NAME(node_id, name) \
2306 DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS)
2316#define DT_REG_ADDR_BY_NAME_OR(node_id, name, default_value) \
2317 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2318 (DT_REG_ADDR_BY_NAME(node_id, name)), (default_value))
2332#define DT_REG_ADDR_BY_NAME_U64(node_id, name) \
2333 DT_U64_C(DT_REG_ADDR_BY_NAME(node_id, name))
2341#define DT_REG_SIZE_BY_NAME(node_id, name) \
2342 DT_CAT4(node_id, _REG_NAME_, name, _VAL_SIZE)
2352#define DT_REG_SIZE_BY_NAME_OR(node_id, name, default_value) \
2353 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2354 (DT_REG_SIZE_BY_NAME(node_id, name)), (default_value))
2375#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
2401#define DT_NUM_NODELABELS(node_id) DT_CAT(node_id, _NODELABEL_NUM)
2409#define DT_IRQ_LEVEL(node_id) DT_CAT(node_id, _IRQ_LEVEL)
2421#define DT_IRQ_HAS_IDX(node_id, idx) \
2422 IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS))
2434#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
2435 IS_ENABLED(DT_CAT6(node_id, _IRQ_IDX_, idx, _VAL_, cell, _EXISTS))
2444#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
2455#define DT_IRQ_HAS_NAME(node_id, name) \
2456 IS_ENABLED(DT_CAT4(node_id, _IRQ_NAME_, name, _VAL_irq_EXISTS))
2493#define DT_IRQ_BY_IDX(node_id, idx, cell) \
2494 DT_CAT5(node_id, _IRQ_IDX_, idx, _VAL_, cell)
2511#define DT_IRQ_BY_NAME(node_id, name, cell) \
2512 DT_CAT5(node_id, _IRQ_NAME_, name, _VAL_, cell)
2521#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
2565#define DT_IRQ_INTC_BY_IDX(node_id, idx) \
2566 DT_CAT4(node_id, _IRQ_IDX_, idx, _CONTROLLER)
2612#define DT_IRQ_INTC_BY_NAME(node_id, name) \
2613 DT_CAT4(node_id, _IRQ_NAME_, name, _CONTROLLER)
2654#define DT_IRQ_INTC(node_id) \
2655 DT_IRQ_INTC_BY_IDX(node_id, 0)
2662#define DT_IRQN_L1_INTERNAL(node_id, idx) DT_IRQ_BY_IDX(node_id, idx, irq)
2664#define DT_IRQN_L2_INTERNAL(node_id, idx) \
2665 (IRQ_TO_L2(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2666 DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq))
2668#define DT_IRQN_L3_INTERNAL(node_id, idx) \
2669 (IRQ_TO_L3(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2670 IRQ_TO_L2(DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq)) | \
2671 DT_IRQ(DT_IRQ_INTC(DT_IRQ_INTC_BY_IDX(node_id, idx)), irq))
2673#define DT_IRQN_LVL_INTERNAL(node_id, idx, level) DT_CAT3(DT_IRQN_L, level, _INTERNAL)(node_id, idx)
2679#define DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx) \
2680 DT_IRQN_LVL_INTERNAL(node_id, idx, DT_IRQ_LEVEL(node_id))
2694#define DT_IRQN_BY_IDX(node_id, idx) \
2695 COND_CODE_1(IS_ENABLED(CONFIG_MULTI_LEVEL_INTERRUPTS), \
2696 (DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx)), \
2697 (DT_IRQ_BY_IDX(node_id, idx, irq)))
2709#define DT_IRQN(node_id) DT_IRQN_BY_IDX(node_id, 0)
2729#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
2737#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS))
2758#define DT_FOREACH_NODE(fn) DT_FOREACH_HELPER(fn)
2772#define DT_FOREACH_NODE_VARGS(fn, ...) DT_FOREACH_VARGS_HELPER(fn, __VA_ARGS__)
2785#define DT_FOREACH_STATUS_OKAY_NODE(fn) DT_FOREACH_OKAY_HELPER(fn)
2801#define DT_FOREACH_STATUS_OKAY_NODE_VARGS(fn, ...) DT_FOREACH_OKAY_VARGS_HELPER(fn, __VA_ARGS__)
2846#define DT_FOREACH_CHILD(node_id, fn) \
2847 DT_CAT(node_id, _FOREACH_CHILD)(fn)
2889#define DT_FOREACH_CHILD_SEP(node_id, fn, sep) \
2890 DT_CAT(node_id, _FOREACH_CHILD_SEP)(fn, sep)
2907#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
2908 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
2925#define DT_FOREACH_CHILD_SEP_VARGS(node_id, fn, sep, ...) \
2926 DT_CAT(node_id, _FOREACH_CHILD_SEP_VARGS)(fn, sep, __VA_ARGS__)
2943#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
2944 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
2962#define DT_FOREACH_CHILD_STATUS_OKAY_SEP(node_id, fn, sep) \
2963 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP)(fn, sep)
2984#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
2985 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
3005#define DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(node_id, fn, sep, ...) \
3006 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP_VARGS)(fn, sep, __VA_ARGS__)
3058#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
3059 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
3103#define DT_FOREACH_PROP_ELEM_SEP(node_id, prop, fn, sep) \
3104 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP)(fn, sep)
3126#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
3127 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
3145#define DT_FOREACH_PROP_ELEM_SEP_VARGS(node_id, prop, fn, sep, ...) \
3146 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP_VARGS)( \
3147 fn, sep, __VA_ARGS__)
3202#define DT_FOREACH_STATUS_OKAY(compat, fn) \
3203 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3204 (UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
3251#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3252 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3253 (DT_CAT(DT_FOREACH_OKAY_VARGS_, \
3254 compat)(fn, __VA_ARGS__)), \
3269#define DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3270 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3271 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
3272 compat)(fn, compat, __VA_ARGS__)), \
3314#define DT_FOREACH_NODELABEL(node_id, fn) DT_CAT(node_id, _FOREACH_NODELABEL)(fn)
3353#define DT_FOREACH_NODELABEL_VARGS(node_id, fn, ...) \
3354 DT_CAT(node_id, _FOREACH_NODELABEL_VARGS)(fn, __VA_ARGS__)
3380#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
3403#define DT_NODE_HAS_STATUS(node_id, status) \
3404 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
3426#define DT_NODE_HAS_STATUS_OKAY(node_id) DT_NODE_HAS_STATUS(node_id, okay)
3447#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
3448 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
3456#define DT_NUM_INST_STATUS_OKAY(compat) \
3457 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3458 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
3487#define DT_NODE_HAS_COMPAT(node_id, compat) \
3488 IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat))
3504#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
3505 UTIL_AND(DT_NODE_HAS_COMPAT(node_id, compat), DT_NODE_HAS_STATUS(node_id, status))
3520#define DT_NODE_HAS_PROP(node_id, prop) \
3521 IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS))
3540#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
3541 IS_ENABLED(DT_CAT8(node_id, _P_, pha, \
3542 _IDX_, idx, _VAL_, cell, _EXISTS))
3553#define DT_PHA_HAS_CELL(node_id, pha, cell) \
3554 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
3597#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
3627#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus))
3645#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
3654#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
3663#define DT_INST_GPARENT(inst) DT_GPARENT(DT_DRV_INST(inst))
3674#define DT_INST_CHILD(inst, child) \
3675 DT_CHILD(DT_DRV_INST(inst), child)
3686#define DT_INST_CHILD_NUM(inst) DT_CHILD_NUM(DT_DRV_INST(inst))
3697#define DT_INST_CHILD_NUM_STATUS_OKAY(inst) \
3698 DT_CHILD_NUM_STATUS_OKAY(DT_DRV_INST(inst))
3708#define DT_INST_NODELABEL_STRING_ARRAY(inst) DT_NODELABEL_STRING_ARRAY(DT_DRV_INST(inst))
3718#define DT_INST_NUM_NODELABELS(inst) DT_NUM_NODELABELS(DT_DRV_INST(inst))
3734#define DT_INST_FOREACH_CHILD(inst, fn) \
3735 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
3750#define DT_INST_FOREACH_CHILD_SEP(inst, fn, sep) \
3751 DT_FOREACH_CHILD_SEP(DT_DRV_INST(inst), fn, sep)
3768#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
3769 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3785#define DT_INST_FOREACH_CHILD_SEP_VARGS(inst, fn, sep, ...) \
3786 DT_FOREACH_CHILD_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3799#define DT_INST_FOREACH_CHILD_STATUS_OKAY(inst, fn) \
3800 DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), fn)
3816#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(inst, fn, sep) \
3817 DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_DRV_INST(inst), fn, sep)
3832#define DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, fn, ...) \
3833 DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3850#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(inst, fn, sep, ...) \
3851 DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3859#define DT_INST_ENUM_IDX(inst, prop) \
3860 DT_ENUM_IDX(DT_DRV_INST(inst), prop)
3870#define DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) \
3871 DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value)
3881#define DT_INST_ENUM_HAS_VALUE(inst, prop, value) \
3882 DT_ENUM_HAS_VALUE(DT_DRV_INST(inst), prop, value)
3890#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
3898#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
3909#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
3910 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
3920#define DT_INST_PROP_HAS_NAME(inst, prop, name) \
3921 DT_PROP_HAS_NAME(DT_DRV_INST(inst), prop, name)
3930#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
3931 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
3940#define DT_INST_PROP_OR(inst, prop, default_value) \
3941 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
3950#define DT_INST_PROP_LEN_OR(inst, prop, default_value) \
3951 DT_PROP_LEN_OR(DT_DRV_INST(inst), prop, default_value)
3962#define DT_INST_STRING_TOKEN(inst, prop) \
3963 DT_STRING_TOKEN(DT_DRV_INST(inst), prop)
3972#define DT_INST_STRING_UPPER_TOKEN(inst, prop) \
3973 DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop)
3983#define DT_INST_STRING_UNQUOTED(inst, prop) \
3984 DT_STRING_UNQUOTED(DT_DRV_INST(inst), prop)
3993#define DT_INST_STRING_TOKEN_BY_IDX(inst, prop, idx) \
3994 DT_STRING_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4003#define DT_INST_STRING_UPPER_TOKEN_BY_IDX(inst, prop, idx) \
4004 DT_STRING_UPPER_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4013#define DT_INST_STRING_UNQUOTED_BY_IDX(inst, prop, idx) \
4014 DT_STRING_UNQUOTED_BY_IDX(DT_DRV_INST(inst), prop, idx)
4024#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
4025 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
4038#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
4039 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
4049#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
4050 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
4061#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
4062 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
4072#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
4082#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
4083 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
4094#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
4095 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
4106#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
4107 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
4117#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
4118 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
4129#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
4130 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
4140#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
4149#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
4158#define DT_INST_REG_HAS_NAME(inst, name) DT_REG_HAS_NAME(DT_DRV_INST(inst), name)
4166#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
4174#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
4175 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
4183#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
4184 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
4194#define DT_INST_REG_ADDR_BY_NAME_OR(inst, name, default_value) \
4195 DT_REG_ADDR_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4209#define DT_INST_REG_ADDR_BY_NAME_U64(inst, name) \
4210 DT_U64_C(DT_INST_REG_ADDR_BY_NAME(inst, name))
4218#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
4219 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
4229#define DT_INST_REG_SIZE_BY_NAME_OR(inst, name, default_value) \
4230 DT_REG_SIZE_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4237#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
4250#define DT_INST_REG_ADDR_U64(inst) DT_U64_C(DT_INST_REG_ADDR(inst))
4257#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
4265#define DT_INST_NUM_IRQS(inst) DT_NUM_IRQS(DT_DRV_INST(inst))
4273#define DT_INST_IRQ_LEVEL(inst) DT_IRQ_LEVEL(DT_DRV_INST(inst))
4282#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
4283 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
4291#define DT_INST_IRQ_INTC_BY_IDX(inst, idx) \
4292 DT_IRQ_INTC_BY_IDX(DT_DRV_INST(inst), idx)
4300#define DT_INST_IRQ_INTC_BY_NAME(inst, name) \
4301 DT_IRQ_INTC_BY_NAME(DT_DRV_INST(inst), name)
4310#define DT_INST_IRQ_INTC(inst) \
4311 DT_INST_IRQ_INTC_BY_IDX(inst, 0)
4320#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
4321 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
4329#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
4336#define DT_INST_IRQN(inst) DT_IRQN(DT_DRV_INST(inst))
4344#define DT_INST_IRQN_BY_IDX(inst, idx) DT_IRQN_BY_IDX(DT_DRV_INST(inst), idx)
4351#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
4360#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
4371#define DT_INST_STRING_TOKEN_OR(inst, name, default_value) \
4372 DT_STRING_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4382#define DT_INST_STRING_UPPER_TOKEN_OR(inst, name, default_value) \
4383 DT_STRING_UPPER_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4393#define DT_INST_STRING_UNQUOTED_OR(inst, name, default_value) \
4394 DT_STRING_UNQUOTED_OR(DT_DRV_INST(inst), name, default_value)
4426#define DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) \
4427 IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus))
4461#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
4462 DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(DT_DRV_COMPAT, bus)
4508#define DT_ANY_INST_HAS_PROP_STATUS_OKAY(prop) \
4509 COND_CODE_1(IS_EMPTY(DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop)), (0), (1))
4554#define DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(compat, prop) \
4555 (DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, DT_COMPAT_NODE_HAS_PROP_AND_OR, prop) 0)
4622#define DT_INST_FOREACH_STATUS_OKAY(fn) \
4623 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4624 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
4625 DT_DRV_COMPAT)(fn)), \
4640#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
4641 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4642 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
4643 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
4655#define DT_INST_FOREACH_NODELABEL(inst, fn) \
4656 DT_FOREACH_NODELABEL(DT_DRV_INST(inst), fn)
4669#define DT_INST_FOREACH_NODELABEL_VARGS(inst, fn, ...) \
4670 DT_FOREACH_NODELABEL_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
4682#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
4683 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
4697#define DT_INST_FOREACH_PROP_ELEM_SEP(inst, prop, fn, sep) \
4698 DT_FOREACH_PROP_ELEM_SEP(DT_DRV_INST(inst), prop, fn, sep)
4714#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
4715 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
4734#define DT_INST_FOREACH_PROP_ELEM_SEP_VARGS(inst, prop, fn, sep, ...) \
4735 DT_FOREACH_PROP_ELEM_SEP_VARGS(DT_DRV_INST(inst), prop, fn, sep, \
4744#define DT_INST_NODE_HAS_PROP(inst, prop) \
4745 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
4753#define DT_INST_NODE_HAS_COMPAT(inst, compat) \
4754 DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), compat)
4766#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
4767 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
4778#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
4779 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
4788#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
4798#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
4799 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
4808#define DT_INST_IRQ_HAS_CELL(inst, cell) \
4809 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
4817#define DT_INST_IRQ_HAS_NAME(inst, name) \
4818 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
4837#define DT_ANY_INST_HAS_PROP_STATUS_OKAY__(idx, prop) \
4838 COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, prop), (1,), ())
4851#define DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop) \
4852 DT_INST_FOREACH_STATUS_OKAY_VARGS(DT_ANY_INST_HAS_PROP_STATUS_OKAY__, prop)
4854#define DT_PATH_INTERNAL(...) \
4855 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
4861#define DT_S_PREFIX(name) _S_##name
4877#define DT_CAT(a1, a2) a1 ## a2
4879#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
4881#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
4883#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
4885#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
4887#define DT_CAT7(a1, a2, a3, a4, a5, a6, a7) \
4888 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
4890#define DT_CAT8(a1, a2, a3, a4, a5, a6, a7, a8) \
4891 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7 ## a8
4898#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
4900#define DT_DASH_PREFIX(name) _##name
4902#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
4903 IS_ENABLED(DT_CAT3(node_id, _STATUS_, status))
4908#define DT_COMPAT_NODE_HAS_PROP_AND_OR(inst, compat, prop) \
4909 DT_NODE_HAS_PROP(DT_INST(inst, compat), prop) ||
4915#if defined(_LINKER) || defined(_ASMLANGUAGE)
4916#define DT_U64_C(_v) (_v)
4918#define DT_U64_C(_v) UINT64_C(_v)
4924#define DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL(nodelabel) DT_STRINGIFY_INTERNAL(nodelabel),
4925#define DT_STRINGIFY_INTERNAL(arg) DT_STRINGIFY_INTERNAL_HELPER(arg)
4926#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.