Skip to content

Commit 9143075

Browse files
author
Tavish Naruka
committed
arch: arm: Cortex-A/R: add pre stack platform init
Adds platform (SoC) specific startup hook executed before the stack is initialised. Signed-off-by: Tavish Naruka <[email protected]>
1 parent eca5790 commit 9143075

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

arch/arm/core/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ config PLATFORM_SPECIFIC_INIT
174174

175175
This option is deprecated, use SOC_RESET_HOOK instead.
176176

177+
config PLATFORM_SPECIFIC_PRE_STACK_INIT
178+
bool "Platform (SOC) specific startup hook executed before the stack is initialised"
179+
help
180+
The platform specific initialization code (z_arm_platform_pre_stack_init) is
181+
executed in the early startup code right after the registers are set to known
182+
values and before stack is set up. Note that this code cannot use the stack unlike
183+
z_arm_platform_init.
184+
177185
config FAULT_DUMP
178186
int "Fault dump level"
179187
default 2

arch/arm/core/cortex_a_r/reset.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ EL1_Reset_Handler:
203203

204204
#endif /* CONFIG_DCLS */
205205

206+
#if defined(CONFIG_PLATFORM_SPECIFIC_PRE_STACK_INIT)
207+
bl z_arm_platform_pre_stack_init
208+
#endif
209+
206210
#if defined(CONFIG_CPU_CORTEX_R52_CACHE_SEGREGATION)
207211
ldr r0, =IMP_CSCTLR(CONFIG_CPU_CORTEX_R52_ICACHE_FLASH_WAY,
208212
CONFIG_CPU_CORTEX_R52_DCACHE_FLASH_WAY)

0 commit comments

Comments
 (0)