Merge tag 'efi-2019-04-rc2' of https://github.com/xypron2/u-boot
[oweals/u-boot.git] / arch / arm / mach-omap2 / omap3 / board.c
index f1436fbf519217a6fbed9f87911520a90fd51425..2d25fc60a0eec6cdfb5f1f784286b631b10fd4d3 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  *
  * Common board functions for OMAP3 based boards.
@@ -13,8 +14,6 @@
  *      Richard Woodruff <r-woodruff2@ti.com>
  *      Syed Mohammed Khasim <khasim@ti.com>
  *
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <dm.h>
@@ -28,8 +27,6 @@
 #include <asm/omap_common.h>
 #include <linux/compiler.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 #ifndef CONFIG_SYS_L2CACHE_OFF
@@ -46,7 +43,7 @@ static const struct omap_gpio_platdata omap34xx_gpio[] = {
        { 5, OMAP34XX_GPIO6_BASE },
 };
 
-U_BOOT_DEVICES(am33xx_gpios) = {
+U_BOOT_DEVICES(omap34xx_gpios) = {
        { "gpio_omap", &omap34xx_gpio[0] },
        { "gpio_omap", &omap34xx_gpio[1] },
        { "gpio_omap", &omap34xx_gpio[2] },
@@ -173,6 +170,11 @@ void try_unlock_memory(void)
        return;
 }
 
+void early_system_init(void)
+{
+       hw_data_init();
+}
+
 /******************************************************************************
  * Routine: s_init
  * Description: Does early system init of muxing and clocks.
@@ -181,6 +183,7 @@ void try_unlock_memory(void)
 void s_init(void)
 {
        watchdog_init();
+       early_system_init();
 
        try_unlock_memory();
 
@@ -204,7 +207,14 @@ void s_init(void)
 #ifdef CONFIG_SPL_BUILD
 void board_init_f(ulong dummy)
 {
+       early_system_init();
        mem_init();
+       /*
+       * Save the boot parameters passed from romcode.
+       * We cannot delay the saving further than this,
+       * to prevent overwrites.
+       */
+       save_omap_boot_params();
 }
 #endif