Fix some builds with Kconfig.
[coreboot.git] / src / arch / ppc / init / ppc_main.c
index 80674d295ef9ca81012de36f115dd880f061b52c..150deeea67666c4d0c2b2ff7bf2f8cb5e53c8bf3 100644 (file)
@@ -5,14 +5,7 @@
 
 #include <board.h>
 #include <sdram.h>
-
-#ifndef __PPC64__
-extern unsigned _iseg[];
-extern unsigned _liseg[];
-extern unsigned _eliseg[];
-
-void (*payload)(void) = (void (*)(void))_iseg;
-#endif
+#include <cbfs.h>
 
 /*
  * At this point we're running out of flash with our
@@ -23,14 +16,11 @@ void (*payload)(void) = (void (*)(void))_iseg;
  * - start hardwaremain() which does remainder of setup
  */
 
-#ifndef __PPC64__
 extern void flush_dcache(void);
-#endif
 
 void ppc_main(void)
 {
-       unsigned *from;
-       unsigned *to;
+       void (*payload)(void);
 
        /*
         * very early board initialization
@@ -47,24 +37,16 @@ void ppc_main(void)
         */
        board_init2();
 
-#ifndef __PPC64__
        /*
         * Flush cache now that memory is enabled.
         */
        flush_dcache();
 
        /*
-        * Relocate payload (text & data) if necessary
+        * Relocate payload (text & data)
         */
-       if (_liseg != _iseg) {  
-               from = _liseg;
-               to = _iseg;
-               while (from < _eliseg)
-                       *to++ = *from++;
-       }
-
+       payload = cbfs_load_stage("fallback/coreboot_ram");
        payload();
-#endif
 
        /* NOT REACHED */
 }