]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: Add new config option ARCH_VERY_EARLY_INIT
authorPali Rohár <pali@kernel.org>
Fri, 6 May 2022 09:05:13 +0000 (11:05 +0200)
committerStefan Roese <sr@denx.de>
Mon, 16 May 2022 09:31:33 +0000 (11:31 +0200)
When this option is set then ARM _main() function would call
arch_very_early_init() function at the beginning. It would be before
calling any other functions like debug_uart_init() and also before
initializing C runtime environment.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
arch/arm/Kconfig
arch/arm/lib/crt0.S

index 0afec5155b1b477cce2b71c45a39b40dbe8cd79c..9898c7d68e1bf3c9d9b10abb6c752c564d8d53c7 100644 (file)
@@ -401,6 +401,12 @@ config SYS_ARM_CACHE_WRITEALLOC
          write is performed.
 endchoice
 
+config ARCH_VERY_EARLY_INIT
+       bool
+
+config SPL_ARCH_VERY_EARLY_INIT
+       bool
+
 config ARCH_CPU_INIT
        bool "Enable ARCH_CPU_INIT"
        help
index ba312901f33172ca57d316dd009160e8d320b23c..612a2d5b698e40cd8a100785e00680a2b85a2603 100644 (file)
@@ -90,6 +90,11 @@ clbss_l:cmp  r0, r1                  /* while not at end of BSS */
 
 ENTRY(_main)
 
+/* Call arch_very_early_init before initializing C runtime environment. */
+#if CONFIG_IS_ENABLED(ARCH_VERY_EARLY_INIT)
+       bl      arch_very_early_init
+#endif
+
 /*
  * Set up initial C runtime environment and call board_init_f(0).
  */