19#include <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)))
636#define DT_PROP(node_id, prop) DT_CAT3(node_id, _P_, prop)
670#define DT_PROP_LEN(node_id, prop) DT_CAT4(node_id, _P_, prop, _LEN)
686#define DT_PROP_LEN_OR(node_id, prop, default_value) \
687 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
688 (DT_PROP_LEN(node_id, prop)), (default_value))
710#define DT_PROP_HAS_IDX(node_id, prop, idx) \
711 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _IDX_, idx, _EXISTS))
745#define DT_PROP_HAS_NAME(node_id, prop, name) \
746 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _NAME_, name, _EXISTS))
782#define DT_PROP_BY_IDX(node_id, prop, idx) \
783 DT_CAT5(node_id, _P_, prop, _IDX_, idx)
798#define DT_PROP_OR(node_id, prop, default_value) \
799 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
800 (DT_PROP(node_id, prop)), (default_value))
842#define DT_ENUM_IDX(node_id, prop) DT_CAT4(node_id, _P_, prop, _ENUM_IDX)
858#define DT_ENUM_IDX_OR(node_id, prop, default_idx_value) \
859 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
860 (DT_ENUM_IDX(node_id, prop)), (default_idx_value))
870#define DT_ENUM_HAS_VALUE(node_id, prop, value) \
871 IS_ENABLED(DT_CAT6(node_id, _P_, prop, _ENUM_VAL_, value, _EXISTS))
932#define DT_STRING_TOKEN(node_id, prop) \
933 DT_CAT4(node_id, _P_, prop, _STRING_TOKEN)
948#define DT_STRING_TOKEN_OR(node_id, prop, default_value) \
949 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
950 (DT_STRING_TOKEN(node_id, prop)), (default_value))
1009#define DT_STRING_UPPER_TOKEN(node_id, prop) \
1010 DT_CAT4(node_id, _P_, prop, _STRING_UPPER_TOKEN)
1026#define DT_STRING_UPPER_TOKEN_OR(node_id, prop, default_value) \
1027 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1028 (DT_STRING_UPPER_TOKEN(node_id, prop)), (default_value))
1070#define DT_STRING_UNQUOTED(node_id, prop) \
1071 DT_CAT4(node_id, _P_, prop, _STRING_UNQUOTED)
1087#define DT_STRING_UNQUOTED_OR(node_id, prop, default_value) \
1088 COND_CODE_1(DT_NODE_HAS_PROP(node_id, prop), \
1089 (DT_STRING_UNQUOTED(node_id, prop)), (default_value))
1138#define DT_STRING_TOKEN_BY_IDX(node_id, prop, idx) \
1139 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_TOKEN)
1188#define DT_STRING_UPPER_TOKEN_BY_IDX(node_id, prop, idx) \
1189 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UPPER_TOKEN)
1231#define DT_STRING_UNQUOTED_BY_IDX(node_id, prop, idx) \
1232 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _STRING_UNQUOTED)
1287#define DT_PROP_BY_PHANDLE_IDX(node_id, phs, idx, prop) \
1288 DT_PROP(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop)
1309#define DT_PROP_BY_PHANDLE_IDX_OR(node_id, phs, idx, prop, default_value) \
1310 DT_PROP_OR(DT_PHANDLE_BY_IDX(node_id, phs, idx), prop, default_value)
1323#define DT_PROP_BY_PHANDLE(node_id, ph, prop) \
1324 DT_PROP_BY_PHANDLE_IDX(node_id, ph, 0, prop)
1380#define DT_PHA_BY_IDX(node_id, pha, idx, cell) \
1381 DT_CAT7(node_id, _P_, pha, _IDX_, idx, _VAL_, cell)
1406#define DT_PHA_BY_IDX_OR(node_id, pha, idx, cell, default_value) \
1407 DT_PROP_OR(node_id, DT_CAT5(pha, _IDX_, idx, _VAL_, cell), default_value)
1416#define DT_PHA(node_id, pha, cell) DT_PHA_BY_IDX(node_id, pha, 0, cell)
1432#define DT_PHA_OR(node_id, pha, cell, default_value) \
1433 DT_PHA_BY_IDX_OR(node_id, pha, 0, cell, default_value)
1475#define DT_PHA_BY_NAME(node_id, pha, name, cell) \
1476 DT_CAT7(node_id, _P_, pha, _NAME_, name, _VAL_, cell)
1499#define DT_PHA_BY_NAME_OR(node_id, pha, name, cell, default_value) \
1500 DT_PROP_OR(node_id, DT_CAT5(pha, _NAME_, name, _VAL_, cell), default_value)
1549#define DT_PHANDLE_BY_NAME(node_id, pha, name) \
1550 DT_CAT6(node_id, _P_, pha, _NAME_, name, _PH)
1601#define DT_PHANDLE_BY_IDX(node_id, prop, idx) \
1602 DT_CAT6(node_id, _P_, prop, _IDX_, idx, _PH)
1615#define DT_PHANDLE(node_id, prop) DT_PHANDLE_BY_IDX(node_id, prop, 0)
1663#define DT_NUM_RANGES(node_id) DT_CAT(node_id, _RANGES_NUM)
1717#define DT_RANGES_HAS_IDX(node_id, idx) \
1718 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _EXISTS))
1772#define DT_RANGES_HAS_CHILD_BUS_FLAGS_AT_IDX(node_id, idx) \
1773 IS_ENABLED(DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS_EXISTS))
1812#define DT_RANGES_CHILD_BUS_FLAGS_BY_IDX(node_id, idx) \
1813 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_FLAGS)
1861#define DT_RANGES_CHILD_BUS_ADDRESS_BY_IDX(node_id, idx) \
1862 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_CHILD_BUS_ADDRESS)
1910#define DT_RANGES_PARENT_BUS_ADDRESS_BY_IDX(node_id, idx) \
1911 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_PARENT_BUS_ADDRESS)
1959#define DT_RANGES_LENGTH_BY_IDX(node_id, idx) \
1960 DT_CAT4(node_id, _RANGES_IDX_, idx, _VAL_LENGTH)
2001#define DT_FOREACH_RANGE(node_id, fn) \
2002 DT_CAT(node_id, _FOREACH_RANGE)(fn)
2049#define DT_NODE_VENDOR_BY_IDX(node_id, idx) \
2050 DT_CAT3(node_id, _COMPAT_VENDOR_IDX_, idx)
2064#define DT_NODE_VENDOR_HAS_IDX(node_id, idx) \
2065 IS_ENABLED(DT_CAT4(node_id, _COMPAT_VENDOR_IDX_, idx, _EXISTS))
2081#define DT_NODE_VENDOR_BY_IDX_OR(node_id, idx, default_value) \
2082 COND_CODE_1(DT_NODE_VENDOR_HAS_IDX(node_id, idx), \
2083 (DT_NODE_VENDOR_BY_IDX(node_id, idx)), (default_value))
2093#define DT_NODE_VENDOR_OR(node_id, default_value) \
2094 DT_NODE_VENDOR_BY_IDX_OR(node_id, 0, default_value)
2125#define DT_NODE_MODEL_BY_IDX(node_id, idx) \
2126 DT_CAT3(node_id, _COMPAT_MODEL_IDX_, idx)
2140#define DT_NODE_MODEL_HAS_IDX(node_id, idx) \
2141 IS_ENABLED(DT_CAT4(node_id, _COMPAT_MODEL_IDX_, idx, _EXISTS))
2157#define DT_NODE_MODEL_BY_IDX_OR(node_id, idx, default_value) \
2158 COND_CODE_1(DT_NODE_MODEL_HAS_IDX(node_id, idx), \
2159 (DT_NODE_MODEL_BY_IDX(node_id, idx)), (default_value))
2169#define DT_NODE_MODEL_OR(node_id, default_value) \
2170 DT_NODE_MODEL_BY_IDX_OR(node_id, 0, default_value)
2189#define DT_NUM_REGS(node_id) DT_CAT(node_id, _REG_NUM)
2202#define DT_REG_HAS_IDX(node_id, idx) \
2203 IS_ENABLED(DT_CAT4(node_id, _REG_IDX_, idx, _EXISTS))
2211#define DT_REG_ADDR_BY_IDX(node_id, idx) \
2212 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_ADDRESS)
2225#define DT_REG_SIZE_BY_IDX(node_id, idx) \
2226 DT_CAT4(node_id, _REG_IDX_, idx, _VAL_SIZE)
2235#define DT_REG_ADDR(node_id) DT_REG_ADDR_BY_IDX(node_id, 0)
2247#define DT_REG_ADDR_U64(node_id) DT_U64_C(DT_REG_ADDR(node_id))
2256#define DT_REG_SIZE(node_id) DT_REG_SIZE_BY_IDX(node_id, 0)
2264#define DT_REG_ADDR_BY_NAME(node_id, name) \
2265 DT_CAT4(node_id, _REG_NAME_, name, _VAL_ADDRESS)
2279#define DT_REG_ADDR_BY_NAME_U64(node_id, name) \
2280 DT_U64_C(DT_REG_ADDR_BY_NAME(node_id, name))
2288#define DT_REG_SIZE_BY_NAME(node_id, name) \
2289 DT_CAT4(node_id, _REG_NAME_, name, _VAL_SIZE)
2309#define DT_NUM_IRQS(node_id) DT_CAT(node_id, _IRQ_NUM)
2317#define DT_IRQ_LEVEL(node_id) DT_CAT(node_id, _IRQ_LEVEL)
2329#define DT_IRQ_HAS_IDX(node_id, idx) \
2330 IS_ENABLED(DT_CAT4(node_id, _IRQ_IDX_, idx, _EXISTS))
2342#define DT_IRQ_HAS_CELL_AT_IDX(node_id, idx, cell) \
2343 IS_ENABLED(DT_CAT6(node_id, _IRQ_IDX_, idx, _VAL_, cell, _EXISTS))
2352#define DT_IRQ_HAS_CELL(node_id, cell) DT_IRQ_HAS_CELL_AT_IDX(node_id, 0, cell)
2363#define DT_IRQ_HAS_NAME(node_id, name) \
2364 IS_ENABLED(DT_CAT4(node_id, _IRQ_NAME_, name, _VAL_irq_EXISTS))
2401#define DT_IRQ_BY_IDX(node_id, idx, cell) \
2402 DT_CAT5(node_id, _IRQ_IDX_, idx, _VAL_, cell)
2419#define DT_IRQ_BY_NAME(node_id, name, cell) \
2420 DT_CAT5(node_id, _IRQ_NAME_, name, _VAL_, cell)
2429#define DT_IRQ(node_id, cell) DT_IRQ_BY_IDX(node_id, 0, cell)
2473#define DT_IRQ_INTC_BY_IDX(node_id, idx) \
2474 DT_CAT4(node_id, _IRQ_IDX_, idx, _CONTROLLER)
2520#define DT_IRQ_INTC_BY_NAME(node_id, name) \
2521 DT_CAT4(node_id, _IRQ_NAME_, name, _CONTROLLER)
2562#define DT_IRQ_INTC(node_id) \
2563 DT_IRQ_INTC_BY_IDX(node_id, 0)
2570#define DT_IRQN_L1_INTERNAL(node_id, idx) DT_IRQ_BY_IDX(node_id, idx, irq)
2572#define DT_IRQN_L2_INTERNAL(node_id, idx) \
2573 (IRQ_TO_L2(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2574 DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq))
2576#define DT_IRQN_L3_INTERNAL(node_id, idx) \
2577 (IRQ_TO_L3(DT_IRQN_L1_INTERNAL(node_id, idx)) | \
2578 IRQ_TO_L2(DT_IRQ(DT_IRQ_INTC_BY_IDX(node_id, idx), irq)) | \
2579 DT_IRQ(DT_IRQ_INTC(DT_IRQ_INTC_BY_IDX(node_id, idx)), irq))
2581#define DT_IRQN_LVL_INTERNAL(node_id, idx, level) DT_CAT3(DT_IRQN_L, level, _INTERNAL)(node_id, idx)
2587#define DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx) \
2588 DT_IRQN_LVL_INTERNAL(node_id, idx, DT_IRQ_LEVEL(node_id))
2602#define DT_IRQN_BY_IDX(node_id, idx) \
2603 COND_CODE_1(IS_ENABLED(CONFIG_MULTI_LEVEL_INTERRUPTS), \
2604 (DT_MULTI_LEVEL_IRQN_INTERNAL(node_id, idx)), \
2605 (DT_IRQ_BY_IDX(node_id, idx, irq)))
2617#define DT_IRQN(node_id) DT_IRQN_BY_IDX(node_id, 0)
2637#define DT_CHOSEN(prop) DT_CAT(DT_CHOSEN_, prop)
2645#define DT_HAS_CHOSEN(prop) IS_ENABLED(DT_CAT3(DT_CHOSEN_, prop, _EXISTS))
2666#define DT_FOREACH_NODE(fn) DT_FOREACH_HELPER(fn)
2680#define DT_FOREACH_NODE_VARGS(fn, ...) DT_FOREACH_VARGS_HELPER(fn, __VA_ARGS__)
2693#define DT_FOREACH_STATUS_OKAY_NODE(fn) DT_FOREACH_OKAY_HELPER(fn)
2709#define DT_FOREACH_STATUS_OKAY_NODE_VARGS(fn, ...) DT_FOREACH_OKAY_VARGS_HELPER(fn, __VA_ARGS__)
2754#define DT_FOREACH_CHILD(node_id, fn) \
2755 DT_CAT(node_id, _FOREACH_CHILD)(fn)
2797#define DT_FOREACH_CHILD_SEP(node_id, fn, sep) \
2798 DT_CAT(node_id, _FOREACH_CHILD_SEP)(fn, sep)
2815#define DT_FOREACH_CHILD_VARGS(node_id, fn, ...) \
2816 DT_CAT(node_id, _FOREACH_CHILD_VARGS)(fn, __VA_ARGS__)
2833#define DT_FOREACH_CHILD_SEP_VARGS(node_id, fn, sep, ...) \
2834 DT_CAT(node_id, _FOREACH_CHILD_SEP_VARGS)(fn, sep, __VA_ARGS__)
2851#define DT_FOREACH_CHILD_STATUS_OKAY(node_id, fn) \
2852 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY)(fn)
2870#define DT_FOREACH_CHILD_STATUS_OKAY_SEP(node_id, fn, sep) \
2871 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP)(fn, sep)
2892#define DT_FOREACH_CHILD_STATUS_OKAY_VARGS(node_id, fn, ...) \
2893 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_VARGS)(fn, __VA_ARGS__)
2913#define DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(node_id, fn, sep, ...) \
2914 DT_CAT(node_id, _FOREACH_CHILD_STATUS_OKAY_SEP_VARGS)(fn, sep, __VA_ARGS__)
2966#define DT_FOREACH_PROP_ELEM(node_id, prop, fn) \
2967 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM)(fn)
3011#define DT_FOREACH_PROP_ELEM_SEP(node_id, prop, fn, sep) \
3012 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP)(fn, sep)
3034#define DT_FOREACH_PROP_ELEM_VARGS(node_id, prop, fn, ...) \
3035 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_VARGS)(fn, __VA_ARGS__)
3053#define DT_FOREACH_PROP_ELEM_SEP_VARGS(node_id, prop, fn, sep, ...) \
3054 DT_CAT4(node_id, _P_, prop, _FOREACH_PROP_ELEM_SEP_VARGS)( \
3055 fn, sep, __VA_ARGS__)
3110#define DT_FOREACH_STATUS_OKAY(compat, fn) \
3111 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3112 (DT_CAT(DT_FOREACH_OKAY_, compat)(fn)), \
3159#define DT_FOREACH_STATUS_OKAY_VARGS(compat, fn, ...) \
3160 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3161 (DT_CAT(DT_FOREACH_OKAY_VARGS_, \
3162 compat)(fn, __VA_ARGS__)), \
3189#define DT_NODE_EXISTS(node_id) IS_ENABLED(DT_CAT(node_id, _EXISTS))
3212#define DT_NODE_HAS_STATUS(node_id, status) \
3213 DT_NODE_HAS_STATUS_INTERNAL(node_id, status)
3234#define DT_HAS_COMPAT_STATUS_OKAY(compat) \
3235 IS_ENABLED(DT_CAT(DT_COMPAT_HAS_OKAY_, compat))
3243#define DT_NUM_INST_STATUS_OKAY(compat) \
3244 UTIL_AND(DT_HAS_COMPAT_STATUS_OKAY(compat), \
3245 UTIL_CAT(DT_N_INST, DT_DASH(compat, NUM_OKAY)))
3274#define DT_NODE_HAS_COMPAT(node_id, compat) \
3275 IS_ENABLED(DT_CAT3(node_id, _COMPAT_MATCHES_, compat))
3291#define DT_NODE_HAS_COMPAT_STATUS(node_id, compat, status) \
3292 DT_NODE_HAS_COMPAT(node_id, compat) && DT_NODE_HAS_STATUS(node_id, status)
3307#define DT_NODE_HAS_PROP(node_id, prop) \
3308 IS_ENABLED(DT_CAT4(node_id, _P_, prop, _EXISTS))
3327#define DT_PHA_HAS_CELL_AT_IDX(node_id, pha, idx, cell) \
3328 IS_ENABLED(DT_CAT8(node_id, _P_, pha, \
3329 _IDX_, idx, _VAL_, cell, _EXISTS))
3340#define DT_PHA_HAS_CELL(node_id, pha, cell) \
3341 DT_PHA_HAS_CELL_AT_IDX(node_id, pha, 0, cell)
3384#define DT_BUS(node_id) DT_CAT(node_id, _BUS)
3414#define DT_ON_BUS(node_id, bus) IS_ENABLED(DT_CAT3(node_id, _BUS_, bus))
3432#define DT_DRV_INST(inst) DT_INST(inst, DT_DRV_COMPAT)
3441#define DT_INST_PARENT(inst) DT_PARENT(DT_DRV_INST(inst))
3450#define DT_INST_GPARENT(inst) DT_GPARENT(DT_DRV_INST(inst))
3461#define DT_INST_CHILD(inst, child) \
3462 DT_CHILD(DT_DRV_INST(inst), child)
3473#define DT_INST_CHILD_NUM(inst) DT_CHILD_NUM(DT_DRV_INST(inst))
3484#define DT_INST_CHILD_NUM_STATUS_OKAY(inst) \
3485 DT_CHILD_NUM_STATUS_OKAY(DT_DRV_INST(inst))
3501#define DT_INST_FOREACH_CHILD(inst, fn) \
3502 DT_FOREACH_CHILD(DT_DRV_INST(inst), fn)
3517#define DT_INST_FOREACH_CHILD_SEP(inst, fn, sep) \
3518 DT_FOREACH_CHILD_SEP(DT_DRV_INST(inst), fn, sep)
3535#define DT_INST_FOREACH_CHILD_VARGS(inst, fn, ...) \
3536 DT_FOREACH_CHILD_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3552#define DT_INST_FOREACH_CHILD_SEP_VARGS(inst, fn, sep, ...) \
3553 DT_FOREACH_CHILD_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3566#define DT_INST_FOREACH_CHILD_STATUS_OKAY(inst, fn) \
3567 DT_FOREACH_CHILD_STATUS_OKAY(DT_DRV_INST(inst), fn)
3583#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP(inst, fn, sep) \
3584 DT_FOREACH_CHILD_STATUS_OKAY_SEP(DT_DRV_INST(inst), fn, sep)
3599#define DT_INST_FOREACH_CHILD_STATUS_OKAY_VARGS(inst, fn, ...) \
3600 DT_FOREACH_CHILD_STATUS_OKAY_VARGS(DT_DRV_INST(inst), fn, __VA_ARGS__)
3617#define DT_INST_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(inst, fn, sep, ...) \
3618 DT_FOREACH_CHILD_STATUS_OKAY_SEP_VARGS(DT_DRV_INST(inst), fn, sep, __VA_ARGS__)
3626#define DT_INST_ENUM_IDX(inst, prop) \
3627 DT_ENUM_IDX(DT_DRV_INST(inst), prop)
3637#define DT_INST_ENUM_IDX_OR(inst, prop, default_idx_value) \
3638 DT_ENUM_IDX_OR(DT_DRV_INST(inst), prop, default_idx_value)
3648#define DT_INST_ENUM_HAS_VALUE(inst, prop, value) \
3649 DT_ENUM_HAS_VALUE(DT_DRV_INST(inst), prop, value)
3657#define DT_INST_PROP(inst, prop) DT_PROP(DT_DRV_INST(inst), prop)
3665#define DT_INST_PROP_LEN(inst, prop) DT_PROP_LEN(DT_DRV_INST(inst), prop)
3676#define DT_INST_PROP_HAS_IDX(inst, prop, idx) \
3677 DT_PROP_HAS_IDX(DT_DRV_INST(inst), prop, idx)
3687#define DT_INST_PROP_HAS_NAME(inst, prop, name) \
3688 DT_PROP_HAS_NAME(DT_DRV_INST(inst), prop, name)
3697#define DT_INST_PROP_BY_IDX(inst, prop, idx) \
3698 DT_PROP_BY_IDX(DT_DRV_INST(inst), prop, idx)
3707#define DT_INST_PROP_OR(inst, prop, default_value) \
3708 DT_PROP_OR(DT_DRV_INST(inst), prop, default_value)
3717#define DT_INST_PROP_LEN_OR(inst, prop, default_value) \
3718 DT_PROP_LEN_OR(DT_DRV_INST(inst), prop, default_value)
3729#define DT_INST_STRING_TOKEN(inst, prop) \
3730 DT_STRING_TOKEN(DT_DRV_INST(inst), prop)
3739#define DT_INST_STRING_UPPER_TOKEN(inst, prop) \
3740 DT_STRING_UPPER_TOKEN(DT_DRV_INST(inst), prop)
3750#define DT_INST_STRING_UNQUOTED(inst, prop) \
3751 DT_STRING_UNQUOTED(DT_DRV_INST(inst), prop)
3760#define DT_INST_STRING_TOKEN_BY_IDX(inst, prop, idx) \
3761 DT_STRING_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
3770#define DT_INST_STRING_UPPER_TOKEN_BY_IDX(inst, prop, idx) \
3771 DT_STRING_UPPER_TOKEN_BY_IDX(DT_DRV_INST(inst), prop, idx)
3780#define DT_INST_STRING_UNQUOTED_BY_IDX(inst, prop, idx) \
3781 DT_STRING_UNQUOTED_BY_IDX(DT_DRV_INST(inst), prop, idx)
3791#define DT_INST_PROP_BY_PHANDLE(inst, ph, prop) \
3792 DT_INST_PROP_BY_PHANDLE_IDX(inst, ph, 0, prop)
3805#define DT_INST_PROP_BY_PHANDLE_IDX(inst, phs, idx, prop) \
3806 DT_PROP_BY_PHANDLE_IDX(DT_DRV_INST(inst), phs, idx, prop)
3816#define DT_INST_PHA_BY_IDX(inst, pha, idx, cell) \
3817 DT_PHA_BY_IDX(DT_DRV_INST(inst), pha, idx, cell)
3828#define DT_INST_PHA_BY_IDX_OR(inst, pha, idx, cell, default_value) \
3829 DT_PHA_BY_IDX_OR(DT_DRV_INST(inst), pha, idx, cell, default_value)
3839#define DT_INST_PHA(inst, pha, cell) DT_INST_PHA_BY_IDX(inst, pha, 0, cell)
3849#define DT_INST_PHA_OR(inst, pha, cell, default_value) \
3850 DT_INST_PHA_BY_IDX_OR(inst, pha, 0, cell, default_value)
3861#define DT_INST_PHA_BY_NAME(inst, pha, name, cell) \
3862 DT_PHA_BY_NAME(DT_DRV_INST(inst), pha, name, cell)
3873#define DT_INST_PHA_BY_NAME_OR(inst, pha, name, cell, default_value) \
3874 DT_PHA_BY_NAME_OR(DT_DRV_INST(inst), pha, name, cell, default_value)
3884#define DT_INST_PHANDLE_BY_NAME(inst, pha, name) \
3885 DT_PHANDLE_BY_NAME(DT_DRV_INST(inst), pha, name) \
3896#define DT_INST_PHANDLE_BY_IDX(inst, prop, idx) \
3897 DT_PHANDLE_BY_IDX(DT_DRV_INST(inst), prop, idx)
3907#define DT_INST_PHANDLE(inst, prop) DT_INST_PHANDLE_BY_IDX(inst, prop, 0)
3916#define DT_INST_REG_HAS_IDX(inst, idx) DT_REG_HAS_IDX(DT_DRV_INST(inst), idx)
3924#define DT_INST_REG_ADDR_BY_IDX(inst, idx) DT_REG_ADDR_BY_IDX(DT_DRV_INST(inst), idx)
3932#define DT_INST_REG_SIZE_BY_IDX(inst, idx) \
3933 DT_REG_SIZE_BY_IDX(DT_DRV_INST(inst), idx)
3941#define DT_INST_REG_ADDR_BY_NAME(inst, name) \
3942 DT_REG_ADDR_BY_NAME(DT_DRV_INST(inst), name)
3956#define DT_INST_REG_ADDR_BY_NAME_U64(inst, name) \
3957 DT_U64_C(DT_INST_REG_ADDR_BY_NAME(inst, name))
3965#define DT_INST_REG_SIZE_BY_NAME(inst, name) \
3966 DT_REG_SIZE_BY_NAME(DT_DRV_INST(inst), name)
3973#define DT_INST_REG_ADDR(inst) DT_INST_REG_ADDR_BY_IDX(inst, 0)
3986#define DT_INST_REG_ADDR_U64(inst) DT_U64_C(DT_INST_REG_ADDR(inst))
3993#define DT_INST_REG_SIZE(inst) DT_INST_REG_SIZE_BY_IDX(inst, 0)
4001#define DT_INST_IRQ_LEVEL(inst) DT_IRQ_LEVEL(DT_DRV_INST(inst))
4010#define DT_INST_IRQ_BY_IDX(inst, idx, cell) \
4011 DT_IRQ_BY_IDX(DT_DRV_INST(inst), idx, cell)
4019#define DT_INST_IRQ_INTC_BY_IDX(inst, idx) \
4020 DT_IRQ_INTC_BY_IDX(DT_DRV_INST(inst), idx)
4028#define DT_INST_IRQ_INTC_BY_NAME(inst, name) \
4029 DT_IRQ_INTC_BY_NAME(DT_DRV_INST(inst), name)
4038#define DT_INST_IRQ_INTC(inst) \
4039 DT_INST_IRQ_INTC_BY_IDX(inst, 0)
4048#define DT_INST_IRQ_BY_NAME(inst, name, cell) \
4049 DT_IRQ_BY_NAME(DT_DRV_INST(inst), name, cell)
4057#define DT_INST_IRQ(inst, cell) DT_INST_IRQ_BY_IDX(inst, 0, cell)
4064#define DT_INST_IRQN(inst) DT_IRQN(DT_DRV_INST(inst))
4072#define DT_INST_IRQN_BY_IDX(inst, idx) DT_IRQN_BY_IDX(DT_DRV_INST(inst), idx)
4079#define DT_INST_BUS(inst) DT_BUS(DT_DRV_INST(inst))
4088#define DT_INST_ON_BUS(inst, bus) DT_ON_BUS(DT_DRV_INST(inst), bus)
4099#define DT_INST_STRING_TOKEN_OR(inst, name, default_value) \
4100 DT_STRING_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4110#define DT_INST_STRING_UPPER_TOKEN_OR(inst, name, default_value) \
4111 DT_STRING_UPPER_TOKEN_OR(DT_DRV_INST(inst), name, default_value)
4121#define DT_INST_STRING_UNQUOTED_OR(inst, name, default_value) \
4122 DT_STRING_UNQUOTED_OR(DT_DRV_INST(inst), name, default_value)
4154#define DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(compat, bus) \
4155 IS_ENABLED(DT_CAT4(DT_COMPAT_, compat, _BUS_, bus))
4189#define DT_ANY_INST_ON_BUS_STATUS_OKAY(bus) \
4190 DT_HAS_COMPAT_ON_BUS_STATUS_OKAY(DT_DRV_COMPAT, bus)
4236#define DT_ANY_INST_HAS_PROP_STATUS_OKAY(prop) \
4237 COND_CODE_1(IS_EMPTY(DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop)), (0), (1))
4304#define DT_INST_FOREACH_STATUS_OKAY(fn) \
4305 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4306 (UTIL_CAT(DT_FOREACH_OKAY_INST_, \
4307 DT_DRV_COMPAT)(fn)), \
4321#define DT_INST_FOREACH_STATUS_OKAY_VARGS(fn, ...) \
4322 COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT), \
4323 (UTIL_CAT(DT_FOREACH_OKAY_INST_VARGS_, \
4324 DT_DRV_COMPAT)(fn, __VA_ARGS__)), \
4337#define DT_INST_FOREACH_PROP_ELEM(inst, prop, fn) \
4338 DT_FOREACH_PROP_ELEM(DT_DRV_INST(inst), prop, fn)
4352#define DT_INST_FOREACH_PROP_ELEM_SEP(inst, prop, fn, sep) \
4353 DT_FOREACH_PROP_ELEM_SEP(DT_DRV_INST(inst), prop, fn, sep)
4369#define DT_INST_FOREACH_PROP_ELEM_VARGS(inst, prop, fn, ...) \
4370 DT_FOREACH_PROP_ELEM_VARGS(DT_DRV_INST(inst), prop, fn, __VA_ARGS__)
4389#define DT_INST_FOREACH_PROP_ELEM_SEP_VARGS(inst, prop, fn, sep, ...) \
4390 DT_FOREACH_PROP_ELEM_SEP_VARGS(DT_DRV_INST(inst), prop, fn, sep, \
4399#define DT_INST_NODE_HAS_PROP(inst, prop) \
4400 DT_NODE_HAS_PROP(DT_DRV_INST(inst), prop)
4408#define DT_INST_NODE_HAS_COMPAT(inst, compat) \
4409 DT_NODE_HAS_COMPAT(DT_DRV_INST(inst), compat)
4421#define DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, idx, cell) \
4422 DT_PHA_HAS_CELL_AT_IDX(DT_DRV_INST(inst), pha, idx, cell)
4433#define DT_INST_PHA_HAS_CELL(inst, pha, cell) \
4434 DT_INST_PHA_HAS_CELL_AT_IDX(inst, pha, 0, cell)
4443#define DT_INST_IRQ_HAS_IDX(inst, idx) DT_IRQ_HAS_IDX(DT_DRV_INST(inst), idx)
4453#define DT_INST_IRQ_HAS_CELL_AT_IDX(inst, idx, cell) \
4454 DT_IRQ_HAS_CELL_AT_IDX(DT_DRV_INST(inst), idx, cell)
4463#define DT_INST_IRQ_HAS_CELL(inst, cell) \
4464 DT_INST_IRQ_HAS_CELL_AT_IDX(inst, 0, cell)
4472#define DT_INST_IRQ_HAS_NAME(inst, name) \
4473 DT_IRQ_HAS_NAME(DT_DRV_INST(inst), name)
4492#define DT_ANY_INST_HAS_PROP_STATUS_OKAY__(idx, prop) \
4493 COND_CODE_1(DT_INST_NODE_HAS_PROP(idx, prop), (1,), ())
4506#define DT_ANY_INST_HAS_PROP_STATUS_OKAY_(prop) \
4507 DT_INST_FOREACH_STATUS_OKAY_VARGS(DT_ANY_INST_HAS_PROP_STATUS_OKAY__, prop)
4509#define DT_PATH_INTERNAL(...) \
4510 UTIL_CAT(DT_ROOT, MACRO_MAP_CAT(DT_S_PREFIX, __VA_ARGS__))
4516#define DT_S_PREFIX(name) _S_##name
4532#define DT_CAT(a1, a2) a1 ## a2
4534#define DT_CAT3(a1, a2, a3) a1 ## a2 ## a3
4536#define DT_CAT4(a1, a2, a3, a4) a1 ## a2 ## a3 ## a4
4538#define DT_CAT5(a1, a2, a3, a4, a5) a1 ## a2 ## a3 ## a4 ## a5
4540#define DT_CAT6(a1, a2, a3, a4, a5, a6) a1 ## a2 ## a3 ## a4 ## a5 ## a6
4542#define DT_CAT7(a1, a2, a3, a4, a5, a6, a7) \
4543 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7
4545#define DT_CAT8(a1, a2, a3, a4, a5, a6, a7, a8) \
4546 a1 ## a2 ## a3 ## a4 ## a5 ## a6 ## a7 ## a8
4553#define DT_DASH(...) MACRO_MAP_CAT(DT_DASH_PREFIX, __VA_ARGS__)
4555#define DT_DASH_PREFIX(name) _##name
4557#define DT_NODE_HAS_STATUS_INTERNAL(node_id, status) \
4558 IS_ENABLED(DT_CAT3(node_id, _STATUS_, status))
4561#define DT_INST_NODE_HAS_PROP_AND_OR(inst, prop) \
4562 DT_INST_NODE_HAS_PROP(inst, prop) ||
4568#if defined(_LINKER) || defined(_ASMLANGUAGE)
4569#define DT_U64_C(_v) (_v)
4571#define DT_U64_C(_v) UINT64_C(_v)
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.