]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/mach-omap2/am33xx/board.c
Merge git://git.denx.de/u-boot-rockchip
[u-boot] / arch / arm / mach-omap2 / am33xx / board.c
index faf7d07a03308c5c7badba97171dea62c500c69a..ea0cabad972624b2620ec6f181da5486fd93d2e0 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/io.h>
 #include <asm/emif.h>
 #include <asm/gpio.h>
+#include <asm/omap_common.h>
 #include <i2c.h>
 #include <miiphy.h>
 #include <cpsw.h>
@@ -212,11 +213,9 @@ static struct musb_hdrc_platform_data otg1_plat = {
        .board_data     = &otg1_board_data,
 };
 #endif
-#endif
 
 int arch_misc_init(void)
 {
-#ifndef CONFIG_DM_USB
 #ifdef CONFIG_AM335X_USB0
        musb_register(&otg0_plat, &otg0_board_data,
                (void *)USB0_OTG_BASE);
@@ -225,7 +224,13 @@ int arch_misc_init(void)
        musb_register(&otg1_plat, &otg1_board_data,
                (void *)USB1_OTG_BASE);
 #endif
-#else
+       return 0;
+}
+
+#else  /* CONFIG_USB_MUSB_* && CONFIG_AM335X_USB* && !CONFIG_DM_USB */
+
+int arch_misc_init(void)
+{
        struct udevice *dev;
        int ret;
 
@@ -236,14 +241,16 @@ int arch_misc_init(void)
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
        ret = usb_ether_init();
        if (ret) {
-               error("USB ether init failed\n");
+               pr_err("USB ether init failed\n");
                return ret;
        }
 #endif
-#endif
+
        return 0;
 }
 
+#endif /* CONFIG_USB_MUSB_* && CONFIG_AM335X_USB* && !CONFIG_DM_USB */
+
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 /*
  * In the case of non-SPL based booting we'll want to call these
@@ -332,12 +339,23 @@ void early_system_init(void)
        set_uart_mux_conf();
        setup_early_clocks();
        uart_soft_reset();
+#ifdef CONFIG_SPL_BUILD
+       /*
+        * Save the boot parameters passed from romcode.
+        * We cannot delay the saving further than this,
+        * to prevent overwrites.
+        */
+       save_omap_boot_params();
+#endif
 #ifdef CONFIG_DEBUG_UART_OMAP
        debug_uart_init();
 #endif
 #ifdef CONFIG_TI_I2C_BOARD_DETECT
        do_board_detect();
 #endif
+#ifdef CONFIG_SPL_BUILD
+       spl_early_init();
+#endif
 #if defined(CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC)
        /* Enable RTC32K clock */
        rtc32k_enable();
@@ -347,6 +365,7 @@ void early_system_init(void)
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
 {
+       hw_data_init();
        early_system_init();
        board_early_init_f();
        sdram_init();
@@ -361,6 +380,7 @@ void board_init_f(ulong dummy)
 
 int arch_cpu_init_dm(void)
 {
+       hw_data_init();
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
        early_system_init();
 #endif