19#include <zephyr/devicetree_generated.h>
22#if !defined(_LINKER) && !defined(_ASMLANGUAGE)
83#define DT_INVALID_NODE _
140#define DT_PATH(...) DT_PATH_INTERNAL(__VA_ARGS__)
196#define DT_NODELABEL(label) DT_CAT(DT_N_NODELABEL_, label)
236#define DT_ALIAS(alias) DT_CAT(DT_N_ALIAS_, alias)
332#define DT_INST(inst, compat) UTIL_CAT(DT_N_INST, DT_DASH(inst, compat))
357#define DT_PARENT(node_id) DT_CAT(node_id, _PARENT)
382#define DT_GPARENT(node_id) DT_PARENT(DT_PARENT(node_id))
419#define DT_CHILD(node_id, child) UTIL_CAT(node_id, DT_S_PREFIX(child))
462#define DT_COMPAT_GET_ANY_STATUS_OKAY(compat) \
463 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
464 (DT_INST(0, compat)), \
494#define DT_NODE_PATH(node_id) DT_CAT(node_id, _PATH)
520#define DT_NODE_FULL_NAME(node_id) DT_CAT(node_id, _FULL_NAME)
548#define DT_NODE_FULL_NAME_UNQUOTED(node_id) DT_CAT(node_id, _FULL_NAME_UNQUOTED)
576#define DT_NODE_FULL_NAME_TOKEN(node_id) DT_CAT(node_id, _FULL_NAME_TOKEN)
606#define DT_NODE_FULL_NAME_UPPER_TOKEN(node_id) DT_CAT(node_id, _FULL_NAME_UPPER_TOKEN)
634#define DT_NODE_CHILD_IDX(node_id) DT_CAT(node_id, _CHILD_IDX)
642#define DT_CHILD_NUM(node_id) DT_CAT(node_id, _CHILD_NUM)
652#define DT_CHILD_NUM_STATUS_OKAY(node_id) \
653 DT_CAT(node_id, _CHILD_NUM_STATUS_OKAY)
675#define DT_SAME_NODE(node_id1, node_id2) \
676 (DT_DEP_ORD(node_id1) == (DT_DEP_ORD(node_id2)))
702#define DT_NODELABEL_STRING_ARRAY(node_id) \
703 { DT_FOREACH_NODELABEL(node_id, DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL) }
745#define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
779#define DT_PROP_LEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _LEN)
795#define DT_PROP_LEN_OR(node_id, prop, default_value) \
796 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
797 (DT_PROP_LEN(node_id, prop)), (default_value))
819#define DT_PROP_HAS_IDX(node_id, prop, idx) \
820 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
854#define DT_PROP_HAS_NAME(node_id, prop, name) \
855 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _NAME_, name, _EXISTS))
891#define DT_PROP_BY_IDX(node_id, prop, idx) \
892 DT_CAT5(node_id, _P_, prop, _IDX_, idx)
907#define DT_PROP_OR(node_id, prop, default_value) \
908 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
909 (DT_PROP(node_id, prop)), (default_value))
966#define DT_ENUM_IDX_BY_IDX(node_id, prop, idx) \
967 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _ENUM_IDX)
975#define DT_ENUM_IDX(node_id, prop) DT_ENUM_IDX_BY_IDX(node_id, prop, 0)
992#define DT_ENUM_IDX_BY_IDX_OR(node_id, prop, idx, default_idx_value) \
993 COND_CODE_1(DT_PROP_HAS_IDX(node_id, prop, idx), \
994 (DT_ENUM_IDX_BY_IDX(node_id, prop, idx)), (default_idx_value))
1004#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
1005 DT_ENUM_IDX_BY_IDX_OR(node_id, prop, 0, default_idx_value)
1016#define DT_ENUM_HAS_VALUE_BY_IDX(node_id, prop, idx, value) \
1017 IS_ENABLED(DT_CAT8(node_id, _P_, prop, _IDX_, idx, _ENUM_VAL_, value, _EXISTS))
1026#define DT_ENUM_HAS_VALUE(node_id, prop, value) \
1027 DT_ENUM_HAS_VALUE_BY_IDX(node_id, prop, 0, value)
1088#define DT_STRING_TOKEN(node_id, prop) \
1089 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
1104#define DT_STRING_TOKEN_OR(node_id, prop, default_value) \
1105 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1106 (DT_STRING_TOKEN(node_id, prop)), (default_value))
1165#define DT_STRING_UPPER_TOKEN(node_id, prop) \
1166 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
1182#define DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value) \
1183 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1184 (DT_STRING_UPPER_TOKEN(node_id, prop)), (default_value))
1226#define DT_STRING_UNQUOTED(node_id, prop) \
1227 DT_CAT4(node_id, _P_, prop, _STRING_UNQUOTED)
1243#define DT_STRING_UNQUOTED_OR(node_id, prop, default_value) \
1244 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1245 (DT_STRING_UNQUOTED(node_id, prop)), (default_value))
1294#define DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) \
1295 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_TOKEN)
1344#define DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx) \
1345 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UPPER_TOKEN)
1387#define DT_STRING_UNQUOTED_BY_IDX(node_id, prop, idx) \
1388 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UNQUOTED)
1443#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
1444 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
1465#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
1466 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
1479#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
1480 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
1536#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
1537 DT_CAT7(node_id, _P_, pha, _IDX_, idx, _VAL_, cell)
1562#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
1563 DT_PROP_OR(node_id, DT_CAT5(pha, _IDX_, idx, _VAL_, cell), default_value)
1572#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
1588#define DT_PHA_OR(node_id, pha, cell, default_value) \
1589 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1631#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1632 DT_CAT7(node_id, _P_, pha, _NAME_, name, _VAL_, cell)
1655#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1656 DT_PROP_OR(node_id, DT_CAT5(pha, _NAME_, name, _VAL_, cell), default_value)
1705#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1706 DT_CAT6(node_id, _P_, pha, _NAME_, name, _PH)
1757#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1758 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1771#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1819#define DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM)
1873#define DT_RANGES_HAS_IDX(node_id, idx) \
1874 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS))
1928#define DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) \
1929 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS))
1968#define DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) \
1969 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS)
2017#define DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) \
2018 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS)
2066#define DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) \
2067 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS)
2115#define DT_RANGES_LENGTH_BY_IDX(node_id, idx) \
2116 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH)
2157#define DT_FOREACH_RANGE(node_id, fn) \
2158 DT_CAT(node_id, _FOREACH_RANGE)(fn)
2205#define DT_NODE_VENDOR_BY_IDX(node_id, idx) \
2206 DT_CAT3(node_id, _COMPAT_VENDOR_IDX_, idx)
2220#define DT_NODE_VENDOR_HAS_IDX(node_id, idx) \
2221 IS_ENABLED(DT_CAT4(node_id, _COMPAT_VENDOR_IDX_, idx, _EXISTS))
2237#define DT_NODE_VENDOR_BY_IDX_OR(node_id, idx, default_value) \
2238 COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(node_id, idx), \
2239 (DT_NODE_VENDOR_BY_IDX(node_id, idx)), (default_value))
2249#define DT_NODE_VENDOR_OR(node_id, default_value) \
2250 DT_NODE_VENDOR_BY_IDX_OR(node_id, 0, default_value)
2281#define DT_NODE_MODEL_BY_IDX(node_id, idx) \
2282 DT_CAT3(node_id, _COMPAT_MODEL_IDX_, idx)
2296#define DT_NODE_MODEL_HAS_IDX(node_id, idx) \
2297 IS_ENABLED(DT_CAT4(node_id, _COMPAT_MODEL_IDX_, idx, _EXISTS))
2313#define DT_NODE_MODEL_BY_IDX_OR(node_id, idx, default_value) \
2314 COND_CODE_1(DT_NODE_MODEL_HAS_IDX(node_id, idx), \
2315 (DT_NODE_MODEL_BY_IDX(node_id, idx)), (default_value))
2325#define DT_NODE_MODEL_OR(node_id, default_value) \
2326 DT_NODE_MODEL_BY_IDX_OR(node_id, 0, default_value)
2345#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
2358#define DT_REG_HAS_IDX(node_id, idx) \
2359 IS_ENABLED(DT_CAT4(node_id, _REG_IDX_, idx, _EXISTS))
2372#define DT_REG_HAS_NAME(node_id, name) \
2373 IS_ENABLED(DT_CAT4(node_id, _REG_NAME_, name, _EXISTS))
2386#define DT_REG_ADDR_BY_IDX_RAW(node_id, idx) \
2387 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS)
2400#define DT_REG_ADDR_RAW(node_id) \
2401 DT_REG_ADDR_BY_IDX_RAW(node_id, 0)
2409#define DT_REG_ADDR_BY_IDX(node_id, idx) \
2410 DT_U32_C(DT_REG_ADDR_BY_IDX_RAW(node_id, idx))
2423#define DT_REG_SIZE_BY_IDX(node_id, idx) \
2424 DT_U32_C(DT_CAT4(node_id, _REG_IDX_, idx, _VAL_SIZE))
2433#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
2445#define DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR_BY_IDX_RAW(node_id, 0))
2454#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
2462#define DT_REG_ADDR_BY_NAME(node_id, name) \
2463 DT_U32_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS))
2473#define DT_REG_ADDR_BY_NAME_OR(node_id, name, default_value) \
2474 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2475 (DT_REG_ADDR_BY_NAME(node_id, name)), (default_value))
2489#define DT_REG_ADDR_BY_NAME_U64(node_id, name) \
2490 DT_U64_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS))
2498#define DT_REG_SIZE_BY_NAME(node_id, name) \
2499 DT_U32_C(DT_CAT4(node_id, _REG_NAME_, name, _VAL_SIZE))
2509#define DT_REG_SIZE_BY_NAME_OR(node_id, name, default_value) \
2510 COND_CODE_1(DT_REG_HAS_NAME(node_id, name), \
2511 (DT_REG_SIZE_BY_NAME(node_id, name)), (default_value))
2532#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
2558#define DT_NUM_NODELABELS(node_id) DT_CAT(node_id, _NODELABEL_NUM)
2566#define DT_IRQ_LEVEL(node_id) DT_CAT(node_id, _IRQ_LEVEL)
2578#define DT_IRQ_HAS_IDX(node_id, idx) \
2579 IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS))
2591#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
2592 IS_ENABLED(DT_CAT6(node_id, _IRQ_IDX_, idx, _VAL_, cell, _EXISTS))
2601#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
2612#define DT_IRQ_HAS_NAME(node_id, name) \
2613 IS_ENABLED(DT_CAT4(node_id, _IRQ_NAME_, name, _VAL_irq_EXISTS))
2650#define DT_IRQ_BY_IDX(node_id, idx, cell) \
2651 DT_CAT5(node_id, _IRQ_IDX_, idx, _VAL_, cell)
2668#define DT_IRQ_BY_NAME(node_id, name, cell) \
2669 DT_CAT5(node_id, _IRQ_NAME_, name, _VAL_, cell)
2678#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
2722#define DT_IRQ_INTC_BY_IDX(node_id, idx) \
2723 DT_CAT4(node_id, _IRQ_IDX_, idx, _CONTROLLER)
2769#define DT_IRQ_INTC_BY_NAME(node_id, name) \
2770 DT_CAT4(node_id, _IRQ_NAME_, name, _CONTROLLER)
2811#define DT_IRQ_INTC(node_id) \
2812 DT_IRQ_INTC_BY_IDX(node_id, 0)
2819#define DT_IRQN_L1_INTERNAL(node_id, idx) DT_IRQ_BY_IDX(node_id, idx, irq)
2821#define DT_IRQN_L2_INTERNAL(node_id, idx) \
2822 (IRQ_TO_L2(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2823 DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq))
2825#define DT_IRQN_L3_INTERNAL(node_id, idx) \
2826 (IRQ_TO_L3(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2827 IRQ_TO_L2(DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq)) | \
2828 DT_IRQ(DT_IRQ_INTC(DT_IRQ_INTC_BY_IDX(node_id, idx)), irq))
2830#define DT_IRQN_LVL_INTERNAL(node_id, idx, level) DT_CAT3(DT_IRQN_L, level, _INTERNAL)(node_id, idx)
2836#define DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx) \
2837 DT_IRQN_LVL_INTERNAL(node_id, idx, DT_IRQ_LEVEL(node_id))
2851#define DT_IRQN_BY_IDX(node_id, idx) \
2852 COND_CODE_1(IS_ENABLED(CONFIG_MULTI_LEVEL_INTERRUPTS), \
2853 (DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx)), \
2854 (DT_IRQ_BY_IDX(node_id, idx, irq)))
2866#define DT_IRQN(node_id) DT_IRQN_BY_IDX(node_id, 0)
2886#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
2894#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS))
2915#define DT_FOREACH_NODE(fn) DT_FOREACH_HELPER(fn)
2929#define DT_FOREACH_NODE_VARGS(fn, ...) DT_FOREACH_VARGS_HELPER(fn, __VA_ARGS__)
2942#define DT_FOREACH_STATUS_OKAY_NODE(fn) DT_FOREACH_OKAY_HELPER(fn)
2958#define DT_FOREACH_STATUS_OKAY_NODE_VARGS(fn, ...) DT_FOREACH_OKAY_VARGS_HELPER(fn, __VA_ARGS__)
3003#define DT_FOREACH_CHILD(node_id, fn) \
3004 DT_CAT(node_id, _FOREACH_CHILD)(fn)
3046#define DT_FOREACH_CHILD_SEP(node_id, fn, sep) \
3047 DT_CAT(node_id, _FOREACH_CHILD_SEP)(fn, sep)
3064#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
3065 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
3082#define DT_FOREACH_CHILD_SEP_VARGS(node_id, fn, sep, ...) \
3083 DT_CAT(node_id, _FOREACH_CHILD_SEP_VARGS)(fn, sep, __VA_ARGS__)
3100#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
3101 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
3119#define DT_FOREACH_CHILD_STATUS_OKAY_SEP(node_id, fn, sep) \
3120 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP)(fn, sep)
3141#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
3142 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
3162#define DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(node_id, fn, sep, ...) \
3163 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP_VARGS)(fn, sep, __VA_ARGS__)
3215#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
3216 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
3260#define DT_FOREACH_PROP_ELEM_SEP(node_id, prop, fn, sep) \
3261 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP)(fn, sep)
3283#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
3284 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
3302#define DT_FOREACH_PROP_ELEM_SEP_VARGS(node_id, prop, fn, sep, ...) \
3303 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP_VARGS)( \
3304 fn, sep, __VA_ARGS__)
3359#define DT_FOREACH_STATUS_OKAY(compat, fn) \
3360 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3361 (UTIL_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
3408#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3409 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3410 (DT_CAT(DT_FOREACH_OKAY_VARGS_, \
3411 compat)(fn, __VA_ARGS__)), \
3426#define DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3427 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3428 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
3429 compat)(fn, compat, __VA_ARGS__)), \
3471#define DT_FOREACH_NODELABEL(node_id, fn) DT_CAT(node_id, _FOREACH_NODELABEL)(fn)
3510#define DT_FOREACH_NODELABEL_VARGS(node_id, fn, ...) \
3511 DT_CAT(node_id, _FOREACH_NODELABEL_VARGS)(fn, __VA_ARGS__)
3537#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
3560#define DT_NODE_HAS_STATUS(node_id, status) \
3561 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
3583#define DT_NODE_HAS_STATUS_OKAY(node_id) DT_NODE_HAS_STATUS(node_id, okay)
3604#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
3605 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
3613#define DT_NUM_INST_STATUS_OKAY(compat) \
3614 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3615 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
3644#define DT_NODE_HAS_COMPAT(node_id, compat) \
3645 IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat))
3661#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
3662 UTIL_AND(DT_NODE_HAS_COMPAT(node_id, compat), DT_NODE_HAS_STATUS(node_id, status))
3677#define DT_NODE_HAS_PROP(node_id, prop) \
3678 IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS))
3697#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
3698 IS_ENABLED(DT_CAT8(node_id, _P_, pha, \
3699 _IDX_, idx, _VAL_, cell, _EXISTS))
3710#define DT_PHA_HAS_CELL(node_id, pha, cell) \
3711 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
3754#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
3784#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus))
3802#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
3811#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
3820#define DT_INST_GPARENT(inst) DT_GPARENT(DT_DRV_INST(inst))
3831#define DT_INST_CHILD(inst, child) \
3832 DT_CHILD(DT_DRV_INST(inst), child)
3843#define DT_INST_CHILD_NUM(inst) DT_CHILD_NUM(DT_DRV_INST(inst))
3854#define DT_INST_CHILD_NUM_STATUS_OKAY(inst) \
3855 DT_CHILD_NUM_STATUS_OKAY(DT_DRV_INST(inst))
3865#define DT_INST_NODELABEL_STRING_ARRAY(inst) DT_NODELABEL_STRING_ARRAY(DT_DRV_INST(inst))
3875#define DT_INST_NUM_NODELABELS(inst) DT_NUM_NODELABELS(DT_DRV_INST(inst))
3891#define DT_INST_FOREACH_CHILD(inst, fn) \
3892 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
3907#define DT_INST_FOREACH_CHILD_SEP(inst, fn, sep) \
3908 DT_FOREACH_CHILD_SEP(DT_DRV_INST(inst), fn, sep)
3925#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
3926 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3942#define DT_INST_FOREACH_CHILD_SEP_VARGS(inst, fn, sep, ...) \
3943 DT_FOREACH_CHILD_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3956#define DT_INST_FOREACH_CHILD_STATUS_OKAY(inst, fn) \
3957 DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), fn)
3973#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(inst, fn, sep) \
3974 DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_DRV_INST(inst), fn, sep)
3989#define DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, fn, ...) \
3990 DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
4007#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(inst, fn, sep, ...) \
4008 DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
4017#define DT_INST_ENUM_IDX_BY_IDX(inst, prop, idx) \
4018 DT_ENUM_IDX_BY_IDX(DT_DRV_INST(inst), prop, idx)
4026#define DT_INST_ENUM_IDX(inst, prop) \
4027 DT_ENUM_IDX(DT_DRV_INST(inst), prop)
4038#define DT_INST_ENUM_IDX_BY_IDX_OR(inst, prop, idx, default_idx_value) \
4039 DT_ENUM_IDX_BY_IDX_OR(DT_DRV_INST(inst), prop, idx, default_idx_value)
4049#define DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) \
4050 DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value)
4060#define DT_INST_ENUM_HAS_VALUE_BY_IDX(inst, prop, idx, value) \
4061 DT_ENUM_HAS_VALUE_BY_IDX(DT_DRV_INST(inst), prop, idx, value)
4071#define DT_INST_ENUM_HAS_VALUE(inst, prop, value) \
4072 DT_ENUM_HAS_VALUE(DT_DRV_INST(inst), prop, value)
4080#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
4088#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
4099#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
4100 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
4110#define DT_INST_PROP_HAS_NAME(inst, prop, name) \
4111 DT_PROP_HAS_NAME(DT_DRV_INST(inst), prop, name)
4120#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
4121 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
4130#define DT_INST_PROP_OR(inst, prop, default_value) \
4131 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
4140#define DT_INST_PROP_LEN_OR(inst, prop, default_value) \
4141 DT_PROP_LEN_OR(DT_DRV_INST(inst), prop, default_value)
4152#define DT_INST_STRING_TOKEN(inst, prop) \
4153 DT_STRING_TOKEN(DT_DRV_INST(inst), prop)
4162#define DT_INST_STRING_UPPER_TOKEN(inst, prop) \
4163 DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop)
4173#define DT_INST_STRING_UNQUOTED(inst, prop) \
4174 DT_STRING_UNQUOTED(DT_DRV_INST(inst), prop)
4183#define DT_INST_STRING_TOKEN_BY_IDX(inst, prop, idx) \
4184 DT_STRING_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4193#define DT_INST_STRING_UPPER_TOKEN_BY_IDX(inst, prop, idx) \
4194 DT_STRING_UPPER_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
4203#define DT_INST_STRING_UNQUOTED_BY_IDX(inst, prop, idx) \
4204 DT_STRING_UNQUOTED_BY_IDX(DT_DRV_INST(inst), prop, idx)
4214#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
4215 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
4228#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
4229 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
4239#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
4240 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
4251#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
4252 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
4262#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
4272#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
4273 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
4284#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
4285 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
4296#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
4297 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
4307#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
4308 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
4319#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
4320 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
4330#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
4339#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
4348#define DT_INST_REG_HAS_NAME(inst, name) DT_REG_HAS_NAME(DT_DRV_INST(inst), name)
4356#define DT_INST_REG_ADDR_BY_IDX_RAW(inst, idx) DT_REG_ADDR_BY_IDX_RAW(DT_DRV_INST(inst), idx)
4364#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
4372#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
4373 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
4381#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
4382 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
4392#define DT_INST_REG_ADDR_BY_NAME_OR(inst, name, default_value) \
4393 DT_REG_ADDR_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4407#define DT_INST_REG_ADDR_BY_NAME_U64(inst, name) \
4408 DT_REG_ADDR_BY_NAME_U64(DT_DRV_INST(inst), name)
4416#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
4417 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
4427#define DT_INST_REG_SIZE_BY_NAME_OR(inst, name, default_value) \
4428 DT_REG_SIZE_BY_NAME_OR(DT_DRV_INST(inst), name, default_value)
4435#define DT_INST_REG_ADDR_RAW(inst) DT_INST_REG_ADDR_BY_IDX_RAW(inst, 0)
4442#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
4455#define DT_INST_REG_ADDR_U64(inst) DT_REG_ADDR_U64(DT_DRV_INST(inst))
4462#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
4470#define DT_INST_NUM_IRQS(inst) DT_NUM_IRQS(DT_DRV_INST(inst))
4478#define DT_INST_IRQ_LEVEL(inst) DT_IRQ_LEVEL(DT_DRV_INST(inst))
4487#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
4488 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
4496#define DT_INST_IRQ_INTC_BY_IDX(inst, idx) \
4497 DT_IRQ_INTC_BY_IDX(DT_DRV_INST(inst), idx)
4505#define DT_INST_IRQ_INTC_BY_NAME(inst, name) \
4506 DT_IRQ_INTC_BY_NAME(DT_DRV_INST(inst), name)
4515#define DT_INST_IRQ_INTC(inst) \
4516 DT_INST_IRQ_INTC_BY_IDX(inst, 0)
4525#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
4526 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
4534#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
4541#define DT_INST_IRQN(inst) DT_IRQN(DT_DRV_INST(inst))
4549#define DT_INST_IRQN_BY_IDX(inst, idx) DT_IRQN_BY_IDX(DT_DRV_INST(inst), idx)
4556#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
4565#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
4576#define DT_INST_STRING_TOKEN_OR(inst, name, default_value) \
4577 DT_STRING_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4587#define DT_INST_STRING_UPPER_TOKEN_OR(inst, name, default_value) \
4588 DT_STRING_UPPER_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4598#define DT_INST_STRING_UNQUOTED_OR(inst, name, default_value) \
4599 DT_STRING_UNQUOTED_OR(DT_DRV_INST(inst), name, default_value)
4631#define DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) \
4632 IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus))
4666#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
4667 DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(DT_DRV_COMPAT, bus)
4713#define DT_ANY_INST_HAS_PROP_STATUS_OKAY(prop) \
4714 COND_CODE_1(IS_EMPTY(DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop)), (0), (1))
4760#define DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(compat, prop) \
4761 (DT_COMPAT_FOREACH_STATUS_OKAY_VARGS(compat, DT_COMPAT_NODE_HAS_PROP_AND_OR, prop) 0)
4828#define DT_INST_FOREACH_STATUS_OKAY(fn) \
4829 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4830 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
4831 DT_DRV_COMPAT)(fn)), \
4846#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
4847 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4848 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
4849 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
4861#define DT_INST_FOREACH_NODELABEL(inst, fn) \
4862 DT_FOREACH_NODELABEL(DT_DRV_INST(inst), fn)
4875#define DT_INST_FOREACH_NODELABEL_VARGS(inst, fn, ...) \
4876 DT_FOREACH_NODELABEL_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
4888#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
4889 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
4903#define DT_INST_FOREACH_PROP_ELEM_SEP(inst, prop, fn, sep) \
4904 DT_FOREACH_PROP_ELEM_SEP(DT_DRV_INST(inst), prop, fn, sep)
4920#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
4921 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
4940#define DT_INST_FOREACH_PROP_ELEM_SEP_VARGS(inst, prop, fn, sep, ...) \
4941 DT_FOREACH_PROP_ELEM_SEP_VARGS(DT_DRV_INST(inst), prop, fn, sep, \
4950#define DT_INST_NODE_HAS_PROP(inst, prop) \
4951 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
4959#define DT_INST_NODE_HAS_COMPAT(inst, compat) \
4960 DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), compat)
4972#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
4973 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
4984#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
4985 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
4994#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
5004#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
5005 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
5014#define DT_INST_IRQ_HAS_CELL(inst, cell) \
5015 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
5023#define DT_INST_IRQ_HAS_NAME(inst, name) \
5024 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
5043#define DT_ANY_INST_HAS_PROP_STATUS_OKAY__(idx, prop) \
5044 COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, prop), (1,), ())
5057#define DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop) \
5058 DT_INST_FOREACH_STATUS_OKAY_VARGS(DT_ANY_INST_HAS_PROP_STATUS_OKAY__, prop)
5060#define DT_PATH_INTERNAL(...) \
5061 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
5067#define DT_S_PREFIX(name) _S_##name
5083#define DT_CAT(a1, a2) a1 ## a2
5085#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
5087#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
5089#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
5091#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
5093#define DT_CAT7(a1, a2, a3, a4, a5, a6, a7) \
5094 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
5096#define DT_CAT8(a1, a2, a3, a4, a5, a6, a7, a8) \
5097 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7 ## a8
5104#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
5106#define DT_DASH_PREFIX(name) _##name
5108#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
5109 IS_ENABLED(DT_CAT3(node_id, _STATUS_, status))
5114#define DT_COMPAT_NODE_HAS_PROP_AND_OR(inst, compat, prop) \
5115 DT_NODE_HAS_PROP(DT_INST(inst, compat), prop) ||
5121#if defined(_LINKER) || defined(_ASMLANGUAGE)
5122#define DT_U32_C(_v) (_v)
5124#define DT_U32_C(_v) UINT32_C(_v)
5131#if defined(_LINKER) || defined(_ASMLANGUAGE)
5132#define DT_U64_C(_v) (_v)
5134#define DT_U64_C(_v) UINT64_C(_v)
5140#define DT_NODELABEL_STRING_ARRAY_ENTRY_INTERNAL(nodelabel) DT_STRINGIFY_INTERNAL(nodelabel),
5141#define DT_STRINGIFY_INTERNAL(arg) DT_STRINGIFY_INTERNAL_HELPER(arg)
5142#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.