Skip to content

Commit 1b96482

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 86293eb commit 1b96482

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
@@ -209,6 +209,10 @@ EL1_Reset_Handler:
209209
mcr p15, 1, r0, c9, c1, 0
210210
#endif
211211

212+
#if defined(z_arm_platform_pre_stack_init)
213+
bl z_arm_platform_pre_stack_init
214+
#endif
215+
212216
ldr r0, =arm_cpu_boot_params
213217

214218
#if CONFIG_MP_MAX_NUM_CPUS > 1

0 commit comments

Comments
 (0)