summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-09-21 10:47:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-09-21 11:02:19 +0200
commit58eb58a9af97dde4923f2f19100f393c892a9a0a (patch)
tree11f43bd80fd375c14b1e090987f29ec96cd47a5f
parentec76c020b9b22f0d7a28ae7a40fe74e867fed26c (diff)
downloadbarebox-master.tar.gz
barebox-master.tar.xz
arm: rk3568 boards: call setup_c() before accessing global pointersHEADmaster
Global pointers may only be accessed after setup_c() has been called. In pine-quartz64 and the Radxa Rock3 board the device tree pointer has been initialized earlier. As a result the pointer points to the address the device tree would be placed when the binary would run from 0x0. For some reason it nevertheless seemed to work though. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/boards/pine64-quartz64/lowlevel.c26
-rw-r--r--arch/arm/boards/radxa-rock3/lowlevel.c26
2 files changed, 28 insertions, 24 deletions
diff --git a/arch/arm/boards/pine64-quartz64/lowlevel.c b/arch/arm/boards/pine64-quartz64/lowlevel.c
index b295885522..ae1f0cf920 100644
--- a/arch/arm/boards/pine64-quartz64/lowlevel.c
+++ b/arch/arm/boards/pine64-quartz64/lowlevel.c
@@ -10,18 +10,9 @@
extern char __dtb_rk3566_quartz64_a_start[];
-static noinline void start_quartz64(void *fdt)
+static noinline void start_quartz64(void)
{
- /*
- * Image execution starts at 0x0, but this is used for ATF and
- * OP-TEE later, so move away from here.
- */
- if (current_el() == 3)
- relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
- else
- relocate_to_current_adr();
-
- setup_c();
+ void *fdt = __dtb_rk3566_quartz64_a_start;
if (current_el() == 3) {
rk3568_lowlevel_init();
@@ -35,5 +26,16 @@ static noinline void start_quartz64(void *fdt)
ENTRY_FUNCTION(start_quartz64a, r0, r1, r2)
{
- start_quartz64(__dtb_rk3566_quartz64_a_start);
+ /*
+ * Image execution starts at 0x0, but this is used for ATF and
+ * OP-TEE later, so move away from here.
+ */
+ if (current_el() == 3)
+ relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
+ else
+ relocate_to_current_adr();
+
+ setup_c();
+
+ start_quartz64();
}
diff --git a/arch/arm/boards/radxa-rock3/lowlevel.c b/arch/arm/boards/radxa-rock3/lowlevel.c
index 00a68889cd..2a449c17ae 100644
--- a/arch/arm/boards/radxa-rock3/lowlevel.c
+++ b/arch/arm/boards/radxa-rock3/lowlevel.c
@@ -10,18 +10,9 @@
extern char __dtb_rk3568_rock_3a_start[];
-static noinline void rk3568_start(void *fdt)
+static noinline void rk3568_start(void)
{
- /*
- * Image execution starts at 0x0, but this is used for ATF and
- * OP-TEE later, so move away from here.
- */
- if (current_el() == 3)
- relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
- else
- relocate_to_current_adr();
-
- setup_c();
+ void *fdt = __dtb_rk3568_rock_3a_start;
/*
* Enable vccio4 1.8V and vccio6 1.8V
@@ -40,5 +31,16 @@ static noinline void rk3568_start(void *fdt)
ENTRY_FUNCTION(start_rock3a, r0, r1, r2)
{
- rk3568_start(__dtb_rk3568_rock_3a_start);
+ /*
+ * Image execution starts at 0x0, but this is used for ATF and
+ * OP-TEE later, so move away from here.
+ */
+ if (current_el() == 3)
+ relocate_to_adr_full(RK3568_BAREBOX_LOAD_ADDRESS);
+ else
+ relocate_to_current_adr();
+
+ setup_c();
+
+ rk3568_start();
}