summaryrefslogtreecommitdiffstats
path: root/board/gateworks/gw_ventana/gw_ventana_spl.c
diff options
context:
space:
mode:
authorTim Harvey <tharvey@gateworks.com>2016-05-23 08:25:28 -0700
committerStefano Babic <sbabic@denx.de>2016-05-24 15:01:43 +0200
commit3c0fd17f61060f3077b0601e0d8353e2b1b6a3df (patch)
tree7b55d74d04d599c5306d021a4cb872111d1e8ab0 /board/gateworks/gw_ventana/gw_ventana_spl.c
parenta419352daf7a3dd29306d458fd3924e394d3cdc0 (diff)
downloadtalos-obmc-uboot-3c0fd17f61060f3077b0601e0d8353e2b1b6a3df.tar.gz
talos-obmc-uboot-3c0fd17f61060f3077b0601e0d8353e2b1b6a3df.zip
imx: ventana: use EEPROM register for falcon boot mode
NAND+MMC env support costs 12KB in the SPL which is fairly expensive just for the ability to specify whether or not to boot to uboot or directly to linux. The Ventana boards have plenty of EEPROM storage so we will use a byte there to signify if we should boot to the bootloader or to the OS. Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'board/gateworks/gw_ventana/gw_ventana_spl.c')
-rw-r--r--board/gateworks/gw_ventana/gw_ventana_spl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 0a6ad47c7d..ed42b860aa 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -15,6 +15,7 @@
#include <asm/imx-common/iomux-v3.h>
#include <asm/imx-common/mxc_i2c.h>
#include <environment.h>
+#include <i2c.h>
#include <spl.h>
#include "gsc.h"
@@ -560,7 +561,7 @@ void spl_board_init(void)
/* return 1 if we wish to boot to uboot vs os (falcon mode) */
int spl_start_uboot(void)
{
- int ret = 1;
+ unsigned char ret = 1;
debug("%s\n", __func__);
#ifdef CONFIG_SPL_ENV_SUPPORT
@@ -569,6 +570,10 @@ int spl_start_uboot(void)
debug("boot_os=%s\n", getenv("boot_os"));
if (getenv_yesno("boot_os") == 1)
ret = 0;
+#else
+ /* use i2c-0:0x50:0x00 for falcon boot mode (0=linux, else uboot) */
+ i2c_set_bus_num(0);
+ gsc_i2c_read(0x50, 0x0, 1, &ret, 1);
#endif
debug("%s booting %s\n", __func__, ret ? "uboot" : "linux");
return ret;
OpenPOWER on IntegriCloud