Skip to contentSkip to conversation

ARM: zynq: zed: partially revert zynq_cpu_lowlevel_init() chnages

PATCH Applied Lucas Stach 2 participants 2 messages Jan 13, 2020 – Jan 14, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: zynq: zed: partially revert zynq_cpu_lowlevel_init() chnages

Calling arm_cpu_lowlevel_init() from zynq_cpu_lowlevel_init() adds a stack push/pop to the latter function which doesn't work this early in the boot.

As the BootROM apparently hands proccessor control to us in abort(!?!) mode, setting up a stack requires duplicating most of arm_cpu_lowlevel_init(). To get around this catch-22 move the call to arm_cpu_lowlevel_init back into the board lowlevel start function, so we don't need a stack at all.

---
 arch/arm/boards/avnet-zedboard/lowlevel.c | 1 +
 arch/arm/mach-zynq/cpu_init.c             | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
arch/arm/boards/avnet-zedboard/lowlevel.c +1 -0
index c987db75b068..8edc6293f210 100644
@@ -284,6 +284,7 @@ ENTRY_FUNCTION(start_avnet_zedboard, r0, r1, r2)
 
 	void *fdt = __dtb_zynq_zed_start + get_runtime_offset();
 
+	arm_cpu_lowlevel_init();
 	zynq_cpu_lowlevel_init();
 
 	avnet_zedboard_ps7_init();
arch/arm/mach-zynq/cpu_init.c +0 -2
index ec5ee59e169d..ca7c4b297988 100644
@@ -7,8 +7,6 @@
 
 void zynq_cpu_lowlevel_init(void)
 {
-	arm_cpu_lowlevel_init();
-
 	enable_arm_errata_761320_war();
 	enable_arm_errata_794072_war();
 	enable_arm_errata_845369_war();
Signature · 7 lines
2.24.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Lucas Stach

Calling arm_cpu_lowlevel_init() from zynq_cpu_lowlevel_init() adds a stack push/pop to the latter function which doesn't work this early in the boot.

As the BootROM apparently hands proccessor control to us in abort(!?!) mode, setting up a stack requires duplicating most of arm_cpu_lowlevel_init(). To get around this catch-22 move the call to arm_cpu_lowlevel_init back into the board lowlevel start function, so we don't need a stack at all.

Quoted 5 lines
---
 arch/arm/boards/avnet-zedboard/lowlevel.c | 1 +
 arch/arm/mach-zynq/cpu_init.c             | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox