]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/spl/spl.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / common / spl / spl.c
index c640f874040b9f118ca44e30c8f3936379cce6b2..6a5a1365a145af5e05f3e5063bb876873f2d8c25 100644 (file)
@@ -74,6 +74,16 @@ __weak int spl_start_uboot(void)
 }
 #endif
 
+/*
+ * Weak default function for board specific cleanup/preparation before
+ * Linux boot. Some boards/platforms might not need it, so just provide
+ * an empty stub here.
+ */
+__weak void spl_board_prepare_for_linux(void)
+{
+       /* Nothing to do! */
+}
+
 void spl_parse_image_header(const struct image_header *header)
 {
        u32 header_size = sizeof(struct image_header);
@@ -113,13 +123,13 @@ void spl_parse_image_header(const struct image_header *header)
        }
 }
 
-static void __noreturn jump_to_image_no_args(void)
+__weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
 {
        typedef void __noreturn (*image_entry_noargs_t)(u32 *);
        image_entry_noargs_t image_entry =
-                       (image_entry_noargs_t) spl_image.entry_point;
+                       (image_entry_noargs_t) spl_image->entry_point;
 
-       debug("image entry point: 0x%X\n", spl_image.entry_point);
+       debug("image entry point: 0x%X\n", spl_image->entry_point);
        /* Pass the saved boot_params from rom code */
 #if defined(CONFIG_VIRTIO) || defined(CONFIG_ZEBU)
        image_entry = (image_entry_noargs_t)0x80100000;
@@ -155,6 +165,14 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
                        CONFIG_SYS_SPL_MALLOC_SIZE);
 #endif
 
+#ifndef CONFIG_PPC
+       /*
+        * timer_init() does not exist on PPC systems. The timer is initialized
+        * and enabled (decrementer) in interrupt_init() here.
+        */
+       timer_init();
+#endif
+
 #ifdef CONFIG_SPL_BOARD_INIT
        spl_board_init();
 #endif
@@ -193,6 +211,20 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        case BOOT_DEVICE_SPI:
                spl_spi_load_image();
                break;
+#endif
+#ifdef CONFIG_SPL_ETH_SUPPORT
+       case BOOT_DEVICE_CPGMAC:
+#ifdef CONFIG_SPL_ETH_DEVICE
+               spl_net_load_image(CONFIG_SPL_ETH_DEVICE);
+#else
+               spl_net_load_image(NULL);
+#endif
+               break;
+#endif
+#ifdef CONFIG_SPL_USBETH_SUPPORT
+       case BOOT_DEVICE_USBETH:
+               spl_net_load_image("usb_ether");
+               break;
 #endif
        default:
                debug("SPL: Un-supported Boot Device\n");
@@ -212,7 +244,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        default:
                debug("Unsupported OS image.. Jumping nevertheless..\n");
        }
-       jump_to_image_no_args();
+       jump_to_image_no_args(&spl_image);
 }
 
 /*
@@ -222,7 +254,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 void preloader_console_init(void)
 {
        gd->bd = &bdata;
-       gd->flags |= GD_FLG_RELOC;
        gd->baudrate = CONFIG_BAUDRATE;
 
        serial_init();          /* serial communications setup */