Merge git://git.denx.de/u-boot-fsl-qoriq
[oweals/u-boot.git] / arch / arm / mach-omap2 / hwinit-common.c
index cac32748ec10c2ad05fcb51f801efd96f397c99b..56890a0c545caf215f16cc82c6248f044d5c519c 100644 (file)
@@ -12,6 +12,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
+#include <debug_uart.h>
 #include <spl.h>
 #include <asm/arch/sys_proto.h>
 #include <linux/sizes.h>
@@ -157,8 +158,22 @@ void early_system_init(void)
        do_io_settings();
 #endif
        setup_early_clocks();
+#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
        do_board_detect();
+#ifdef CONFIG_SPL_BUILD
+       spl_early_init();
+#endif
        vcores_init();
+#ifdef CONFIG_DEBUG_UART_OMAP
+       debug_uart_init();
+#endif
        prcm_init();
 }
 
@@ -274,15 +289,6 @@ int checkboard(void)
        return 0;
 }
 
-/*
- *  get_device_type(): tell if GP/HS/EMU/TST
- */
-u32 get_device_type(void)
-{
-       return (readl((*ctrl)->control_status) &
-                                     (DEVICE_TYPE_MASK)) >> DEVICE_TYPE_SHIFT;
-}
-
 #if defined(CONFIG_DISPLAY_CPUINFO)
 /*
  * Print CPU information