public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 12/14] imx: ventana: add support for GW5901/GW5902
Date: Mon,  4 Feb 2019 13:10:58 -0800	[thread overview]
Message-ID: <20190204211100.11004-13-tharvey@gateworks.com> (raw)
In-Reply-To: <20190204211100.11004-1-tharvey@gateworks.com>

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c         | 133 ++++++++++++++++++++
 board/gateworks/gw_ventana/eeprom.c         |   6 +-
 board/gateworks/gw_ventana/gw_ventana.c     |   6 +
 board/gateworks/gw_ventana/ventana_eeprom.h |   2 +
 4 files changed, 146 insertions(+), 1 deletion(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index c1e2e8a506..8934f213dd 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -389,6 +389,51 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	IOMUX_PADS(PAD_DISP0_DAT5__GPIO4_IO26 | DIO_PAD_CFG),
 };
 
+static iomux_v3_cfg_t const gw5901_gpio_pads[] = {
+	/* MX6_LOCLED# */
+	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
+	/* ETH1_EN */
+	IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | DIO_PAD_CFG),
+	/* CAN_STBY */
+	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
+	/* PCI_RST# */
+	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
+	/* PMIC reset */
+	IOMUX_PADS(PAD_DISP0_DAT8__WDOG1_B | DIO_PAD_CFG),
+	/* COM_CFGA/B/C/D */
+	IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14 | DIO_PAD_CFG),
+	IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15 | DIO_PAD_CFG),
+	IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16 | DIO_PAD_CFG),
+	IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG),
+	/* ETI_IRQ# */
+	IOMUX_PADS(PAD_GPIO_5__GPIO1_IO05 | DIO_PAD_CFG),
+	/* DIO_IRQ# */
+	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
+	/* FIBER_SIGDET */
+	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
+};
+
+static iomux_v3_cfg_t const gw5902_gpio_pads[] = {
+	/* MX6_LOCLED# */
+	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
+	/* CAN1_STBY */
+	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
+	/* CAN2_STBY */
+	IOMUX_PADS(PAD_SD3_CLK__GPIO7_IO03 | DIO_PAD_CFG),
+	/* UART1_EN# */
+	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
+	/* PCI_RST# */
+	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG),
+	/* 5V_UVLO */
+	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
+	/* ETI_IRQ# */
+	IOMUX_PADS(PAD_GPIO_5__GPIO1_IO05 | DIO_PAD_CFG),
+	/* DIO_IRQ# */
+	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
+	/* USBOTG_PEN */
+	IOMUX_PADS(PAD_EIM_D23__GPIO3_IO23 | DIO_PAD_CFG),
+};
+
 static iomux_v3_cfg_t const gw5903_gpio_pads[] = {
 	/* BKLT_12VEN */
 	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
@@ -741,6 +786,60 @@ struct dio_cfg gw560x_dio[] = {
 	},
 };
 
+struct dio_cfg gw5901_dio[] = {
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14) },
+		IMX_GPIO_NR(5, 14),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15) },
+		IMX_GPIO_NR(5, 15),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16) },
+		IMX_GPIO_NR(5, 16),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17) },
+		IMX_GPIO_NR(5, 17),
+		{ 0, 0 },
+		0
+	},
+};
+
+struct dio_cfg gw5902_dio[] = {
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14) },
+		IMX_GPIO_NR(5, 14),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15) },
+		IMX_GPIO_NR(5, 15),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16) },
+		IMX_GPIO_NR(5, 16),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17) },
+		IMX_GPIO_NR(5, 17),
+		{ 0, 0 },
+		0
+	},
+};
+
 struct dio_cfg gw5903_dio[] = {
 };
 
@@ -1041,6 +1140,32 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mmc_cd = IMX_GPIO_NR(7, 0),
 	},
 
+	/* GW5901 */
+	{
+		.gpio_pads = gw5901_gpio_pads,
+		.num_pads = ARRAY_SIZE(gw5901_gpio_pads)/2,
+		.dio_cfg = gw5901_dio,
+		.leds = {
+			IMX_GPIO_NR(4, 15),
+		},
+		.pcie_rst = IMX_GPIO_NR(1, 29),
+		.nand = true,
+	},
+
+	/* GW5902 */
+	{
+		.gpio_pads = gw5902_gpio_pads,
+		.num_pads = ARRAY_SIZE(gw5902_gpio_pads)/2,
+		.dio_cfg = gw5902_dio,
+		.leds = {
+			IMX_GPIO_NR(4, 15),
+		},
+		.pcie_rst = IMX_GPIO_NR(1, 0),
+		.rs232_en = GP_RS232_EN,
+		.otgpwr_en = IMX_GPIO_NR(3, 23),
+		.nand = true,
+	},
+
 	/* GW5903 */
 	{
 		.gpio_pads = gw5903_gpio_pads,
@@ -1278,6 +1403,14 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 		gpio_request(IMX_GPIO_NR(4, 26), "12p0_en");
 		gpio_direction_output(IMX_GPIO_NR(4, 26), 1);
 		break;
+	case GW5901:
+		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 2), "can_stby", 0);
+		break;
+	case GW5902:
+		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 2), "can1_stby", 0);
+		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 3), "can2_stby", 0);
+		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 12), "5P0V_EN", 1);
+		break;
 	case GW5903:
 		gpio_request(IMX_GPIO_NR(3, 31) , "usbh1-ehci_pwr");
 		gpio_direction_output(IMX_GPIO_NR(3, 31), 1);
