]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: armv8: save boot arguments
authorRaymond Mao <raymond.mao@linaro.org>
Sat, 3 Feb 2024 16:36:24 +0000 (08:36 -0800)
committerTom Rini <trini@konsulko.com>
Thu, 29 Feb 2024 14:24:22 +0000 (09:24 -0500)
Save boot arguments x[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>
arch/arm/cpu/armv8/start.S

index 6cc1d26e5e2da2571214610d0fbb65ad9451cb8e..746128026172f495da84c3abf1b1b238ab3ef3f1 100644 (file)
@@ -370,5 +370,28 @@ ENTRY(c_runtime_cpu_setup)
 ENDPROC(c_runtime_cpu_setup)
 
 WEAK(save_boot_params)
+#if (IS_ENABLED(CONFIG_BLOBLIST))
+       /* Calculate the PC-relative address of saved_args */
+       adr     x9, saved_args_offset
+       ldr     w10, saved_args_offset
+       add     x9, x9, w10, sxtw
+
+       stp     x0, x1, [x9]
+       stp     x2, x3, [x9, #16]
+#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
+       .dword 0
+       .endr
+END(saved_args)
+#endif