powerpc: Add cpu_secondary_init_r to allow for initialization post env setup
[platform/kernel/u-boot.git] / arch / powerpc / lib / board.c
index 4719f8c..83fb074 100644 (file)
@@ -186,6 +186,12 @@ int __board_flash_wp_on(void)
 }
 int board_flash_wp_on(void) __attribute__((weak, alias("__board_flash_wp_on")));
 
+void __cpu_secondary_init_r(void)
+{
+}
+void cpu_secondary_init_r(void)
+__attribute__((weak, alias("__cpu_secondary_init_r")));
+
 static int init_func_ram (void)
 {
 #ifdef CONFIG_BOARD_TYPES
@@ -798,6 +804,14 @@ void board_init_r (gd_t *id, ulong dest_addr)
        env_relocate ();
 
        /*
+        * after non-volatile devices & environment is setup and cpu code have
+        * another round to deal with any initialization that might require
+        * full access to the environment or loading of some image (firmware)
+        * from a non-volatile device
+        */
+       cpu_secondary_init_r();
+
+       /*
         * Fill in missing fields of bd_info.
         * We do this here, where we have "normal" access to the
         * environment; we used to do this still running from ROM,