]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
common: add config for board_init() call
authorBen Dooks <ben.dooks@codethink.co.uk>
Wed, 7 May 2025 12:23:42 +0000 (13:23 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 22 May 2025 19:55:17 +0000 (13:55 -0600)
Add CONFIG_BOARD_INIT to specifu if the board_init() needs calling
during initcall phase, and default it to 'y' for the relevant
architectures which probably need it.

This allows anyone with a board that doesn't need it to just remove
it from the initcall list w/o an empty code block in the board init
file.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Tom Rini <trini@konsulko.com>
common/Kconfig
common/board_r.c

index be517b80eb56c7a6827459621a99738ce0733902..17539079f90f21d099227bf8e9feb0f37154595a 100644 (file)
@@ -727,6 +727,13 @@ config BOARD_EARLY_INIT_R
          relocation. With this option, U-Boot calls board_early_init_r()
          in the post-relocation init sequence.
 
+config BOARD_INIT
+       bool "Call board-specific init board_init() during init-calls"
+       default y if ARM || RISCV || SANDBOX
+       help
+         Some boards need an board_init() function called during the initcall
+         phase of startup.
+
 config BOARD_POSTCLK_INIT
        bool "Call board_postclk_init"
        help
index b90a4d9ff695111481c5e8b3db8040013664f815..65ff5fb595cbd141605845e8f2ffe725974782b0 100644 (file)
@@ -649,8 +649,7 @@ static void initcall_run_r(void)
 #if CONFIG_IS_ENABLED(ADDR_MAP)
        INITCALL(init_addr_map);
 #endif
-#if CONFIG_IS_ENABLED(ARM) || CONFIG_IS_ENABLED(RISCV) || \
-    CONFIG_IS_ENABLED(SANDBOX)
+#if CONFIG_IS_ENABLED(BOARD_INIT)
        INITCALL(board_init);   /* Setup chipselects */
 #endif
        /*