summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorAbhishek Shah <abhishek.shah@broadcom.com>2020-07-15 20:18:59 +0300
committerTom Rini <trini@konsulko.com>2020-07-29 17:13:41 +0300
commitef7192e4043d7724f0d063072092e00150fb1f5e (patch)
tree8a70244805bc5075d35fd98cf45b9f5cad7b38e0 /arch/arm
parent69d8acc30ba05dd5d5bc7a874f99ed254eb17d33 (diff)
downloadu-boot-ef7192e4043d7724f0d063072092e00150fb1f5e.tar.xz
board: ns3: add api to save boot parameters passed from BL31
Add API to save boot parameters passed from BL31 Use assembly implementation of save_boot_params instead of c function. Because generally ATF does not set up SP_EL2 on exiting. Thus, usage of a C function immediately after exiting with no stack setup done by ATF explicitly, may cause SP_EL2 to be not sane, which in turn causes a crash if this boot was not lucky to get an SP_EL2 in valid range. Replace C implementation with assembly one which does not use stack this early, and let u-boot to set up its stack later. Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com> Signed-off-by: Rajesh Ravi <rajesh.ravi@broadcom.com> Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/cpu/armv8/bcmns3/lowlevel.S9
-rw-r--r--arch/arm/include/asm/arch-bcmns3/bl33_info.h26
2 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/bcmns3/lowlevel.S b/arch/arm/cpu/armv8/bcmns3/lowlevel.S
index 6709c9a188..bf1a17ab03 100644
--- a/arch/arm/cpu/armv8/bcmns3/lowlevel.S
+++ b/arch/arm/cpu/armv8/bcmns3/lowlevel.S
@@ -87,3 +87,12 @@ ENTRY(__asm_flush_l3_dcache)
mov lr, x29
ret
ENDPROC(__asm_flush_l3_dcache)
+
+ENTRY(save_boot_params)
+/*
+ * void set_boot_params(uint64_t x0, uint64_t x1, uint64_t x2, uint64_t x3)
+ */
+ adr x4, bl33_info
+ str x0, [x4]
+ b save_boot_params_ret
+ENDPROC(save_boot_params)
diff --git a/arch/arm/include/asm/arch-bcmns3/bl33_info.h b/arch/arm/include/asm/arch-bcmns3/bl33_info.h
new file mode 100644
index 0000000000..bbc95b0186
--- /dev/null
+++ b/arch/arm/include/asm/arch-bcmns3/bl33_info.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2020 Broadcom.
+ *
+ */
+
+#ifndef BL33_INFO_H
+#define BL33_INFO_H
+#include <asm/io.h>
+
+/* Increase version number each time this file is modified */
+#define BL33_INFO_VERSION 1
+
+struct chip_info {
+ unsigned int chip_id;
+ unsigned int rev_id;
+};
+
+struct bl33_info {
+ unsigned int version;
+ struct chip_info chip;
+};
+
+extern struct bl33_info *bl33_info;
+
+#endif