]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: Introduce SoC specific init function
authorLukas Funke <lukas.funke@weidmueller.com>
Wed, 27 Mar 2024 12:11:52 +0000 (13:11 +0100)
committerMichal Simek <michal.simek@amd.com>
Mon, 17 Jun 2024 14:02:29 +0000 (16:02 +0200)
Some architectures use spl_board_init() in their SoC specific
implementation. Board developers should be able to add board specific
implementation via spl_board_init(). Hence, introduce a spl_soc_init()
method which is called right before spl_board_init() for SoC
specific implementation.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Link: https://lore.kernel.org/r/20240327121153.2455126-2-lukas.funke-oss@weidmueller.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
common/spl/Kconfig
common/spl/spl.c
include/spl.h

index 46bacad2d81b669c1fc9ce6e8cec4361256ca1ea..0f7797b3a6a96232aa9a8bed7a502bb820c6db2d 100644 (file)
@@ -272,6 +272,13 @@ config SPL_TEXT_BASE
        help
          The address in memory that SPL will be running from.
 
+config SPL_SOC_INIT
+       bool "Call SoC-specific initialization in SPL"
+       help
+         If this option is enabled, U-Boot will call the function
+         spl_soc_init() from board_init_r(). This function should be
+         provided by the SoC vendor.
+
 config SPL_BOARD_INIT
        bool "Call board-specific initialization in SPL"
        help
index 9a879e9fb102085071bfe0b166e704becc355e1f..7794ddccade187a91eafa942ba5e4dda47d20bf9 100644 (file)
@@ -710,6 +710,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
                }
        }
 
+       if (CONFIG_IS_ENABLED(SOC_INIT))
+               spl_soc_init();
+
        if (CONFIG_IS_ENABLED(BOARD_INIT))
                spl_board_init();
 
index 043875f10f4fae9dfeea547ac2e10ea4716e24f2..5dfdf778d2ddf50fbe86f91b39bf5a218e2cac9c 100644 (file)
@@ -816,6 +816,14 @@ int spl_early_init(void);
  */
 int spl_init(void);
 
+/*
+ * spl_soc_init() - Do architecture-specific init in SPL
+ *
+ * If SPL_SOC_INIT is enabled, this is called from board_init_r() before
+ * jumping to the next phase.
+ */
+void spl_soc_init(void);
+
 /*
  * spl_board_init() - Do board-specific init in SPL
  *