Skip to content

Commit 9b4298c

Browse files
committed
arm: Convert DT_CCM_* to new devicetree.h macros
Convert various DT_CCM_* macros to use DT_CHOSEN(zephyr_ccm) and associated macros from devicetree.h. We remove CCM references from cortex_a and cortex_r linker scripts as its only a feature on Cortex-M STM32 SoCs. Signed-off-by: Kumar Gala <[email protected]>
1 parent a49817d commit 9b4298c

File tree

5 files changed

+6
-12
lines changed

5 files changed

+6
-12
lines changed

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

-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ _region_min_align = 4;
8181
MEMORY
8282
{
8383
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
84-
#ifdef DT_CCM_BASE_ADDRESS
85-
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
86-
#endif
8784
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
8885
/* Used by and documented in include/linker/intlist.ld */
8986
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ MEMORY
9595
#ifdef CONFIG_HAS_TI_CCFG
9696
FLASH_CCFG (rwx): ORIGIN = CCFG_ADDR, LENGTH = CCFG_SIZE
9797
#endif
98-
#ifdef DT_CCM_BASE_ADDRESS
99-
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
98+
#if DT_HAS_NODE(DT_CHOSEN(zephyr_ccm))
99+
CCM (rw) : ORIGIN = DT_REG_ADDR(DT_CHOSEN(zephyr_ccm)), LENGTH = DT_REG_SIZE(DT_CHOSEN(zephyr_ccm))
100100
#endif
101101
#if DT_HAS_NODE(DT_CHOSEN(zephyr_dtcm))
102102
DTCM (rw) : ORIGIN = DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)), LENGTH = DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm))

include/arch/arm/aarch64/scripts/linker.ld

-3
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@
7777
MEMORY
7878
{
7979
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
80-
#ifdef DT_CCM_BASE_ADDRESS
81-
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
82-
#endif
8380
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
8481
/* Used by and documented in include/linker/intlist.ld */
8582
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K

include/linker/linker-defs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ extern char __gcov_bss_size[];
215215
/* end address of image, used by newlib for the heap */
216216
extern char _end[];
217217

218-
#ifdef DT_CCM_BASE_ADDRESS
218+
#if DT_HAS_NODE(DT_CHOSEN(zephyr_ccm))
219219
extern char __ccm_data_rom_start[];
220220
extern char __ccm_start[];
221221
extern char __ccm_data_start[];
@@ -225,7 +225,7 @@ extern char __ccm_bss_end[];
225225
extern char __ccm_noinit_start[];
226226
extern char __ccm_noinit_end[];
227227
extern char __ccm_end[];
228-
#endif /* DT_CCM_BASE_ADDRESS */
228+
#endif
229229

230230
#if DT_HAS_NODE(DT_CHOSEN(zephyr_dtcm))
231231
extern char __dtcm_data_start[];

kernel/init.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ extern void idle(void *unused1, void *unused2, void *unused3);
106106
void z_bss_zero(void)
107107
{
108108
(void)memset(__bss_start, 0, __bss_end - __bss_start);
109-
#ifdef DT_CCM_BASE_ADDRESS
109+
#if DT_HAS_NODE(DT_CHOSEN(zephyr_ccm))
110110
(void)memset(&__ccm_bss_start, 0,
111111
((u32_t) &__ccm_bss_end - (u32_t) &__ccm_bss_start));
112112
#endif
@@ -147,7 +147,7 @@ void z_data_copy(void)
147147
(void)memcpy(&_ramfunc_ram_start, &_ramfunc_rom_start,
148148
(uintptr_t) &_ramfunc_ram_size);
149149
#endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */
150-
#ifdef DT_CCM_BASE_ADDRESS
150+
#if DT_HAS_NODE(DT_CHOSEN(zephyr_ccm))
151151
(void)memcpy(&__ccm_data_start, &__ccm_data_rom_start,
152152
__ccm_data_end - __ccm_data_start);
153153
#endif

0 commit comments

Comments
 (0)