public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build
@ 2016-05-23 15:25 Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 1/4] imx: ventana: config: remove redundant config Tim Harvey
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tim Harvey @ 2016-05-23 15:25 UTC (permalink / raw)
  To: u-boot

The SPL has recently grown in size and causes a buid failure for the Gateworks
Ventana board. This series addresses this by removing a couple of features
not necessary for Ventana as well as one simple cleanup.

Tim Harvey (4):
  imx: ventana: config: remove redundant config
  imx: ventana: gsc: remove dependence on env
  imx: ventana: use EEPROM register for falcon boot mode
  imx: ventana: remove SPL_EXT_SUPPORT

 board/gateworks/gw_ventana/README           | 17 ++++++-----------
 board/gateworks/gw_ventana/gsc.c            |  4 ++--
 board/gateworks/gw_ventana/gw_ventana_spl.c |  7 ++++++-
 include/configs/gw_ventana.h                |  5 +----
 4 files changed, 15 insertions(+), 18 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 1/4] imx: ventana: config: remove redundant config
  2016-05-23 15:25 [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Tim Harvey
@ 2016-05-23 15:25 ` Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 2/4] imx: ventana: gsc: remove dependence on env Tim Harvey
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tim Harvey @ 2016-05-23 15:25 UTC (permalink / raw)
  To: u-boot

remove redundant define that exists in mx6_common.h

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 include/configs/gw_ventana.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index e11629c..8d689f1 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -52,9 +52,6 @@
 #define CONFIG_DM_THERMAL
 #endif
 
-/* GPIO */
-#define CONFIG_MXC_GPIO
-
 /* Thermal */
 #define CONFIG_IMX_THERMAL
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 2/4] imx: ventana: gsc: remove dependence on env
  2016-05-23 15:25 [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 1/4] imx: ventana: config: remove redundant config Tim Harvey
@ 2016-05-23 15:25 ` Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 3/4] imx: ventana: use EEPROM register for falcon boot mode Tim Harvey
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tim Harvey @ 2016-05-23 15:25 UTC (permalink / raw)
  To: u-boot

remove dependence on getenv() by using global board info struct for model.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/gsc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c
index 3febd12..4f26bfd 100644
--- a/board/gateworks/gw_ventana/gsc.c
+++ b/board/gateworks/gw_ventana/gsc.c
@@ -11,6 +11,7 @@
 #include <i2c.h>
 #include <linux/ctype.h>
 
+#include "ventana_eeprom.h"
 #include "gsc.h"
 
 /*
@@ -79,7 +80,6 @@ static void read_hwmon(const char *name, uint reg, uint size)
 
 int gsc_info(int verbose)
 {
-	const char *model = getenv("model");
 	unsigned char buf[16];
 
 	i2c_set_bus_num(0);
@@ -112,7 +112,7 @@ int gsc_info(int verbose)
 	read_hwmon("VDD_2P5",  GSC_HWMON_VDD_2P5, 3);
 	read_hwmon("VDD_1P8",  GSC_HWMON_VDD_1P8, 3);
 	read_hwmon("VDD_IO2",  GSC_HWMON_VDD_IO2, 3);
-	switch (model[3]) {
+	switch (ventana_info.model[3]) {
 	case '1': /* GW51xx */
 		read_hwmon("VDD_IO3",  GSC_HWMON_VDD_IO4, 3); /* -C rev */
 		break;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 3/4] imx: ventana: use EEPROM register for falcon boot mode
  2016-05-23 15:25 [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 1/4] imx: ventana: config: remove redundant config Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 2/4] imx: ventana: gsc: remove dependence on env Tim Harvey
