Merge git://git.denx.de/u-boot-fsl-qoriq
[oweals/u-boot.git] / arch / arm / mach-omap2 / hwinit-common.c
index f3172939889296dec5c5ec797058505c60372ed1..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();
 }
 
@@ -171,6 +186,7 @@ void board_init_f(ulong dummy)
 #endif
        /* For regular u-boot sdram_init() is called from dram_init() */
        sdram_init();
+       gd->ram_size = omap_sdram_size();
 }
 #endif
 
@@ -273,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