File tree Expand file tree Collapse file tree 8 files changed +22
-37
lines changed
arch/arm/core/aarch32/mpu
include/zephyr/arch/arm/aarch32
samples/application_development/code_relocation_nocopy
tests/application_development/code_relocation Expand file tree Collapse file tree 8 files changed +22
-37
lines changed Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ uint32_t z_arm_mpu_stack_guard_and_fpu_adjust(struct k_thread *thread);
5555#endif
5656
5757#if defined(CONFIG_CODE_DATA_RELOCATION_SRAM )
58- extern char __sram_text_start [];
59- extern char __sram_text_size [];
58+ extern char __ram_text_start [];
59+ extern char __ram_text_size [];
6060#endif
6161
6262static const struct z_arm_mpu_partition static_regions [] = {
@@ -89,8 +89,8 @@ static const struct z_arm_mpu_partition static_regions[] = {
8989#if defined(CONFIG_CODE_DATA_RELOCATION_SRAM )
9090 {
9191 /* RAM area for relocated text */
92- .start = (uint32_t )& __sram_text_start ,
93- .size = (uint32_t )& __sram_text_size ,
92+ .start = (uint32_t )& __ram_text_start ,
93+ .size = (uint32_t )& __ram_text_size ,
9494 .attr = K_MEM_PARTITION_P_RX_U_RX ,
9595 },
9696#endif /* CONFIG_CODE_DATA_RELOCATION_SRAM */
Original file line number Diff line number Diff line change @@ -9,14 +9,7 @@ macro(toolchain_ld_relocation)
99 set (MEM_RELOCATION_SRAM_BSS_LD
1010 "${PROJECT_BINARY_DIR} /include/generated/linker_sram_bss_relocate.ld" )
1111 set (MEM_RELOCATION_CODE "${PROJECT_BINARY_DIR} /code_relocation.c" )
12- if (CONFIG_ARM)
13- set (MEM_REGION_DEFAULT_RAM SRAM)
14- elseif (CONFIG_RISCV)
15- set (MEM_REGION_DEFAULT_RAM RAM)
16- else ()
17- # Name must be configured for newly-supported architectures
18- message (SEND_ERROR "Default RAM region name is unknown for target architecture" )
19- endif ()
12+ set (MEM_REGION_DEFAULT_RAM RAM)
2013
2114 add_custom_command (
2215 OUTPUT ${MEM_RELOCATION_CODE} ${MEM_RELOCATION_LD}
Original file line number Diff line number Diff line change @@ -124,15 +124,15 @@ config FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
124124 select CODE_DATA_RELOCATION
125125
126126config FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
127- bool "SRAM "
127+ bool "RAM "
128128 select CODE_DATA_RELOCATION_SRAM
129129
130130endchoice
131131
132132config FLASH_MCUX_FLEXSPI_XIP_MEM
133133 string
134134 default "ITCM" if FLASH_MCUX_FLEXSPI_XIP_MEM_ITCM
135- default "SRAM " if FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
135+ default "RAM " if FLASH_MCUX_FLEXSPI_XIP_MEM_SRAM
136136
137137endif # FLASH_MCUX_FLEXSPI_XIP
138138
Original file line number Diff line number Diff line change 2121/* physical address of RAM */
2222#ifdef CONFIG_XIP
2323 #define ROMABLE_REGION FLASH
24- #define RAMABLE_REGION SRAM
2524#else
26- #define ROMABLE_REGION SRAM
27- #define RAMABLE_REGION SRAM
25+ #define ROMABLE_REGION RAM
2826#endif
27+ #define RAMABLE_REGION RAM
2928
3029#if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0)
3130 #define ROM_ADDR RAM_ADDR
@@ -79,7 +78,7 @@ _region_min_align = 4;
7978MEMORY
8079{
8180 FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
82- SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
81+ RAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
8382 LINKER_DT_REGIONS ()
8483 /* Used by and documented in include/linker/intlist.ld */
8584 IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF , LENGTH = 2K
@@ -243,7 +242,7 @@ SECTIONS
243242 GROUP_START (RAMABLE_REGION)
244243
245244 . = RAM_ADDR;
246- /* Align the start of image SRAM with the
245+ /* Align the start of image RAM with the
247246 * minimum granularity required by MPU.
248247 */
249248 . = ALIGN (_region_min_align);
Original file line number Diff line number Diff line change 2121/* physical address of RAM */
2222#ifdef CONFIG_XIP
2323#define ROMABLE_REGION FLASH
24- #define RAMABLE_REGION SRAM
2524#else
26- #define ROMABLE_REGION SRAM
27- #define RAMABLE_REGION SRAM
25+ #define ROMABLE_REGION RAM
2826#endif
27+ #define RAMABLE_REGION RAM
2928
3029#if !defined(CONFIG_XIP) && (CONFIG_FLASH_SIZE == 0)
3130#define ROM_ADDR RAM_ADDR
@@ -79,7 +78,7 @@ _region_min_align = 4;
7978MEMORY
8079 {
8180 FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
82- SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
81+ RAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
8382 LINKER_DT_REGIONS ()
8483 /* Used by and documented in include/linker/intlist.ld */
8584 IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF , LENGTH = 2K
@@ -227,7 +226,7 @@ SECTIONS
227226 GROUP_START (RAMABLE_REGION)
228227
229228 . = RAM_ADDR;
230- /* Align the start of image SRAM with the
229+ /* Align the start of image RAM with the
231230 * minimum granularity required by MPU.
232231 */
233232 . = ALIGN (_region_min_align);
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ target_sources_ifdef(CONFIG_NRFX_QSPI app PRIVATE boards/nrf5340dk_nrf5340_cpuap
1212# Run ext_code from the external flash (XIP). No need to copy.
1313zephyr_code_relocate(src/ext_code.c EXTFLASH_TEXT NOCOPY)
1414
15- # But still relocate (copy) the data to SRAM
16- zephyr_code_relocate(src/ext_code.c SRAM_DATA )
15+ # But still relocate (copy) the data to RAM
16+ zephyr_code_relocate(src/ext_code.c RAM_DATA )
1717
1818# sram_code instead runs entirely from SRAM after being copied there.
19- zephyr_code_relocate(src/sram_code.c SRAM )
19+ zephyr_code_relocate(src/sram_code.c RAM )
Original file line number Diff line number Diff line change @@ -24,4 +24,4 @@ zephyr_linker_sources_ifdef(CONFIG_NXP_IMX_RT5XX_BOOT_HEADER
2424zephyr_linker_sources_ifdef(CONFIG_USB_DEVICE_DRIVER
2525 SECTIONS usb.ld)
2626
27- zephyr_code_relocate(flash_clock_setup.c SRAM )
27+ zephyr_code_relocate(flash_clock_setup.c RAM )
Original file line number Diff line number Diff line change @@ -8,22 +8,16 @@ project(code_relocation)
88FILE (GLOB app_sources src/*.c)
99target_sources (app PRIVATE ${app_sources} )
1010
11- if (CONFIG_ARM)
12- set (RAM_SECTION SRAM)
13- else ()
14- set (RAM_SECTION RAM)
15- endif ()
16-
1711# Code relocation feature
1812zephyr_code_relocate(src/test_file1.c SRAM2)
1913
20- zephyr_code_relocate(src/test_file2.c ${RAM_SECTION} )
14+ zephyr_code_relocate(src/test_file2.c RAM )
2115
2216zephyr_code_relocate(src/test_file3.c SRAM2_TEXT)
23- zephyr_code_relocate(src/test_file3.c ${RAM_SECTION} _DATA )
17+ zephyr_code_relocate(src/test_file3.c RAM_DATA )
2418zephyr_code_relocate(src/test_file3.c SRAM2_BSS)
2519
26- zephyr_code_relocate(../../../kernel/sem.c ${RAM_SECTION} )
20+ zephyr_code_relocate(../../../kernel/sem.c RAM )
2721
2822if (CONFIG_RELOCATE_TO_ITCM)
2923zephyr_code_relocate(../../../lib/libc/minimal/source /string /string .c ITCM_TEXT)
You can’t perform that action at this time.
0 commit comments