]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
stm32mp2: update register used by BL31 for boot parameter
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Wed, 17 Sep 2025 12:31:30 +0000 (14:31 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Tue, 30 Sep 2025 15:37:10 +0000 (17:37 +0200)
Use the ARM64 kernel booting register settings, defined in Linux
documentation Documentation/arch/arm64/booting.rst:

 x0 = physical address of device tree blob (dtb) in system RAM.

so kernel can replace U-Boot in FIP without modification of BL31.

Use x0 for future TF-A version and keep x2 as fallback to be compatible
with previous version of TF-A BL31.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
arch/arm/mach-stm32mp/stm32mp2/cpu.c

index c3b87d7f9810b637f09e9375fed67d12693dd458..e081dc605b84a69f86364da913fa21df62038a51 100644 (file)
@@ -92,13 +92,21 @@ uintptr_t get_stm32mp_bl2_dtb(void)
 }
 
 /*
- * Save the FDT address provided by TF-A in r2 at boot time
+ * Save the FDT address provided by TF-A at boot time
  * This function is called from start.S
  */
-void save_boot_params(unsigned long r0, unsigned long r1, unsigned long r2,
-                     unsigned long r3)
+void save_boot_params(unsigned long x0, unsigned long x1, unsigned long x2,
+                     unsigned long x3)
 {
-       nt_fw_dtb = r2;
+       /* use the ARM64 kernel booting register settings:
+        * x0 = physical address of device tree blob (dtb) in system RAM.
+        * so kernel can replace U-Boot in FIP wihtout BL31 modification
+        * else falback to x2 used in previous TF-A version
+        */
+       if (x0)
+               nt_fw_dtb = x0;
+       else
+               nt_fw_dtb = x2;
 
        save_boot_params_ret();
 }