diff --git a/board/gateworks/gw_ventana/eeprom.c b/board/gateworks/gw_ventana/eeprom.c
index bcd634920c..ee227320c0 100644
--- a/board/gateworks/gw_ventana/eeprom.c
+++ b/board/gateworks/gw_ventana/eeprom.c
@@ -97,7 +97,11 @@ read_eeprom(int bus, struct ventana_board_info *info)
 			type = GW560x;
 		break;
 	case '9':
-		if (info->model[4] == '0' && info->model[5] == '3')
+		if (info->model[4] == '0' && info->model[5] == '1')
+			type = GW5901;
+		else if (info->model[4] == '0' && info->model[5] == '2')
+			type = GW5902;
+		else if (info->model[4] == '0' && info->model[5] == '3')
 			type = GW5903;
 		else if (info->model[4] == '0' && info->model[5] == '4')
 			type = GW5904;
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index da9f5d89be..0b2258e87a 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -1313,6 +1313,12 @@ int ft_board_setup(void *blob, bd_t *bd)
 		if (rev < 'C')
 			ft_board_wdog_fixup(blob, WDOG1_PATH);
 		break;
+	case GW5901:
+	case GW5902:
+		/* GW5901/GW5901 revB adds WDOG1_B as an external reset */
+		if (rev < 'B')
+			ft_board_wdog_fixup(blob, WDOG1_PATH);
+		break;
 	}
 
 	/* Configure DIO */
diff --git a/board/gateworks/gw_ventana/ventana_eeprom.h b/board/gateworks/gw_ventana/ventana_eeprom.h
index 3e24287fe7..4fa085b320 100644
--- a/board/gateworks/gw_ventana/ventana_eeprom.h
+++ b/board/gateworks/gw_ventana/ventana_eeprom.h
@@ -112,6 +112,8 @@ enum {
 	GW552x,
 	GW553x,
 	GW560x,
+	GW5901,
+	GW5902,
 	GW5903,
 	GW5904,
 	GW5905,
-- 
2.17.1

  parent reply	other threads:[~2019-02-04 21:10 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 21:10 [U-Boot] [PATCH 00/14] Gateworks Ventana updates Tim Harvey
2019-02-04 21:10 ` [U-Boot] [PATCH 01/14] imx: ventana: mv88e61xx change LED configuration Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 02/14] imx: ventana: do not iomux UART1 Tim Harvey
2019-02-16 10:35   ` [U-Boot] [U-Boot,02/14] " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 03/14] imx: ventana: remove setup of I2C3 from SPL Tim Harvey
2019-02-16 10:35   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 04/14] imx: ventana: add support for GW5905 Tim Harvey
2019-02-16 10:35   ` [U-Boot] [U-Boot,04/14] " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 05/14] imx: ventana: add support for Z101WX01 LVDS display Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 06/14] imx: ventana: skip nand init for nandless boards Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 07/14] imx: ventana: add i2c detect for all LVDS displays Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 08/14] imx: ventana: add support for GW5906 Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot,08/14] " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 09/14] imx: ventana: add support for GW5907 Tim Harvey
2019-02-16 10:45   ` [U-Boot] [U-Boot,09/14] " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 10/14] imx: ventana: add support for GW5908 Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot,10/14] " sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 11/14] imx: ventana: add support for GW5909 Tim Harvey
2019-02-16 10:35   ` [U-Boot] [U-Boot,11/14] " sbabic at denx.de
2019-02-04 21:10 ` Tim Harvey [this message]
2019-02-16 10:35   ` [U-Boot] [U-Boot, 12/14] imx: ventana: add support for GW5901/GW5902 sbabic at denx.de
2019-02-04 21:10 ` [U-Boot] [PATCH 13/14] imx: ventana: gw5904/gw5909: disable RS485 Tim Harvey
2019-02-16 10:35   ` [U-Boot] [U-Boot, " sbabic at denx.de
2019-02-04 21:11 ` [U-Boot] [PATCH 14/14] imx: ventana: fix usage of dt paths with leading 0s (Linux 4.15+) Tim Harvey
2019-02-16 10:26   ` [U-Boot] [U-Boot, " sbabic at denx.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190204211100.11004-13-tharvey@gateworks.com \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox