Skip to content

Commit d1eee6a

Browse files
mbolivar-nordiccfriedt
authored andcommitted
linker: rename DT_REGION_FROM_NODE_STATUS_OKAY
The main motivation is to avoid polluting the all-caps "DT_" namespace, which within zephyr belongs to devicetree.h. Signed-off-by: Martí Bolívar <[email protected]>
1 parent d40d963 commit d1eee6a

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

include/arch/arm/aarch32/cortex_m/scripts/linker.ld

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,21 @@ MEMORY
8888
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
8989
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
9090
/* TI CCFG Registers */
91-
DT_REGION_FROM_NODE_STATUS_OKAY(FLASH_CCFG, rwx, DT_NODELABEL(ti_ccfg_partition))
91+
LINKER_DT_REGION_FROM_NODE(FLASH_CCFG, rwx, DT_NODELABEL(ti_ccfg_partition))
9292
/* Data & Instruction Tightly Coupled Memory */
93-
DT_REGION_FROM_NODE_STATUS_OKAY(ITCM, rw, DT_CHOSEN(zephyr_itcm))
94-
DT_REGION_FROM_NODE_STATUS_OKAY(DTCM, rw, DT_CHOSEN(zephyr_dtcm))
93+
LINKER_DT_REGION_FROM_NODE(ITCM, rw, DT_CHOSEN(zephyr_itcm))
94+
LINKER_DT_REGION_FROM_NODE(DTCM, rw, DT_CHOSEN(zephyr_dtcm))
9595
/* STM32 Core Coupled Memory */
96-
DT_REGION_FROM_NODE_STATUS_OKAY(CCM, rw, DT_CHOSEN(zephyr_ccm))
96+
LINKER_DT_REGION_FROM_NODE(CCM, rw, DT_CHOSEN(zephyr_ccm))
9797
/* STM32WB IPC RAM */
98-
DT_REGION_FROM_NODE_STATUS_OKAY(SRAM1, rw, DT_NODELABEL(sram1))
99-
DT_REGION_FROM_NODE_STATUS_OKAY(SRAM2, rw, DT_NODELABEL(sram2))
98+
LINKER_DT_REGION_FROM_NODE(SRAM1, rw, DT_NODELABEL(sram1))
99+
LINKER_DT_REGION_FROM_NODE(SRAM2, rw, DT_NODELABEL(sram2))
100100
/* STM32 alternate RAM configurations */
101-
DT_REGION_FROM_NODE_STATUS_OKAY(SRAM3, rw, DT_NODELABEL(sram3))
102-
DT_REGION_FROM_NODE_STATUS_OKAY(SRAM4, rw, DT_NODELABEL(sram4))
103-
DT_REGION_FROM_NODE_STATUS_OKAY(SDRAM1, rw, DT_NODELABEL(sdram1))
104-
DT_REGION_FROM_NODE_STATUS_OKAY(SDRAM2, rw, DT_NODELABEL(sdram2))
105-
DT_REGION_FROM_NODE_STATUS_OKAY(BACKUP_SRAM, rw, DT_NODELABEL(backup_sram))
101+
LINKER_DT_REGION_FROM_NODE(SRAM3, rw, DT_NODELABEL(sram3))
102+
LINKER_DT_REGION_FROM_NODE(SRAM4, rw, DT_NODELABEL(sram4))
103+
LINKER_DT_REGION_FROM_NODE(SDRAM1, rw, DT_NODELABEL(sdram1))
104+
LINKER_DT_REGION_FROM_NODE(SDRAM2, rw, DT_NODELABEL(sdram2))
105+
LINKER_DT_REGION_FROM_NODE(BACKUP_SRAM, rw, DT_NODELABEL(backup_sram))
106106
/* Used by and documented in include/linker/intlist.ld */
107107
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K
108108
}

include/linker/devicetree_regions.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@
1515
/**
1616
* @brief Generate a linker memory region from a devicetree node
1717
*
18+
* If @p node_id refers to a node with status "okay", then this declares
19+
* a linker memory region named @p name with attributes from @p attr.
20+
*
21+
* Otherwise, it doesn't expand to anything.
22+
*
1823
* @param name name of the generated memory region
1924
* @param attr region attributes to use (rx, rw, ...)
20-
* @param node devicetree node with a \<reg\> property defining region location
21-
* and size.
25+
* @param node_id devicetree node identifier with a \<reg\> property
26+
* defining region location and size.
2227
*/
23-
#define DT_REGION_FROM_NODE_STATUS_OKAY(name, attr, node) \
24-
COND_CODE_1(DT_NODE_HAS_STATUS(node, okay), \
25-
(_REGION_DECLARE(name, attr, node)), \
28+
#define LINKER_DT_REGION_FROM_NODE(name, attr, node_id) \
29+
COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
30+
(_REGION_DECLARE(name, attr, node_id)), \
2631
())

0 commit comments

Comments
 (0)