Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions include/arch/arm/aarch32/cortex_m/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
15 changes: 10 additions & 5 deletions include/linker/devicetree_regions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \<reg\> property defining region location
* and size.
* @param node_id devicetree node identifier with a \<reg\> 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)), \
())