TEE-329-1: OP-TEE: Allow ATF to pass boot arg to u-boot
authorSilvano di Ninno <silvano.dininno@nxp.com>
Wed, 21 Nov 2018 04:36:49 +0000 (05:36 +0100)
committerYe Li <ye.li@nxp.com>
Fri, 24 May 2019 09:39:10 +0000 (02:39 -0700)
u-boot currently needs information from ATF to know if
OP-TEE os has been loaded.
this information is transmitted via bootargs.
this patch enables saving those bootargs into a structure.

Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com>
(cherry picked from commit 697cfe9dbdc079b68d8b5685b728a7283c837607)

arch/arm/include/asm/arch-imx8/sys_proto.h
arch/arm/mach-imx/imx8/Makefile
arch/arm/mach-imx/imx8/lowlevel_init.S [new file with mode: 0644]

index fd00e8f..bddd477 100644 (file)
@@ -18,3 +18,4 @@ struct pass_over_info_t {
 enum boot_device get_boot_device(void);
 int print_bootinfo(void);
 void power_off_pd_devices(const char* permanent_on_devices[], int size);
+extern unsigned long rom_pointer[];
index 5c68d1d..ed355c3 100644 (file)
@@ -5,6 +5,7 @@
 #
 
 obj-y += cpu.o iomux.o fuse.o lpcg.o clock.o
+obj-y += lowlevel_init.o
 obj-y += image.o
 obj-$(CONFIG_SPL_BUILD) += parser.o
 ifneq ($(CONFIG_SPL_BUILD),y)
diff --git a/arch/arm/mach-imx/imx8/lowlevel_init.S b/arch/arm/mach-imx/imx8/lowlevel_init.S
new file mode 100644 (file)
index 0000000..141b82d
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2017 NXP
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+#include <config.h>
+
+.align 8
+.global rom_pointer
+rom_pointer:
+       .space 32
+
+/*
+ * Routine: save_boot_params (called after reset from start.S)
+ */
+
+.global save_boot_params
+save_boot_params:
+       /* The firmware provided ATAG/FDT address can be found in r2/x0 */
+       adr     x0, rom_pointer
+       stp     x1, x2, [x0], #16
+       stp     x3, x4, [x0], #16
+
+       /* Returns */
+       b       save_boot_params_ret
+
+.global restore_boot_params
+restore_boot_params:
+       adr     x0, rom_pointer
+       ldp     x1, x2, [x0], #16
+       ldp     x3, x4, [x0], #16
+       ret