summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSilvano di Ninno <silvano.dininno@nxp.com>2018-11-21 05:36:49 +0100
committerSilvano di Ninno <silvano.dininno@nxp.com>2018-11-22 14:07:20 +0100
commit697cfe9dbdc079b68d8b5685b728a7283c837607 (patch)
treee265f5c42e5bb3f50b0cb4c46518dfce7d411c81 /arch
parentf042c8f7ca3ce0020a193d5a51ca07afd95cdf51 (diff)
TEE-329-1: OP-TEE: Allow ATF to pass boot arg to u-boot
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/arch-imx8/sys_proto.h1
-rw-r--r--arch/arm/mach-imx/imx8/Makefile2
-rw-r--r--arch/arm/mach-imx/imx8/lowlevel_init.S33
3 files changed, 35 insertions, 1 deletions
diff --git a/arch/arm/include/asm/arch-imx8/sys_proto.h b/arch/arm/include/asm/arch-imx8/sys_proto.h
index 26078fcfc14..c2641513054 100644
--- a/arch/arm/include/asm/arch-imx8/sys_proto.h
+++ b/arch/arm/include/asm/arch-imx8/sys_proto.h
@@ -19,4 +19,5 @@ struct pass_over_info_t {
int print_bootinfo(void);
int init_otg_power(void);
void power_off_pd_devices(const char* permanent_on_devices[], int size);
+extern unsigned long rom_pointer[];
enum boot_device get_boot_device(void);
diff --git a/arch/arm/mach-imx/imx8/Makefile b/arch/arm/mach-imx/imx8/Makefile
index fff241ebf7d..e3be955b2db 100644
--- a/arch/arm/mach-imx/imx8/Makefile
+++ b/arch/arm/mach-imx/imx8/Makefile
@@ -3,7 +3,7 @@
#
# SPDX-License-Identifier: GPL-2.0+
#
-
+obj-y += lowlevel_init.o
obj-y += cpu.o
obj-y += clock.o
obj-y += fsl_mu_hal.o
diff --git a/arch/arm/mach-imx/imx8/lowlevel_init.S b/arch/arm/mach-imx/imx8/lowlevel_init.S
new file mode 100644
index 00000000000..141b82dcb90
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/lowlevel_init.S
@@ -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