s32k1xx:Support ramfunc

This commit is contained in:
David Sidrane 2021-02-23 12:25:05 -08:00 committed by Xiang Xiao
parent 07900cdce9
commit 62321fa5db
2 changed files with 16 additions and 1 deletions

View File

@ -236,8 +236,9 @@ config ARCH_CHIP_S32K1XX
bool "NXP S32K1XX" bool "NXP S32K1XX"
select ARCH_HAVE_MPU select ARCH_HAVE_MPU
select ARM_HAVE_MPU_UNIFIED select ARM_HAVE_MPU_UNIFIED
select ARCH_HAVE_RAMFUNCS
---help--- ---help---
NPX LPC54XX architectures (ARM Cortex-M0+ and Cortex-M4F). NPX S32K1XX architectures (ARM Cortex-M0+ and Cortex-M4F).
config ARCH_CHIP_SAMA5 config ARCH_CHIP_SAMA5
bool "Atmel SAMA5" bool "Atmel SAMA5"

View File

@ -332,6 +332,20 @@ void __start(void)
} }
#endif #endif
/* Copy any necessary code sections from FLASH to RAM. The correct
* destination in SRAM is given by _sramfuncs and _eramfuncs. The
* temporary location is in flash after the data initialization code
* at _framfuncs. This should be done before s32k1xx_clockconfig() is
* called (in case it has some dependency on initialized C variables).
*/
#ifdef CONFIG_ARCH_RAMFUNCS
for (src = &_framfuncs, dest = &_sramfuncs; dest < &_eramfuncs; )
{
*dest++ = *src++;
}
#endif
/* Configure the clocking and the console uart so that we can get debug /* Configure the clocking and the console uart so that we can get debug
* output as soon as possible. NOTE: That this logic must not assume that * output as soon as possible. NOTE: That this logic must not assume that
* .bss or .data have been initialized. * .bss or .data have been initialized.