Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[oweals/u-boot.git] / board / gateworks / gw_ventana / gw_ventana_spl.c
index 79cb5943d0ef38c932aa49b9fc78df81838066ac..d4418e554c4aac209a37126d4e6b73b009ea6c0c 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/imx-common/boot_mode.h>
 #include <asm/imx-common/iomux-v3.h>
 #include <asm/imx-common/mxc_i2c.h>
+#include <environment.h>
 #include <spl.h>
 
 #include "gsc.h"
@@ -514,10 +515,8 @@ void board_init_f(ulong dummy)
        setup_iomux_gpio(board_model, &ventana_info);
 
        /* provide some some default: 32bit 128MB */
-       if (GW_UNKNOWN == board_model) {
-               ventana_info.sdram_width = 2;
-               ventana_info.sdram_size = 3;
-       }
+       if (GW_UNKNOWN == board_model)
+               hang();
 
        /* configure MMDC for SDRAM width/size and per-model calibration */
        spl_dram_init(8 << ventana_info.sdram_width,
@@ -551,7 +550,29 @@ void spl_board_init(void)
        default:
                puts("Unknown boot device\n");
        }
+
+       /* PMIC init */
+       setup_pmic();
+}
+
+#ifdef CONFIG_SPL_OS_BOOT
+/* return 1 if we wish to boot to uboot vs os (falcon mode) */
+int spl_start_uboot(void)
+{
+       int ret = 1;
+
+       debug("%s\n", __func__);
+#ifdef CONFIG_SPL_ENV_SUPPORT
+       env_init();
+       env_relocate_spec();
+       debug("boot_os=%s\n", getenv("boot_os"));
+       if (getenv_yesno("boot_os") == 1)
+               ret = 0;
+#endif
+       debug("%s booting %s\n", __func__, ret ? "uboot" : "linux");
+       return ret;
 }
+#endif
 
 void reset_cpu(ulong addr)
 {