]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sunxi: compile clock.c for SPL only
authorAndre Przywara <andre.przywara@arm.com>
Thu, 7 Dec 2023 16:06:04 +0000 (16:06 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 22 Apr 2024 00:12:25 +0000 (01:12 +0100)
With the clock_twi_onoff() function now being called only from the SPL,
the whole clock.c file in arch/arm/mach-sunxi is needed by SPL code
only.

Remove the redundant #ifdef from the clock_init() function, actually
this function was already only called from the SPL.
Then adjust the Makefile to compile clock.c only with CONFIG_SPL_BUILD
defined.

This avoids unnecessary code in U-Boot proper and allows further
refactoring and code-split between the SPL and U-Boot proper.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/mach-sunxi/Makefile
arch/arm/mach-sunxi/clock.c

index 1d4c70ec3521c1fe40351a172c00b058c055e65f..3f83c0280ef7b4dd54444758e219951a734c01cc 100644 (file)
@@ -7,7 +7,6 @@
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 
 obj-y  += board.o
-obj-y  += clock.o
 obj-y  += cpu_info.o
 obj-y  += dram_helpers.o
 obj-$(CONFIG_SUN6I_PRCM)       += prcm.o
@@ -31,6 +30,7 @@ obj-y += timer.o
 endif
 
 ifdef CONFIG_SPL_BUILD
+obj-y                          += clock.o
 obj-$(CONFIG_MACH_SUNIV)       += dram_suniv.o
 obj-$(CONFIG_DRAM_SUN4I)       += dram_sun4i.o
 obj-$(CONFIG_DRAM_SUN6I)       += dram_sun6i.o
index b6c68c94f67c8f8bd6d9cdf9f756d992a12c1deb..5e9fa0d0748b979820af2914efa584997aaec7ae 100644 (file)
@@ -23,10 +23,8 @@ __weak void gtbus_init(void)
 
 int clock_init(void)
 {
-#ifdef CONFIG_SPL_BUILD
        clock_init_safe();
        gtbus_init();
-#endif
        clock_init_uart();
        clock_init_sec();