Skip to content

Commit a4150c0

Browse files
Jordan Yatescarlescufi
authored andcommitted
linker: stm32wb: move IPC RAM definition to DT
Move the definition of the two IPC RAM blocks from `#define`'s in family linker scripts to proper devicetree nodes. Use the devicetree nodes to generate the memory regions. Signed-off-by: Jordan Yates <[email protected]>
1 parent ddc25b4 commit a4150c0

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

dts/arm/st/wb/stm32wb.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
compatible = "mmio-sram";
3232
};
3333

34+
sram1: memory@20030000 {
35+
compatible = "mmio-sram";
36+
reg = <0x20030000 0x2800>;
37+
};
38+
39+
sram2: memory@20038000 {
40+
compatible = "mmio-sram";
41+
reg = <0x20038000 0x5000>;
42+
};
43+
3444
soc {
3545
flash: flash-controller@58004000 {
3646
compatible = "st,stm32-flash-controller", "st,stm32wb-flash-controller";

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ MEMORY
102102
DT_REGION_FROM_NODE_STATUS_OKAY(DTCM, rw, DT_CHOSEN(zephyr_dtcm))
103103
/* STM32 Core Coupled Memory */
104104
DT_REGION_FROM_NODE_STATUS_OKAY(CCM, rw, DT_CHOSEN(zephyr_ccm))
105-
#ifdef CONFIG_BT_STM32_IPM
106-
SRAM1 (rw) : ORIGIN = RAM1_ADDR, LENGTH = RAM1_SIZE
107-
SRAM2 (rw) : ORIGIN = RAM2_ADDR, LENGTH = RAM2_SIZE
108-
#endif
105+
/* STM32WB IPC RAM */
106+
DT_REGION_FROM_NODE_STATUS_OKAY(SRAM1, rw, DT_NODELABEL(sram1))
107+
DT_REGION_FROM_NODE_STATUS_OKAY(SRAM2, rw, DT_NODELABEL(sram2))
109108
/* STM32 alternate RAM configurations */
110109
DT_REGION_FROM_NODE_STATUS_OKAY(SDRAM1, rw, DT_NODELABEL(sdram1))
111110
DT_REGION_FROM_NODE_STATUS_OKAY(SDRAM2, rw, DT_NODELABEL(sdram2))

soc/arm/st_stm32/stm32wb/linker.ld

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,4 @@
66
* SPDX-License-Identifier: Apache-2.0
77
*/
88

9-
#define RAM1_SIZE (10 * 1K)
10-
#define RAM1_ADDR 0x20030000
11-
#define RAM2_SIZE (20 * 1K)
12-
#define RAM2_ADDR 0x20038000
13-
149
#include <arch/arm/aarch32/cortex_m/scripts/linker.ld>

0 commit comments

Comments
 (0)