omap4/5: Add support for booting with CH.
[platform/kernel/u-boot.git] / arch / arm / cpu / armv7 / omap-common / spl.c
index c76fea6..d6d7d65 100644 (file)
 #include <nand.h>
 #include <mmc.h>
 #include <fat.h>
-#include <timestamp_autogenerated.h>
-#include <version_autogenerated.h>
+#include <version.h>
 #include <asm/omap_common.h>
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <image.h>
+#include <malloc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+u32* boot_params_ptr = NULL;
 struct spl_image_info spl_image;
 
 /* Define global data structure pointer to it*/
@@ -92,12 +93,16 @@ void spl_parse_image_header(const struct image_header *header)
 
 static void jump_to_image_no_args(void)
 {
-       typedef void (*image_entry_noargs_t)(void)__attribute__ ((noreturn));
+       typedef void (*image_entry_noargs_t)(u32 *)__attribute__ ((noreturn));
        image_entry_noargs_t image_entry =
                        (image_entry_noargs_t) spl_image.entry_point;
 
        debug("image entry point: 0x%X\n", spl_image.entry_point);
-       image_entry();
+       /* Pass the saved boot_params from rom code */
+#if defined(CONFIG_VIRTIO) || defined(CONFIG_ZEBU)
+       image_entry = 0x80100000;
+#endif
+       image_entry((u32 *)&boot_params_ptr);
 }
 
 void jump_to_image_no_args(void) __attribute__ ((noreturn));
@@ -106,6 +111,9 @@ void board_init_r(gd_t *id, ulong dummy)
        u32 boot_device;
        debug(">>spl:board_init_r()\n");
 
+       mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
+                       CONFIG_SYS_SPL_MALLOC_SIZE);
+
        timer_init();
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 
@@ -153,6 +161,8 @@ void preloader_console_init(void)
 
        serial_init();          /* serial communications setup */
 
+       gd->have_console = 1;
+
        /* Avoid a second "U-Boot" coming from this string */
        u_boot_rev = &u_boot_rev[7];
 
@@ -161,3 +171,11 @@ void preloader_console_init(void)
        omap_rev_string(rev_string_buffer);
        printf("Texas Instruments %s\n", rev_string_buffer);
 }
+
+void __omap_rev_string(char *str)
+{
+       sprintf(str, "Revision detection unimplemented");
+}
+
+void omap_rev_string(char *str)
+       __attribute__((weak, alias("__omap_rev_string")));