Skip to content

Commit 47271ce

Browse files
danieldegrassecarlescufi
authored andcommitted
treewide: update usage of zephyr_code_relocate
Update usage of zephyr_code_relocate to follow new API. The old method of relocating a file was the following directive: zephyr_code_relocate(file location) The new API for zephyr_code_relocate uses the following directive: zephyr_code_relocate(FILES file LOCATION location) update in tree usage to follow this model. Also, update the NXP HAL SHA, as NXP's HAL uses this macro as well. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 10e85bf commit 47271ce

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

drivers/flash/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ if(CONFIG_FLASH_MCUX_FLEXSPI_XIP)
3535
dt_chosen(chosen_flash PROPERTY "zephyr,flash")
3636
dt_prop(compat_flash PATH ${chosen_flash} PROPERTY compatible)
3737
if(compat_flash MATCHES "nxp,imx-flexspi-nor")
38-
zephyr_code_relocate(flash_mcux_flexspi_nor.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
38+
zephyr_code_relocate(FILES flash_mcux_flexspi_nor.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
3939
elseif(compat_flash MATCHES "nxp,imx-flexspi-mx25um51345g")
40-
zephyr_code_relocate(flash_mcux_flexspi_mx25um51345g.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
40+
zephyr_code_relocate(FILES flash_mcux_flexspi_mx25um51345g.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
4141
elseif(compat_flash MATCHES "nxp,imx-flexspi-hyperflash")
42-
zephyr_code_relocate(flash_mcux_flexspi_hyperflash.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
42+
zephyr_code_relocate(FILES flash_mcux_flexspi_hyperflash.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
4343
endif()
4444
endif()
4545

drivers/memc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ zephyr_library_sources_ifdef(CONFIG_MEMC_MCUX_FLEXSPI_APS6408L memc_mcux_flexspi
1414
zephyr_library_sources_ifdef(CONFIG_MEMC_SAM_SMC memc_sam_smc.c)
1515

1616
if((DEFINED CONFIG_FLASH_MCUX_FLEXSPI_XIP) AND (DEFINED CONFIG_FLASH))
17-
zephyr_code_relocate(memc_mcux_flexspi.c ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
17+
zephyr_code_relocate(FILES memc_mcux_flexspi.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT)
1818
endif()

samples/application_development/code_relocation_nocopy/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ target_sources(app PRIVATE ${app_sources})
1010
target_sources_ifdef(CONFIG_NRFX_QSPI app PRIVATE boards/nrf5340dk_nrf5340_cpuapp/ext_mem_init.c)
1111

1212
# Run ext_code from the external flash (XIP). No need to copy.
13-
zephyr_code_relocate(src/ext_code.c EXTFLASH_TEXT NOCOPY)
13+
zephyr_code_relocate(FILES src/ext_code.c LOCATION EXTFLASH_TEXT NOCOPY)
1414

1515
# But still relocate (copy) the data to RAM
16-
zephyr_code_relocate(src/ext_code.c RAM_DATA)
16+
zephyr_code_relocate(FILES src/ext_code.c LOCATION RAM_DATA)
1717

1818
# sram_code instead runs entirely from SRAM after being copied there.
19-
zephyr_code_relocate(src/sram_code.c RAM)
19+
zephyr_code_relocate(FILES src/sram_code.c LOCATION RAM)

samples/boards/intel_adsp/code_relocation/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ project(adsp_cavs_code_relocation)
77

88
target_sources(app PRIVATE src/main.c src/reloc.c)
99

10-
zephyr_code_relocate(src/reloc.c SRAM2_LITERAL)
11-
zephyr_code_relocate(src/reloc.c SRAM2_TEXT)
12-
zephyr_code_relocate(src/reloc.c SRAM3_DATA)
13-
zephyr_code_relocate(src/reloc.c SRAM3_RODATA)
14-
zephyr_code_relocate(src/reloc.c SRAM4_BSS)
10+
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM2_LITERAL)
11+
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM2_TEXT)
12+
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM3_DATA)
13+
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM3_RODATA)
14+
zephyr_code_relocate(FILES src/reloc.c LOCATION SRAM4_BSS)

soc/arm/nxp_imx/rt/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ endif()
3131

3232
if (CONFIG_PM AND CONFIG_SOC_SERIES_IMX_RT10XX)
3333
zephyr_sources(power_rt10xx.c)
34-
zephyr_code_relocate(power_rt10xx.c ITCM_TEXT)
34+
zephyr_code_relocate(FILES power_rt10xx.c LOCATION ITCM_TEXT)
3535
if (CONFIG_SOC_MIMXRT1064)
3636
zephyr_sources(lpm_rt1064.c)
37-
zephyr_code_relocate(lpm_rt1064.c ITCM_TEXT)
37+
zephyr_code_relocate(FILES lpm_rt1064.c LOCATION ITCM_TEXT)
3838
endif()
3939
endif()
4040

soc/arm/nxp_imx/rt5xx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ zephyr_linker_sources_ifdef(CONFIG_NXP_IMX_RT5XX_BOOT_HEADER
2626
zephyr_linker_sources_ifdef(CONFIG_USB_DEVICE_DRIVER
2727
SECTIONS usb.ld)
2828

29-
zephyr_code_relocate(flash_clock_setup.c RAM)
29+
zephyr_code_relocate(FILES flash_clock_setup.c LOCATION RAM)

soc/arm/nxp_imx/rt6xx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ zephyr_linker_sources_ifdef(CONFIG_USB_DEVICE_DRIVER
3030
SECTIONS usb.ld)
3131

3232
if(CONFIG_FLASH_MCUX_FLEXSPI_XIP)
33-
zephyr_code_relocate(flash_clock_setup.c RAM)
33+
zephyr_code_relocate(FILES flash_clock_setup.c LOCATION RAM)
3434
endif()

tests/application_development/code_relocation/CMakeLists.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,25 @@ FILE(GLOB app_sources src/*.c)
99
target_sources(app PRIVATE ${app_sources})
1010

1111
if (CONFIG_BOARD_QEMU_XTENSA)
12-
set(RAM_PHDR :sram0_phdr)
13-
set(SRAM2_PHDR :sram2_phdr)
12+
set(RAM_PHDR PHDR sram0_phdr)
13+
set(SRAM2_PHDR PHDR sram2_phdr)
1414
endif()
1515

1616
# Code relocation feature
17-
zephyr_code_relocate(src/test_file1.c "SRAM2 ${SRAM2_PHDR}")
17+
zephyr_code_relocate(FILES src/test_file1.c ${SRAM2_PHDR} LOCATION SRAM2)
1818

19-
zephyr_code_relocate(src/test_file2.c "RAM ${RAM_PHDR}")
19+
zephyr_code_relocate(FILES src/test_file2.c ${RAM_PHDR} LOCATION RAM)
2020

21-
zephyr_code_relocate(src/test_file3.c SRAM2_LITERAL)
22-
zephyr_code_relocate(src/test_file3.c SRAM2_TEXT)
23-
zephyr_code_relocate(src/test_file3.c RAM_DATA)
24-
zephyr_code_relocate(src/test_file3.c SRAM2_BSS)
21+
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_LITERAL)
22+
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_TEXT)
23+
zephyr_code_relocate(FILES src/test_file3.c LOCATION RAM_DATA)
24+
zephyr_code_relocate(FILES src/test_file3.c LOCATION SRAM2_BSS)
2525

26-
zephyr_code_relocate(../../../kernel/sem.c "RAM ${RAM_PHDR}")
26+
zephyr_code_relocate(FILES ../../../kernel/sem.c ${RAM_PHDR} LOCATION RAM)
2727

2828
if (CONFIG_RELOCATE_TO_ITCM)
29-
zephyr_code_relocate(../../../lib/libc/minimal/source/string/string.c ITCM_TEXT)
29+
zephyr_code_relocate(FILES ../../../lib/libc/minimal/source/string/string.c
30+
LOCATION ITCM_TEXT)
3031
endif()
3132

3233
zephyr_linker_sources(SECTIONS custom-sections.ld)

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ manifest:
9393
groups:
9494
- hal
9595
- name: hal_nxp
96-
revision: b74522c2e452b170922f639bf5720461e533fb7e
96+
revision: 3ee6020efc1f8323d0fdc85615d3477161f0aa1f
9797
path: modules/hal/nxp
9898
groups:
9999
- hal

0 commit comments

Comments
 (0)