Skip to content

[Backport v3.7-branch] arch: common: fix copy for ramfunc region during XIP init + related fixup commit #92848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: v3.7-branch
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions arch/common/ramfunc.ld
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

SECTION_DATA_PROLOGUE(.ramfunc,,)
{
__ramfunc_region_start = .;
MPU_ALIGN(__ramfunc_size);
__ramfunc_start = .;
*(.ramfunc)
Expand Down
1 change: 1 addition & 0 deletions cmake/linker_script/arm/linker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ endif()

include(${COMMON_ZEPHYR_LINKER_DIR}/ram-end.cmake)

zephyr_linker_symbol(SYMBOL __ramfunc_region_start EXPR "(@__ramfunc_start@)")
zephyr_linker_symbol(SYMBOL __kernel_ram_start EXPR "(@__bss_start@)")
zephyr_linker_symbol(SYMBOL __kernel_ram_end EXPR "(${RAM_ADDR} + ${RAM_SIZE})")
zephyr_linker_symbol(SYMBOL __kernel_ram_size EXPR "(@__kernel_ram_end@ - @__bss_start@)")
Expand Down
1 change: 1 addition & 0 deletions include/zephyr/linker/linker-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ extern char _nocache_ram_size[];
* section, stored in RAM instead of FLASH.
*/
#ifdef CONFIG_ARCH_HAS_RAMFUNC_SUPPORT
extern char __ramfunc_region_start[];
extern char __ramfunc_start[];
extern char __ramfunc_end[];
extern char __ramfunc_size[];
Expand Down
4 changes: 2 additions & 2 deletions kernel/xip.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void z_data_copy(void)
z_early_memcpy(&__data_region_start, &__data_region_load_start,
__data_region_end - __data_region_start);
#ifdef CONFIG_ARCH_HAS_RAMFUNC_SUPPORT
z_early_memcpy(&__ramfunc_start, &__ramfunc_load_start,
(uintptr_t) &__ramfunc_size);
z_early_memcpy(&__ramfunc_region_start, &__ramfunc_load_start,
__ramfunc_end - __ramfunc_region_start);
#endif /* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT */
#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_ccm), okay)
z_early_memcpy(&__ccm_data_start, &__ccm_data_rom_start,
Expand Down
Loading