sunxi: move non-essential code out of s_init()
authorAndre Przywara <andre.przywara@arm.com>
Sat, 22 Jan 2022 10:05:12 +0000 (10:05 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Fri, 4 Feb 2022 00:09:03 +0000 (00:09 +0000)
commit5bc4cd05d7d4994a1bdea282c0acd7d31b7337ef
treecdefe774a7987656c32cde498773cf20a35eaee5
parent006fddde01da7e8b3c7cad4a35f3245edc894ab4
sunxi: move non-essential code out of s_init()

So far all Allwinner based boards were doing some not-so-lowlevel-setup
in lowlevel's s_init() routine.
This includes the initial clock, timer and pinmux setup, among other
things. This is clearly out of the "absolute bare minimum to get started"
scope that lowlevel_init.S suggests for this function.

Since we have an SPL, which is called right after s_init(), move those
calls to our board_init_f() function. As we overwrite this only for
the SPL, this has the added benefit of not doing this setup *again*
shortly afterwards, when running U-Boot proper.

This makes gpio_init() to be called from the SPL only, so pull this code
into a CONFIG_SPL_BUILD protected part to avoid build warnings.

Reviewed-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/mach-sunxi/board.c