diff --git a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld index 8a1c233a50a..b87806923df 100644 --- a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -88,21 +88,21 @@ MEMORY FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE /* TI CCFG Registers */ - DT_REGION_FROM_NODE_STATUS_OKAY(FLASH_CCFG, rwx, DT_NODELABEL(ti_ccfg_partition)) + LINKER_DT_REGION_FROM_NODE(FLASH_CCFG, rwx, DT_NODELABEL(ti_ccfg_partition)) /* Data & Instruction Tightly Coupled Memory */ - DT_REGION_FROM_NODE_STATUS_OKAY(ITCM, rw, DT_CHOSEN(zephyr_itcm)) - DT_REGION_FROM_NODE_STATUS_OKAY(DTCM, rw, DT_CHOSEN(zephyr_dtcm)) + LINKER_DT_REGION_FROM_NODE(ITCM, rw, DT_CHOSEN(zephyr_itcm)) + LINKER_DT_REGION_FROM_NODE(DTCM, rw, DT_CHOSEN(zephyr_dtcm)) /* STM32 Core Coupled Memory */ - DT_REGION_FROM_NODE_STATUS_OKAY(CCM, rw, DT_CHOSEN(zephyr_ccm)) + LINKER_DT_REGION_FROM_NODE(CCM, rw, DT_CHOSEN(zephyr_ccm)) /* STM32WB IPC RAM */ - DT_REGION_FROM_NODE_STATUS_OKAY(SRAM1, rw, DT_NODELABEL(sram1)) - DT_REGION_FROM_NODE_STATUS_OKAY(SRAM2, rw, DT_NODELABEL(sram2)) + LINKER_DT_REGION_FROM_NODE(SRAM1, rw, DT_NODELABEL(sram1)) + LINKER_DT_REGION_FROM_NODE(SRAM2, rw, DT_NODELABEL(sram2)) /* STM32 alternate RAM configurations */ - DT_REGION_FROM_NODE_STATUS_OKAY(SRAM3, rw, DT_NODELABEL(sram3)) - DT_REGION_FROM_NODE_STATUS_OKAY(SRAM4, rw, DT_NODELABEL(sram4)) - DT_REGION_FROM_NODE_STATUS_OKAY(SDRAM1, rw, DT_NODELABEL(sdram1)) - DT_REGION_FROM_NODE_STATUS_OKAY(SDRAM2, rw, DT_NODELABEL(sdram2)) - DT_REGION_FROM_NODE_STATUS_OKAY(BACKUP_SRAM, rw, DT_NODELABEL(backup_sram)) + LINKER_DT_REGION_FROM_NODE(SRAM3, rw, DT_NODELABEL(sram3)) + LINKER_DT_REGION_FROM_NODE(SRAM4, rw, DT_NODELABEL(sram4)) + LINKER_DT_REGION_FROM_NODE(SDRAM1, rw, DT_NODELABEL(sdram1)) + LINKER_DT_REGION_FROM_NODE(SDRAM2, rw, DT_NODELABEL(sdram2)) + LINKER_DT_REGION_FROM_NODE(BACKUP_SRAM, rw, DT_NODELABEL(backup_sram)) /* Used by and documented in include/linker/intlist.ld */ IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K } diff --git a/include/linker/devicetree_regions.h b/include/linker/devicetree_regions.h index d7421d96699..8fec70cc533 100644 --- a/include/linker/devicetree_regions.h +++ b/include/linker/devicetree_regions.h @@ -15,12 +15,17 @@ /** * @brief Generate a linker memory region from a devicetree node * + * If @p node_id refers to a node with status "okay", then this declares + * a linker memory region named @p name with attributes from @p attr. + * + * Otherwise, it doesn't expand to anything. + * * @param name name of the generated memory region * @param attr region attributes to use (rx, rw, ...) - * @param node devicetree node with a \ property defining region location - * and size. + * @param node_id devicetree node identifier with a \ property + * defining region location and size. */ -#define DT_REGION_FROM_NODE_STATUS_OKAY(name, attr, node) \ - COND_CODE_1(DT_NODE_HAS_STATUS(node, okay), \ - (_REGION_DECLARE(name, attr, node)), \ +#define LINKER_DT_REGION_FROM_NODE(name, attr, node_id) \ + COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \ + (_REGION_DECLARE(name, attr, node_id)), \ ())