@ 2016-05-23 15:25 ` Tim Harvey
  2016-05-23 15:25 ` [U-Boot] [PATCH 4/4] imx: ventana: remove SPL_EXT_SUPPORT Tim Harvey
  2016-05-24 13:04 ` [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Stefano Babic
  4 siblings, 0 replies; 6+ messages in thread
From: Tim Harvey @ 2016-05-23 15:25 UTC (permalink / raw)
  To: u-boot

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>
---
 board/gateworks/gw_ventana/README           | 17 ++++++-----------
 board/gateworks/gw_ventana/gw_ventana_spl.c |  7 ++++++-
 include/configs/gw_ventana.h                |  1 -
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/board/gateworks/gw_ventana/README b/board/gateworks/gw_ventana/README
index 9418907..f3f8998 100644
--- a/board/gateworks/gw_ventana/README
+++ b/board/gateworks/gw_ventana/README
@@ -173,13 +173,8 @@ OS load time which defeats the purpose of Falcon mode in the first place.
 The SPL decides to boot either U-Boot (u-boot.img) or the OS (args + kernel)
 based on the return value of the spl_start_uboot() function. While often
 this can simply be the state of a GPIO based pushbutton or DIP switch, for
-Gateworks Ventana, we use the U-Boot environment 'boot_os' variable which if
-set to '1' will choose to boot the OS rather than U-Boot. While the choice
-of adding env support to the SPL adds a little bit of time to the boot
-process as well as (significant really) SPL code space this was deemed most
-flexible as within the large variety of Gateworks Ventana boards not all of
-them have a user pushbutton and that pushbutton may be configured as a hard
-reset per user configuration.
+Gateworks Ventana, we use an EEPROM register on i2c-0 at 0x50:0x00:
+set to '0' will choose to boot to U-Boot and otherwise it will boot to OS.
 
 To use Falcon mode it is required that you first 'prepare' the 'args' data
 that is stored on your boot medium along with the kernel (which can be any
@@ -235,8 +230,8 @@ using rootfs (ubi), kernel (uImage), and dtb from the network:
  # flash args (at 17MB)
  Ventana > nand erase.part args && nand write 18000000 args 100000
 
- # set boot_os env var to enable booting to Linux
- Ventana > setenv boot_os 1 && saveenv
+ # set i2c register 0x50:0x00=0 to boot to Linux
+ Ventana > i2c dev 0 && i2c mw 0x50 0x00.0 0 1
 
 Be sure to adjust 'bootargs' above to your OS needs (this will be different
 for various distros such as OpenWrt, Yocto, Android, etc). You can use the
@@ -309,8 +304,8 @@ out in U-Boot and use the following to enable Falcon mode:
  # write args 1MB data (0x800 sectors) to 1MB offset (0x800 sectors)
  Ventana > mmc write 18000000 0x800 0x800
 
- # set boot_os to enable falcon mode
- Ventana > setenv boot_os 1 && saveenv
+ # set i2c register 0x50:0x00=0 to boot to Linux
+ Ventana > i2c dev 0 && i2c mw 0x50 0x00.0 0 1
 
 Be sure to adjust 'bootargs' above to your OS needs (this will be different
 for various distros such as OpenWrt, Yocto, Android, etc). You can use the
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c
index 0a6ad47..ed42b86 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;
diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index 8d689f1..c8d3cb8 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -18,7 +18,6 @@
 /* Falcon Mode */
 #define CONFIG_CMD_SPL
 #define CONFIG_SPL_OS_BOOT
-#define CONFIG_SPL_ENV_SUPPORT
 #define CONFIG_SYS_SPL_ARGS_ADDR	0x18000000
 #define CONFIG_CMD_SPL_WRITE_SIZE	(128 * SZ_1K)
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 4/4] imx: ventana: remove SPL_EXT_SUPPORT
  2016-05-23 15:25 [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Tim Harvey
                   ` (2 preceding siblings ...)
  2016-05-23 15:25 ` [U-Boot] [PATCH 3/4] imx: ventana: use EEPROM register for falcon boot mode Tim Harvey
@ 2016-05-23 15:25 ` Tim Harvey
  2016-05-24 13:04 ` [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Stefano Babic
  4 siblings, 0 replies; 6+ messages in thread
From: Tim Harvey @ 2016-05-23 15:25 UTC (permalink / raw)
  To: u-boot

Remove SPL_EXT_SUPPORT to resolve build issue. It may be useful to bring
it back in the future after comparing its merits to storing the args/kernel
in fixed raw locations.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 include/configs/gw_ventana.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/gw_ventana.h b/include/configs/gw_ventana.h
index c8d3cb8..874bb04 100644
--- a/include/configs/gw_ventana.h
+++ b/include/configs/gw_ventana.h
@@ -32,6 +32,7 @@
 
 #include "imx6_spl.h"                  /* common IMX6 SPL configuration */
 #include "mx6_common.h"
+#undef CONFIG_SPL_EXT_SUPPORT
 
 #define CONFIG_MACH_TYPE	4520   /* Gateworks Ventana Platform */
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build
  2016-05-23 15:25 [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Tim Harvey
                   ` (3 preceding siblings ...)
  2016-05-23 15:25 ` [U-Boot] [PATCH 4/4] imx: ventana: remove SPL_EXT_SUPPORT Tim Harvey
@ 2016-05-24 13:04 ` Stefano Babic
  4 siblings, 0 replies; 6+ messages in thread
From: Stefano Babic @ 2016-05-24 13:04 UTC (permalink / raw)
  To: u-boot

On 23/05/2016 17:25, Tim Harvey wrote:
> The SPL has recently grown in size and causes a buid failure for the Gateworks
> Ventana board. This series addresses this by removing a couple of features
> not necessary for Ventana as well as one simple cleanup.
> 
> Tim Harvey (4):
>   imx: ventana: config: remove redundant config
>   imx: ventana: gsc: remove dependence on env
>   imx: ventana: use EEPROM register for falcon boot mode
>   imx: ventana: remove SPL_EXT_SUPPORT
> 
>  board/gateworks/gw_ventana/README           | 17 ++++++-----------
>  board/gateworks/gw_ventana/gsc.c            |  4 ++--
>  board/gateworks/gw_ventana/gw_ventana_spl.c |  7 ++++++-
>  include/configs/gw_ventana.h                |  5 +----
>  4 files changed, 15 insertions(+), 18 deletions(-)
> 

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic


-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-24 13:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-23 15:25 [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Tim Harvey
2016-05-23 15:25 ` [U-Boot] [PATCH 1/4] imx: ventana: config: remove redundant config Tim Harvey
2016-05-23 15:25 ` [U-Boot] [PATCH 2/4] imx: ventana: gsc: remove dependence on env Tim Harvey
2016-05-23 15:25 ` [U-Boot] [PATCH 3/4] imx: ventana: use EEPROM register for falcon boot mode Tim Harvey
2016-05-23 15:25 ` [U-Boot] [PATCH 4/4] imx: ventana: remove SPL_EXT_SUPPORT Tim Harvey
2016-05-24 13:04 ` [U-Boot] [PATCH 0/4] Fix Gateworks Ventana build Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox