diff options
author | Raymond Mao <raymond.mao@linaro.org> | 2024-02-03 08:36:23 -0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-02-29 09:24:22 -0500 |
commit | 5103e69344d60eb8c8d2cf804ec00d0ef3975124 (patch) | |
tree | 41b76b3e9356475ba17ec2977425c9ededa7e9f6 | |
parent | 1ef43f3bf20a4a9508c299a738d01faa3dc3ce95 (diff) | |
download | u-boot-5103e69344d60eb8c8d2cf804ec00d0ef3975124.zip u-boot-5103e69344d60eb8c8d2cf804ec00d0ef3975124.tar.gz u-boot-5103e69344d60eb8c8d2cf804ec00d0ef3975124.tar.bz2 |
arm: armv7: save boot arguments
Save boot arguments r[0-3] into an array for handover of bloblist from
previous boot stage.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r-- | arch/arm/cpu/armv7/start.S | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index 69e281b..7730a16 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -152,9 +152,38 @@ ENDPROC(c_runtime_cpu_setup) * *************************************************************************/ WEAK(save_boot_params) +#if (IS_ENABLED(CONFIG_BLOBLIST)) + /* Calculate the PC-relative address of saved_args */ + adr r12, saved_args_offset + ldr r13, saved_args_offset + add r12, r12, r13 + + /* + * Intentionally swapping r0 with r2 in order to simplify the C + * function we use later. + */ + str r2, [r12] + str r1, [r12, #4] + str r0, [r12, #8] + str r3, [r12, #12] +#endif b save_boot_params_ret @ back to my caller ENDPROC(save_boot_params) +#if (IS_ENABLED(CONFIG_BLOBLIST)) +saved_args_offset: + .long saved_args - . /* offset from current code to save_args */ + + .section .data + .align 2 + .global saved_args +saved_args: + .rept 4 + .word 0 + .endr +END(saved_args) +#endif + #ifdef CONFIG_ARMV7_LPAE WEAK(switch_to_hypervisor) b switch_to_hypervisor_ret |