sunxi: spl: initialise timer before clocks
authorAndre Przywara <andre.przywara@arm.com>
Sun, 20 Jul 2025 15:29:19 +0000 (16:29 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Tue, 12 Aug 2025 09:44:01 +0000 (10:44 +0100)
Recent changes in the H6 clock code added delay() calls into the SPL clock
setup routine, which requires the timers to work. When compiling for
AArch64, we are always using the Arm Generic Timer (aka. arch timer),
which does not require further setup, hence having an empty timer_init()
routine.
However for 32-bit SoCs we use the Allwinner timers, which require some
setup routine, and hence we need timer_init() to be called before
clock_init().

Swap the order of the two calls, to be more robust when compiling the H6
clock code for AArch32 or when using the Allwinner timers for whatever
reason.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
arch/arm/mach-sunxi/board.c

index fb4837c..432b1c1 100644 (file)
@@ -476,8 +476,8 @@ void board_init_f(ulong dummy)
        /* Enable non-secure access to some peripherals */
        tzpc_init();
 
-       clock_init();
        timer_init();
+       clock_init();
        gpio_init();
 
        spl_init();