All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support
@ 2021-07-24 17:40 Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 02/16] imx: ventana: move wdog/uhs-i board/revision dt fixups Tim Harvey
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

EEPROM bits no longer indicate support for NAND so instead use
hard-coded value from board config struct.

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

diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 468fb093b7..dc3300f7b7 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -1017,7 +1017,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 		return 0;
 	}
 
-	if (test_bit(EECONFIG_NAND, info->config)) {
+	if (gpio_cfg[board_type].nand) {
 		/* Update partition nodes using info from mtdparts env var */
 		puts("   Updating MTD partitions...\n");
 		fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
-- 
2.17.1


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

* [RESEND PATCH 02/16] imx: ventana: move wdog/uhs-i board/revision dt fixups
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 03/16] imx: ventana: remove nand field from common ventana struct Tim Harvey
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

Move board/revision specific dt fixups for WDOG and UHS-I features
so that we can call them early for U-Boot control dt as well.

Additionally drop a deprected non-mainline dt-prop fixup regarding
HDMI input format.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c         | 131 ++++++++++++++++
 board/gateworks/gw_ventana/common.h         |   2 +
 board/gateworks/gw_ventana/gw_ventana.c     | 158 +-------------------
 board/gateworks/gw_ventana/gw_ventana_spl.c |   7 +-
 4 files changed, 141 insertions(+), 157 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index c07eb627a2..f9ee167458 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -1697,6 +1697,137 @@ void setup_pmic(void)
 	}
 }
 
+#include <fdt_support.h>
+#define WDOG1_ADDR      0x20bc000
+#define WDOG2_ADDR      0x20c0000
+#define GPIO3_ADDR      0x20a4000
+#define USDHC3_ADDR     0x2198000
+
+static void ft_board_wdog_fixup(void *blob, phys_addr_t addr)
+{
+	int off = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-wdt", addr);
+
+	if (off) {
+		fdt_delprop(blob, off, "ext-reset-output");
+		fdt_delprop(blob, off, "fsl,ext-reset-output");
+	}
+}
+
+void ft_early_fixup(void *blob, int board_type)
+{
+	struct ventana_board_info *info = &ventana_info;
+	char rev = 0;
+	int i;
+
+	/* determine board revision */
+	for (i = sizeof(ventana_info.model) - 1; i > 0; i--) {
+		if (ventana_info.model[i] >= 'A') {
+			rev = ventana_info.model[i];
+			break;
+		}
+	}
+
+	/*
+	 * Board model specific fixups
+	 */
+	switch (board_type) {
+	case GW51xx:
+		/*
+		 * disable wdog node for GW51xx-A/B to work around
+		 * errata causing wdog timer to be unreliable.
+		 */
+		if (rev >= 'A' && rev < 'C') {
+			i = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-wdt",
+							  WDOG1_ADDR);
+			if (i)
+				fdt_status_disabled(blob, i);
+		}
+
+		/* GW51xx-E adds WDOG1_B external reset */
+		if (rev < 'E')
+			ft_board_wdog_fixup(blob, WDOG1_ADDR);
+		break;
+
+	case GW52xx:
+		/* GW522x Uses GPIO3_IO23 instead of GPIO1_IO29 */
+		if (info->model[4] == '2') {
+			u32 handle = 0;
+			u32 *range = NULL;
+
+			i = fdt_node_offset_by_compatible(blob, -1,
+							  "fsl,imx6q-pcie");
+			if (i)
+				range = (u32 *)fdt_getprop(blob, i,
+							   "reset-gpio", NULL);
+
+			if (range) {
+				i = fdt_node_offset_by_compat_reg(blob,
+					"fsl,imx6q-gpio", GPIO3_ADDR);
+				if (i)
+					handle = fdt_get_phandle(blob, i);
+				if (handle) {
+					range[0] = cpu_to_fdt32(handle);
+					range[1] = cpu_to_fdt32(23);
+				}
+			}
+
+			/* these have broken usd_vsel */
+			if (strstr((const char *)info->model, "SP318-B") ||
+			    strstr((const char *)info->model, "SP331-B"))
+				gpio_cfg[board_type].usd_vsel = 0;
+
+			/* GW522x-B adds WDOG1_B external reset */
+			if (rev < 'B')
+				ft_board_wdog_fixup(blob, WDOG1_ADDR);
+		}
+
+		/* GW520x-E adds WDOG1_B external reset */
+		else if (info->model[4] == '0' && rev < 'E')
+			ft_board_wdog_fixup(blob, WDOG1_ADDR);
+		break;
+
+	case GW53xx:
+		/* GW53xx-E adds WDOG1_B external reset */
+		if (rev < 'E')
+			ft_board_wdog_fixup(blob, WDOG1_ADDR);
+		break;
+
+	case GW54xx:
+		/*
+		 * disable serial2 node for GW54xx for compatibility with older
+		 * 3.10.x kernel that improperly had this node enabled in the DT
+		 */
+		fdt_set_status_by_alias(blob, "serial2", FDT_STATUS_DISABLED,
+					0);
+
+		/* GW54xx-E adds WDOG2_B external reset */
+		if (rev < 'E')
+			ft_board_wdog_fixup(blob, WDOG2_ADDR);
+		break;
+
+	case GW551x:
+		/* GW551x-C adds WDOG1_B external reset */
+		if (rev < 'C')
+			ft_board_wdog_fixup(blob, WDOG1_ADDR);
+		break;
+	case GW5901:
+	case GW5902:
+		/* GW5901/GW5901 revB adds WDOG1_B as an external reset */
+		if (rev < 'B')
+			ft_board_wdog_fixup(blob, WDOG1_ADDR);
+		break;
+	}
+
+	/* remove no-1-8-v if UHS-I support is present */
+	if (gpio_cfg[board_type].usd_vsel) {
+		debug("Enabling UHS-I support\n");
+		i = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-usdhc",
+						  USDHC3_ADDR);
+		if (i)
+			fdt_delprop(blob, i, "no-1-8-v");
+	}
+}
+
 #ifdef CONFIG_FSL_ESDHC_IMX
 static struct fsl_esdhc_cfg usdhc_cfg[2];
 
diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h
index 813f7d9f56..8f226d109b 100644
--- a/board/gateworks/gw_ventana/common.h
+++ b/board/gateworks/gw_ventana/common.h
@@ -93,5 +93,7 @@ void setup_pmic(void);
 void setup_iomux_gpio(int board, struct ventana_board_info *);
 /* late setup of GPIO (configuration per baseboard and env) */
 void setup_board_gpio(int board, struct ventana_board_info *);
+/* early model/revision ft fixups */
+void ft_early_fixup(void *fdt, int board_type);
 
 #endif /* #ifndef _GWVENTANA_COMMON_H_ */
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index dc3300f7b7..7f43e1b620 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -967,16 +967,6 @@ void ft_board_pci_fixup(void *blob, struct bd_info *bd)
 }
 #endif /* if defined(CONFIG_CMD_PCI) */
 
-void ft_board_wdog_fixup(void *blob, phys_addr_t addr)
-{
-	int off = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-wdt", addr);
-
-	if (off) {
-		fdt_delprop(blob, off, "ext-reset-output");
-		fdt_delprop(blob, off, "fsl,ext-reset-output");
-	}
-}
-
 /*
  * called prior to booting kernel or by 'fdt boardsetup' command
  *
@@ -986,10 +976,6 @@ void ft_board_wdog_fixup(void *blob, phys_addr_t addr)
  *  - board (full model from EEPROM)
  *  - peripherals removed from DTB if not loaded on board (per EEPROM config)
  */
-#define WDOG1_ADDR	0x20bc000
-#define WDOG2_ADDR	0x20c0000
-#define GPIO3_ADDR	0x20a4000
-#define USDHC3_ADDR	0x2198000
 #define PWM0_ADDR	0x2080000
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
@@ -1043,139 +1029,8 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	/* set desired digital video capture format */
 	ft_sethdmiinfmt(blob, env_get("hdmiinfmt"));
 
-	/*
-	 * Board model specific fixups
-	 */
-	switch (board_type) {
-	case GW51xx:
-		/*
-		 * disable wdog node for GW51xx-A/B to work around
-		 * errata causing wdog timer to be unreliable.
-		 */
-		if (rev >= 'A' && rev < 'C') {
-			i = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-wdt",
-							  WDOG1_ADDR);
-			if (i)
-				fdt_status_disabled(blob, i);
-		}
-
-		/* GW51xx-E adds WDOG1_B external reset */
-		if (rev < 'E')
-			ft_board_wdog_fixup(blob, WDOG1_ADDR);
-		break;
-
-	case GW52xx:
-		/* GW522x Uses GPIO3_IO23 instead of GPIO1_IO29 */
-		if (info->model[4] == '2') {
-			u32 handle = 0;
-			u32 *range = NULL;
-
-			i = fdt_node_offset_by_compatible(blob, -1,
-							  "fsl,imx6q-pcie");
-			if (i)
-				range = (u32 *)fdt_getprop(blob, i,
-							   "reset-gpio", NULL);
-
-			if (range) {
-				i = fdt_node_offset_by_compat_reg(blob,
-					"fsl,imx6q-gpio", GPIO3_ADDR);
-				if (i)
-					handle = fdt_get_phandle(blob, i);
-				if (handle) {
-					range[0] = cpu_to_fdt32(handle);
-					range[1] = cpu_to_fdt32(23);
-				}
-			}
-
-			/* these have broken usd_vsel */
-			if (strstr((const char *)info->model, "SP318-B") ||
-			    strstr((const char *)info->model, "SP331-B"))
-				gpio_cfg[board_type].usd_vsel = 0;
-
-			/* GW522x-B adds WDOG1_B external reset */
-			if (rev < 'B')
-				ft_board_wdog_fixup(blob, WDOG1_ADDR);
-		}
-
-		/* GW520x-E adds WDOG1_B external reset */
-		else if (info->model[4] == '0' && rev < 'E')
-			ft_board_wdog_fixup(blob, WDOG1_ADDR);
-		break;
-
-	case GW53xx:
-		/* GW53xx-E adds WDOG1_B external reset */
-		if (rev < 'E')
-			ft_board_wdog_fixup(blob, WDOG1_ADDR);
-		break;
-
-	case GW54xx:
-		/*
-		 * disable serial2 node for GW54xx for compatibility with older
-		 * 3.10.x kernel that improperly had this node enabled in the DT
-		 */
-		fdt_set_status_by_alias(blob, "serial2", FDT_STATUS_DISABLED,
-					0);
-
-		/* GW54xx-E adds WDOG2_B external reset */
-		if (rev < 'E')
-			ft_board_wdog_fixup(blob, WDOG2_ADDR);
-		break;
-
-	case GW551x:
-		/*
-		 * isolate CSI0_DATA_EN for GW551x-A to work around errata
-		 * causing non functional digital video in (it is not hooked up)
-		 */
-		if (rev == 'A') {
-			u32 *range = NULL;
-			int len;
-			const u32 *handle = NULL;
-
-			i = fdt_node_offset_by_compatible(blob, -1,
-						"fsl,imx-tda1997x-video");
-			if (i)
-				handle = fdt_getprop(blob, i, "pinctrl-0",
-						     NULL);
-			if (handle)
-				i = fdt_node_offset_by_phandle(blob,
-							fdt32_to_cpu(*handle));
-			if (i)
-				range = (u32 *)fdt_getprop(blob, i, "fsl,pins",
-							   &len);
-			if (range) {
-				len /= sizeof(u32);
-				for (i = 0; i < len; i += 6) {
-					u32 mux_reg = fdt32_to_cpu(range[i+0]);
-					u32 conf_reg = fdt32_to_cpu(range[i+1]);
-					/* mux PAD_CSI0_DATA_EN to GPIO */
-					if (is_cpu_type(MXC_CPU_MX6Q) &&
-					    mux_reg == 0x260 &&
-					    conf_reg == 0x630)
-						range[i+3] = cpu_to_fdt32(0x5);
-					else if (!is_cpu_type(MXC_CPU_MX6Q) &&
-						 mux_reg == 0x08c &&
-						 conf_reg == 0x3a0)
-						range[i+3] = cpu_to_fdt32(0x5);
-				}
-				fdt_setprop_inplace(blob, i, "fsl,pins", range,
-						    len);
-			}
-
-			/* set BT656 video format */
-			ft_sethdmiinfmt(blob, "yuv422bt656");
-		}
-
-		/* GW551x-C adds WDOG1_B external reset */
-		if (rev < 'C')
-			ft_board_wdog_fixup(blob, WDOG1_ADDR);
-		break;
-	case GW5901:
-	case GW5902:
-		/* GW5901/GW5901 revB adds WDOG1_B as an external reset */
-		if (rev < 'B')
-			ft_board_wdog_fixup(blob, WDOG1_ADDR);
-		break;
-	}
+	/* early board/revision ft fixups */
+	ft_early_fixup(blob, board_type);
 
 	/* Configure DIO */
 	for (i = 0; i < gpio_cfg[board_type].dio_num; i++) {
@@ -1201,15 +1056,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 		}
 	}
 
-	/* remove no-1-8-v if UHS-I support is present */
-	if (gpio_cfg[board_type].usd_vsel) {
-		debug("Enabling UHS-I support\n");
-		i = fdt_node_offset_by_compat_reg(blob, "fsl,imx6q-usdhc",
-						  USDHC3_ADDR);
-		if (i)
-			fdt_delprop(blob, i, "no-1-8-v");
-	}
-
 #if defined(CONFIG_CMD_PCI)
 	if (!env_get("nopcifixup"))
 		ft_board_pci_fixup(blob, bd);
diff --git a/board/gateworks/gw_ventana/gw_ventana_spl.c b/board/gateworks/gw_ventana/gw_ventana_spl.c
index a4f64395a1..5a69aff671 100644
--- a/board/gateworks/gw_ventana/gw_ventana_spl.c
+++ b/board/gateworks/gw_ventana/gw_ventana_spl.c
@@ -729,10 +729,10 @@ void board_boot_order(u32 *spl_boot_list)
 
 /* called from board_init_r after gd setup if CONFIG_SPL_BOARD_INIT defined */
 /* its our chance to print info about boot device */
+static int board_type;
 void spl_board_init(void)
 {
 	u32 boot_device;
-	int board_type;
 
 	/* determine boot device from SRC_SBMR1 (BOOT_CFG[4:1]) or SRC_GPR9 */
 	boot_device = spl_boot_device();
@@ -785,3 +785,8 @@ int spl_start_uboot(void)
 	return ret;
 }
 #endif
+
+void spl_perform_fixups(struct spl_image_info *spl_image)
+{
+	ft_early_fixup(spl_image->fdt_addr, board_type);
+}
-- 
2.17.1


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

* [RESEND PATCH 03/16] imx: ventana: remove nand field from common ventana struct
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 02/16] imx: ventana: move wdog/uhs-i board/revision dt fixups Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 04/16] imx: ventana: replace hard-coded LED config with dt based config Tim Harvey
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

NAND fdt fixups can be performed without knowing if NAND is present.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c     | 11 -----------
 board/gateworks/gw_ventana/common.h     |  1 -
 board/gateworks/gw_ventana/gw_ventana.c | 10 ++++------
 3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index f9ee167458..328fdd3b29 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -989,7 +989,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.gps_shdn = IMX_GPIO_NR(1, 2),
 		.vidin_en = IMX_GPIO_NR(5, 20),
 		.wdis = IMX_GPIO_NR(7, 12),
-		.nand = true,
 	},
 
 	/* GW52xx */
@@ -1014,7 +1013,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.rs232_en = GP_RS232_EN,
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
-		.nand = true,
 	},
 
 	/* GW53xx */
@@ -1038,7 +1036,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.rs232_en = GP_RS232_EN,
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
-		.nand = true,
 	},
 
 	/* GW54xx */
@@ -1064,7 +1061,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.rs232_en = GP_RS232_EN,
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
-		.nand = true,
 	},
 
 	/* GW551x */
@@ -1078,7 +1074,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.wdis = IMX_GPIO_NR(7, 12),
-		.nand = true,
 	},
 
 	/* GW552x */
@@ -1096,7 +1091,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.usb_sel = IMX_GPIO_NR(1, 7),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
-		.nand = true,
 	},
 
 	/* GW553x */
@@ -1114,7 +1108,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.wdis = IMX_GPIO_NR(7, 12),
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
-		.nand = true,
 	},
 
 	/* GW560x */
@@ -1146,7 +1139,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 			IMX_GPIO_NR(4, 15),
 		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
-		.nand = true,
 	},
 
 	/* GW5902 */
@@ -1159,7 +1151,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.rs232_en = GP_RS232_EN,
-		.nand = true,
 	},
 
 	/* GW5903 */
@@ -1216,7 +1207,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.usb_sel = IMX_GPIO_NR(1, 7),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
-		.nand = true,
 	},
 
 	/* GW5907 */
@@ -1231,7 +1221,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.wdis = IMX_GPIO_NR(7, 12),
-		.nand = true,
 	},
 
 	/* GW5908 */
diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h
index 8f226d109b..4b2aaf0fda 100644
--- a/board/gateworks/gw_ventana/common.h
+++ b/board/gateworks/gw_ventana/common.h
@@ -78,7 +78,6 @@ struct ventana {
 	int mmc_cd;
 	/* various features */
 	bool usd_vsel;
-	bool nand;
 };
 
 extern struct ventana gpio_cfg[GW_UNKNOWN];
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 7f43e1b620..77a2f2ca4b 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -981,7 +981,7 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 {
 	struct ventana_board_info *info = &ventana_info;
 	struct ventana_eeprom_config *cfg;
-	static const struct node_info nodes[] = {
+	static const struct node_info nand_nodes[] = {
 		{ "sst,w25q256",          MTD_DEV_TYPE_NOR, },  /* SPI flash */
 		{ "fsl,imx6q-gpmi-nand",  MTD_DEV_TYPE_NAND, }, /* NAND flash */
 	};
@@ -1003,11 +1003,9 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 		return 0;
 	}
 
-	if (gpio_cfg[board_type].nand) {
-		/* Update partition nodes using info from mtdparts env var */
-		puts("   Updating MTD partitions...\n");
-		fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
-	}
+	/* Update MTD partition nodes using info from mtdparts env var */
+	puts("   Updating MTD partitions...\n");
+	fdt_fixup_mtdparts(blob, nand_nodes, ARRAY_SIZE(nand_nodes));
 
 	/* Update display timings from display env var */
 	if (display) {
-- 
2.17.1


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

* [RESEND PATCH 04/16] imx: ventana: replace hard-coded LED config with dt based config
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 02/16] imx: ventana: move wdog/uhs-i board/revision dt fixups Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 03/16] imx: ventana: remove nand field from common ventana struct Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 05/16] imx: ventana: remove hard-coded USB HUBRST# gpio config Tim Harvey
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

Use device-tree LED config instead of hard-coded board-specific config.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c | 149 ----------------------------
 board/gateworks/gw_ventana/common.h |   1 -
 configs/gwventana_emmc_defconfig    |   3 +
 configs/gwventana_gw5904_defconfig  |   3 +
 configs/gwventana_nand_defconfig    |   3 +
 5 files changed, 9 insertions(+), 150 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 328fdd3b29..729f612f81 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -178,10 +178,6 @@ void setup_ventana_i2c(int i2c)
  * Baseboard specific GPIO
  */
 static iomux_v3_cfg_t const gw51xx_gpio_pads[] = {
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -204,18 +200,12 @@ static iomux_v3_cfg_t const gw52xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
 	/* MSATA_EN */
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* GPS_SHDN */
 	IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG),
 	/* USBOTG_SEL */
@@ -243,12 +233,6 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* USB_HUBRST# */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -276,12 +260,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* USB_HUBRST# */
 	IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16 | DIO_PAD_CFG),
 	/* MIPI_DIO */
@@ -307,8 +285,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 static iomux_v3_cfg_t const gw551x_gpio_pads[] = {
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* PANLED# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
 	/* PCI_RST# */
 	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -322,12 +298,6 @@ static iomux_v3_cfg_t const gw552x_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
 	/* USB_HUBRST# */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* PCI_RST# */
 	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
 	/* MX6_DIO[4:9] */
@@ -348,10 +318,6 @@ static iomux_v3_cfg_t const gw552x_gpio_pads[] = {
 static iomux_v3_cfg_t const gw553x_gpio_pads[] = {
 	/* SD3_VSELECT */
 	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL2__GPIO4_IO10 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW2__GPIO4_IO11 | DIO_PAD_CFG),
 	/* VID_PWR */
 	IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG),
 	/* PCI_RST# */
@@ -367,12 +333,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* USB_HUBRST# */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -394,8 +354,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 };
 
 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 */
@@ -418,8 +376,6 @@ static iomux_v3_cfg_t const gw5901_gpio_pads[] = {
 };
 
 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 */
@@ -459,8 +415,6 @@ static iomux_v3_cfg_t const gw5903_gpio_pads[] = {
 	IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG),
 	/* UART1_TEN# */
 	IOMUX_PADS(PAD_CSI0_DAT12__GPIO5_IO30 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
 	/* LVDS_BKLEN # */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 	/* RGMII_PDWN# */
@@ -474,12 +428,6 @@ static iomux_v3_cfg_t const gw5903_gpio_pads[] = {
 static iomux_v3_cfg_t const gw5904_gpio_pads[] = {
 	/* USB_HUBRST# */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* PANLEDG# */
-	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
-	/* PANLEDR# */
-	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -511,8 +459,6 @@ static iomux_v3_cfg_t const gw5904_gpio_pads[] = {
 static iomux_v3_cfg_t const gw5905_gpio_pads[] = {
 	/* EMMY_PDN# */
 	IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03 | DIO_PAD_CFG),
-	/* MX6_LOCLED# */
-	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
 	/* MIPI_RST */
 	IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | DIO_PAD_CFG),
 	/* MIPI_PWDN */
@@ -527,12 +473,6 @@ static iomux_v3_cfg_t const gw5905_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_18__GPIO7_IO13 | DIO_PAD_CFG),
 	/* SPK_SHDN# */
 	IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG),
-	/* LOCLED# */
-	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
-	/* FLASH LED1 */
-	IOMUX_PADS(PAD_DISP0_DAT11__GPIO5_IO05 | DIO_PAD_CFG),
-	/* FLASH LED2 */
-	IOMUX_PADS(PAD_DISP0_DAT12__GPIO5_IO06 | DIO_PAD_CFG),
 	/* DECT_RST# */
 	IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14 | DIO_PAD_CFG),
 	/* USBH1_PEN (EHCI) */
@@ -959,11 +899,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2,
 		.dio_cfg = gw54xx_dio,
 		.dio_num = ARRAY_SIZE(gw54xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 10),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(4, 7),
 		.mezz_irq = IMX_GPIO_NR(4, 9),
@@ -979,10 +914,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2,
 		.dio_cfg = gw51xx_dio,
 		.dio_num = ARRAY_SIZE(gw51xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 10),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -997,11 +928,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw52xx_gpio_pads)/2,
 		.dio_cfg = gw52xx_dio,
 		.dio_num = ARRAY_SIZE(gw52xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1021,11 +947,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2,
 		.dio_cfg = gw53xx_dio,
 		.dio_num = ARRAY_SIZE(gw53xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1044,11 +965,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2,
 		.dio_cfg = gw54xx_dio,
 		.dio_num = ARRAY_SIZE(gw54xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1069,9 +985,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw551x_gpio_pads)/2,
 		.dio_cfg = gw551x_dio,
 		.dio_num = ARRAY_SIZE(gw551x_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 7),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.wdis = IMX_GPIO_NR(7, 12),
 	},
@@ -1082,11 +995,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2,
 		.dio_cfg = gw552x_dio,
 		.dio_num = ARRAY_SIZE(gw552x_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.usb_sel = IMX_GPIO_NR(1, 7),
 		.wdis = IMX_GPIO_NR(7, 12),
@@ -1099,10 +1007,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw553x_gpio_pads)/2,
 		.dio_cfg = gw553x_dio,
 		.dio_num = ARRAY_SIZE(gw553x_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 10),
-			IMX_GPIO_NR(4, 11),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.vidin_en = IMX_GPIO_NR(5, 20),
 		.wdis = IMX_GPIO_NR(7, 12),
@@ -1116,11 +1020,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw560x_gpio_pads)/2,
 		.dio_cfg = gw560x_dio,
 		.dio_num = ARRAY_SIZE(gw560x_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(4, 31),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1135,9 +1034,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.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),
 	},
 
@@ -1146,9 +1042,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.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,
 	},
@@ -1159,9 +1052,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw5903_gpio_pads)/2,
 		.dio_cfg = gw5903_dio,
 		.dio_num = ARRAY_SIZE(gw5903_dio),
-		.leds = {
-			IMX_GPIO_NR(6, 14),
-		},
 		.mmc_cd = IMX_GPIO_NR(6, 11),
 	},
 
@@ -1171,11 +1061,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2,
 		.dio_cfg = gw5904_dio,
 		.dio_num = ARRAY_SIZE(gw5904_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1185,9 +1070,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 	{
 		.gpio_pads = gw5905_gpio_pads,
 		.num_pads = ARRAY_SIZE(gw5905_gpio_pads)/2,
-		.leds = {
-			IMX_GPIO_NR(6, 14),
-		},
 		.pcie_rst = IMX_GPIO_NR(7, 11),
 		.wdis = IMX_GPIO_NR(7, 13),
 	},
@@ -1198,11 +1080,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2,
 		.dio_cfg = gw5906_dio,
 		.dio_num = ARRAY_SIZE(gw5906_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.usb_sel = IMX_GPIO_NR(1, 7),
 		.wdis = IMX_GPIO_NR(7, 12),
@@ -1215,10 +1092,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2,
 		.dio_cfg = gw51xx_dio,
 		.dio_num = ARRAY_SIZE(gw51xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 10),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.wdis = IMX_GPIO_NR(7, 12),
 	},
@@ -1229,11 +1102,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2,
 		.dio_cfg = gw53xx_dio,
 		.dio_num = ARRAY_SIZE(gw53xx_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1250,11 +1118,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2,
 		.dio_cfg = gw5904_dio,
 		.dio_num = ARRAY_SIZE(gw5904_dio),
-		.leds = {
-			IMX_GPIO_NR(4, 6),
-			IMX_GPIO_NR(4, 7),
-			IMX_GPIO_NR(4, 15),
-		},
 		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
@@ -1269,8 +1132,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 	gpio_direction_input(gpio);
 void setup_iomux_gpio(int board, struct ventana_board_info *info)
 {
-	int i;
-
 	if (board >= GW_UNKNOWN)
 		return;
 
@@ -1292,16 +1153,6 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 	gpio_request(gpio_cfg[board].pcie_rst, "pci_rst#");
 	gpio_direction_output(gpio_cfg[board].pcie_rst, 0);
 
-	/* turn off (active-high) user LED's */
-	for (i = 0; i < ARRAY_SIZE(gpio_cfg[board].leds); i++) {
-		char name[16];
-		if (gpio_cfg[board].leds[i]) {
-			sprintf(name, "led_user%d", i);
-			gpio_request(gpio_cfg[board].leds[i], name);
-			gpio_direction_output(gpio_cfg[board].leds[i], 1);
-		}
-	}
-
 	/* MSATA Enable - default to PCI */
 	if (gpio_cfg[board].msata_en) {
 		gpio_request(gpio_cfg[board].msata_en, "msata_en");
diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h
index 4b2aaf0fda..3e67d469dd 100644
--- a/board/gateworks/gw_ventana/common.h
+++ b/board/gateworks/gw_ventana/common.h
@@ -61,7 +61,6 @@ struct ventana {
 	struct dio_cfg *dio_cfg;
 	int dio_num;
 	/* various gpios (0 if non-existent) */
-	int leds[3];
 	int pcie_rst;
 	int mezz_pwren;
 	int mezz_irq;
diff --git a/configs/gwventana_emmc_defconfig b/configs/gwventana_emmc_defconfig
index 2fa30d470a..d3f0a0ec2d 100644
--- a/configs/gwventana_emmc_defconfig
+++ b/configs/gwventana_emmc_defconfig
@@ -80,6 +80,9 @@ CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DWC_AHSATA=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
 CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
diff --git a/configs/gwventana_gw5904_defconfig b/configs/gwventana_gw5904_defconfig
index 5b75fca9f2..c65c751da6 100644
--- a/configs/gwventana_gw5904_defconfig
+++ b/configs/gwventana_gw5904_defconfig
@@ -80,6 +80,9 @@ CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DWC_AHSATA=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
 CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
diff --git a/configs/gwventana_nand_defconfig b/configs/gwventana_nand_defconfig
index 16c0374804..78609c34ce 100644
--- a/configs/gwventana_nand_defconfig
+++ b/configs/gwventana_nand_defconfig
@@ -82,6 +82,9 @@ CONFIG_NETCONSOLE=y
 CONFIG_DM=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DWC_AHSATA=y
+CONFIG_LED=y
+CONFIG_LED_BLINK=y
+CONFIG_LED_GPIO=y
 CONFIG_SUPPORT_EMMC_RPMB=y
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
-- 
2.17.1


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

* [RESEND PATCH 05/16] imx: ventana: remove hard-coded USB HUBRST# gpio config
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (2 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 04/16] imx: ventana: replace hard-coded LED config with dt based config Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 06/16] imx: ventana: fix UMS support Tim Harvey
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The USB HUB reset is handled via dt now.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 729f612f81..3f85fc6915 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -231,8 +231,6 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
-	/* USB_HUBRST# */
-	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -260,8 +258,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
-	/* USB_HUBRST# */
-	IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16 | DIO_PAD_CFG),
 	/* MIPI_DIO */
 	IOMUX_PADS(PAD_SD1_DAT3__GPIO1_IO21 | DIO_PAD_CFG),
 	/* RS485_EN */
@@ -296,8 +292,6 @@ static iomux_v3_cfg_t const gw552x_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
 	/* USBOTG_SEL */
 	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
-	/* USB_HUBRST# */
-	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
 	/* PCI_RST# */
 	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
 	/* MX6_DIO[4:9] */
@@ -331,8 +325,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
-	/* USB_HUBRST# */
-	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -426,8 +418,6 @@ static iomux_v3_cfg_t const gw5903_gpio_pads[] = {
 };
 
 static iomux_v3_cfg_t const gw5904_gpio_pads[] = {
-	/* USB_HUBRST# */
-	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
-- 
2.17.1


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

* [RESEND PATCH 06/16] imx: ventana: fix UMS support
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (3 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 05/16] imx: ventana: remove hard-coded USB HUBRST# gpio config Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 07/16] imx: ventana: remove hard-coded PCI reset Tim Harvey
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The Gateworks Ventana boards have always had usb0=usbh1 and usb1=usbotg
because OTG is often subloaded on these boards and a bit in the EEPROM
which flagging that OTG is subloaded is used to remove the dt node via the
alias.

U-Boot DM_USB UMS requires the usb0 alias be assigned to the usbotg
so fix the usb0 alias in order for UMS to work.

Fixes 72c46327f03f: ("imx: ventana: enable dm support for USB")

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 arch/arm/dts/imx6qdl-gw51xx.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw52xx.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw53xx.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw54xx.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw551x.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw552x.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw553x.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw560x.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw5904.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw5907.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw5912.dtsi | 4 ++--
 arch/arm/dts/imx6qdl-gw5913.dtsi | 4 ++--
 12 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-gw51xx.dtsi b/arch/arm/dts/imx6qdl-gw51xx.dtsi
index 7e28463084..76a41d563c 100644
--- a/arch/arm/dts/imx6qdl-gw51xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw51xx.dtsi
@@ -13,8 +13,8 @@
 		led0 = &led0;
 		led1 = &led1;
 		nand = &gpmi;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw52xx.dtsi b/arch/arm/dts/imx6qdl-gw52xx.dtsi
index f1d9ba1fac..31a059f26b 100644
--- a/arch/arm/dts/imx6qdl-gw52xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw52xx.dtsi
@@ -16,8 +16,8 @@
 		mmc0 = &usdhc3;
 		nand = &gpmi;
 		ssi0 = &ssi1;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw53xx.dtsi b/arch/arm/dts/imx6qdl-gw53xx.dtsi
index 172a45ba17..904b228306 100644
--- a/arch/arm/dts/imx6qdl-gw53xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw53xx.dtsi
@@ -16,8 +16,8 @@
 		mmc0 = &usdhc3;
 		nand = &gpmi;
 		ssi0 = &ssi1;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw54xx.dtsi b/arch/arm/dts/imx6qdl-gw54xx.dtsi
index e09fad6068..95939cf277 100644
--- a/arch/arm/dts/imx6qdl-gw54xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw54xx.dtsi
@@ -17,8 +17,8 @@
 		mmc0 = &usdhc3;
 		nand = &gpmi;
 		ssi0 = &ssi1;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw551x.dtsi b/arch/arm/dts/imx6qdl-gw551x.dtsi
index 1bb586cbd5..c0ffea16d8 100644
--- a/arch/arm/dts/imx6qdl-gw551x.dtsi
+++ b/arch/arm/dts/imx6qdl-gw551x.dtsi
@@ -57,8 +57,8 @@
 		led0 = &led0;
 		nand = &gpmi;
 		ssi0 = &ssi1;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw552x.dtsi b/arch/arm/dts/imx6qdl-gw552x.dtsi
index 7935b10eab..f6742e5131 100644
--- a/arch/arm/dts/imx6qdl-gw552x.dtsi
+++ b/arch/arm/dts/imx6qdl-gw552x.dtsi
@@ -14,8 +14,8 @@
 		led1 = &led1;
 		led2 = &led2;
 		nand = &gpmi;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw553x.dtsi b/arch/arm/dts/imx6qdl-gw553x.dtsi
index b6965f25da..e21f068bec 100644
--- a/arch/arm/dts/imx6qdl-gw553x.dtsi
+++ b/arch/arm/dts/imx6qdl-gw553x.dtsi
@@ -55,8 +55,8 @@
 		led0 = &led0;
 		led1 = &led1;
 		nand = &gpmi;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw560x.dtsi b/arch/arm/dts/imx6qdl-gw560x.dtsi
index bfe65fd3c0..5da19756e0 100644
--- a/arch/arm/dts/imx6qdl-gw560x.dtsi
+++ b/arch/arm/dts/imx6qdl-gw560x.dtsi
@@ -58,8 +58,8 @@
 		mmc0 = &usdhc2;
 		mmc1 = &usdhc3;
 		ssi0 = &ssi1;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw5904.dtsi b/arch/arm/dts/imx6qdl-gw5904.dtsi
index 9adbd728dc..b5ed2d83c1 100644
--- a/arch/arm/dts/imx6qdl-gw5904.dtsi
+++ b/arch/arm/dts/imx6qdl-gw5904.dtsi
@@ -56,8 +56,8 @@
 		led1 = &led1;
 		led2 = &led2;
 		mmc0 = &usdhc3;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw5907.dtsi b/arch/arm/dts/imx6qdl-gw5907.dtsi
index 58f73a141e..a36b6e7048 100644
--- a/arch/arm/dts/imx6qdl-gw5907.dtsi
+++ b/arch/arm/dts/imx6qdl-gw5907.dtsi
@@ -13,8 +13,8 @@
 		led0 = &led0;
 		led1 = &led1;
 		nand = &gpmi;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw5912.dtsi b/arch/arm/dts/imx6qdl-gw5912.dtsi
index 88234a6f13..2537288627 100644
--- a/arch/arm/dts/imx6qdl-gw5912.dtsi
+++ b/arch/arm/dts/imx6qdl-gw5912.dtsi
@@ -15,8 +15,8 @@
 		led2 = &led2;
 		mmc0 = &usdhc3;
 		nand = &gpmi;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
diff --git a/arch/arm/dts/imx6qdl-gw5913.dtsi b/arch/arm/dts/imx6qdl-gw5913.dtsi
index f4c2b2189f..c2c1c2b160 100644
--- a/arch/arm/dts/imx6qdl-gw5913.dtsi
+++ b/arch/arm/dts/imx6qdl-gw5913.dtsi
@@ -13,8 +13,8 @@
 		led0 = &led0;
 		led1 = &led1;
 		nand = &gpmi;
-		usb0 = &usbh1;
-		usb1 = &usbotg;
+		usb0 = &usbotg;
+		usb1 = &usbh1;
 	};
 
 	chosen {
-- 
2.17.1


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

* [RESEND PATCH 07/16] imx: ventana: remove hard-coded PCI reset
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (4 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 06/16] imx: ventana: fix UMS support Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 08/16] imx: ventana: remove hard-coded USB OTG pinmux Tim Harvey
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

PCIe reset configuration is handled via dt now.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c     | 49 -------------------------
 board/gateworks/gw_ventana/common.h     |  1 -
 board/gateworks/gw_ventana/gw_ventana.c | 12 ------
 3 files changed, 62 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 3f85fc6915..c1a4f8d277 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -187,8 +187,6 @@ static iomux_v3_cfg_t const gw51xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* VID_PWR */
 	IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
@@ -212,10 +210,6 @@ static iomux_v3_cfg_t const gw52xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* VID_PWR */
 	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
-	/* PCI_RST# (GW522x) */
-	IOMUX_PADS(PAD_EIM_D23__GPIO3_IO23 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -241,8 +235,6 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG),
 	/* VID_EN */
 	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -268,8 +260,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
 	/* DIOI2C_DIS# */
 	IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
 	/* VID_EN */
 	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
 	/* RS485_EN */
@@ -281,8 +271,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 static iomux_v3_cfg_t const gw551x_gpio_pads[] = {
 	/* CAN_STBY */
 	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
@@ -292,8 +280,6 @@ static iomux_v3_cfg_t const gw552x_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
 	/* USBOTG_SEL */
 	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG),
 	/* MX6_DIO[4:9] */
 	IOMUX_PADS(PAD_CSI0_PIXCLK__GPIO5_IO18 | DIO_PAD_CFG),
 	IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG),
@@ -314,8 +300,6 @@ static iomux_v3_cfg_t const gw553x_gpio_pads[] = {
 	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
 	/* VID_PWR */
 	IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
@@ -333,8 +317,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG),
 	/* VID_EN */
 	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_DISP0_DAT10__GPIO4_IO31 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -350,8 +332,6 @@ static iomux_v3_cfg_t const gw5901_gpio_pads[] = {
 	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 */
@@ -374,8 +354,6 @@ static iomux_v3_cfg_t const gw5902_gpio_pads[] = {
 	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# */
@@ -455,8 +433,6 @@ static iomux_v3_cfg_t const gw5905_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14 | DIO_PAD_CFG),
 	/* USBEHCI_SEL */
 	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
-	/* PCI_RST# */
-	IOMUX_PADS(PAD_GPIO_16__GPIO7_IO11 | DIO_PAD_CFG),
 	/* LVDS_BKLEN # */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -889,7 +865,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2,
 		.dio_cfg = gw54xx_dio,
 		.dio_num = ARRAY_SIZE(gw54xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(4, 7),
 		.mezz_irq = IMX_GPIO_NR(4, 9),
 		.rs485en = IMX_GPIO_NR(3, 24),
@@ -904,7 +879,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2,
 		.dio_cfg = gw51xx_dio,
 		.dio_num = ARRAY_SIZE(gw51xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 2),
@@ -918,7 +892,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw52xx_gpio_pads)/2,
 		.dio_cfg = gw52xx_dio,
 		.dio_num = ARRAY_SIZE(gw52xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 27),
@@ -937,7 +910,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2,
 		.dio_cfg = gw53xx_dio,
 		.dio_num = ARRAY_SIZE(gw53xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 27),
@@ -955,7 +927,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2,
 		.dio_cfg = gw54xx_dio,
 		.dio_num = ARRAY_SIZE(gw54xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.rs485en = IMX_GPIO_NR(7, 1),
@@ -975,7 +946,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw551x_gpio_pads)/2,
 		.dio_cfg = gw551x_dio,
 		.dio_num = ARRAY_SIZE(gw551x_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.wdis = IMX_GPIO_NR(7, 12),
 	},
 
@@ -985,7 +955,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2,
 		.dio_cfg = gw552x_dio,
 		.dio_num = ARRAY_SIZE(gw552x_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.usb_sel = IMX_GPIO_NR(1, 7),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
@@ -997,7 +966,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw553x_gpio_pads)/2,
 		.dio_cfg = gw553x_dio,
 		.dio_num = ARRAY_SIZE(gw553x_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.vidin_en = IMX_GPIO_NR(5, 20),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.vsel_pin = IMX_GPIO_NR(6, 14),
@@ -1010,7 +978,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw560x_gpio_pads)/2,
 		.dio_cfg = gw560x_dio,
 		.dio_num = ARRAY_SIZE(gw560x_dio),
-		.pcie_rst = IMX_GPIO_NR(4, 31),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.rs232_en = GP_RS232_EN,
@@ -1024,7 +991,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.gpio_pads = gw5901_gpio_pads,
 		.num_pads = ARRAY_SIZE(gw5901_gpio_pads)/2,
 		.dio_cfg = gw5901_dio,
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 	},
 
 	/* GW5902 */
@@ -1032,7 +998,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.gpio_pads = gw5902_gpio_pads,
 		.num_pads = ARRAY_SIZE(gw5902_gpio_pads)/2,
 		.dio_cfg = gw5902_dio,
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.rs232_en = GP_RS232_EN,
 	},
 
@@ -1051,7 +1016,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2,
 		.dio_cfg = gw5904_dio,
 		.dio_num = ARRAY_SIZE(gw5904_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 	},
@@ -1060,7 +1024,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 	{
 		.gpio_pads = gw5905_gpio_pads,
 		.num_pads = ARRAY_SIZE(gw5905_gpio_pads)/2,
-		.pcie_rst = IMX_GPIO_NR(7, 11),
 		.wdis = IMX_GPIO_NR(7, 13),
 	},
 
@@ -1070,7 +1033,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2,
 		.dio_cfg = gw5906_dio,
 		.dio_num = ARRAY_SIZE(gw5906_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.usb_sel = IMX_GPIO_NR(1, 7),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
@@ -1082,7 +1044,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2,
 		.dio_cfg = gw51xx_dio,
 		.dio_num = ARRAY_SIZE(gw51xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.wdis = IMX_GPIO_NR(7, 12),
 	},
 
@@ -1092,7 +1053,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2,
 		.dio_cfg = gw53xx_dio,
 		.dio_num = ARRAY_SIZE(gw53xx_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 29),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 27),
@@ -1108,7 +1068,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2,
 		.dio_cfg = gw5904_dio,
 		.dio_num = ARRAY_SIZE(gw5904_dio),
-		.pcie_rst = IMX_GPIO_NR(1, 0),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 	},
@@ -1135,14 +1094,6 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 		gpio_direction_output(gpio_cfg[board].rs232_en, 0);
 	}
 
-	/* GW522x Uses GPIO3_IO23 for PCIE_RST# */
-	if (board == GW52xx && info->model[4] == '2')
-		gpio_cfg[board].pcie_rst = IMX_GPIO_NR(3, 23);
-
-	/* assert PCI_RST# */
-	gpio_request(gpio_cfg[board].pcie_rst, "pci_rst#");
-	gpio_direction_output(gpio_cfg[board].pcie_rst, 0);
-
 	/* MSATA Enable - default to PCI */
 	if (gpio_cfg[board].msata_en) {
 		gpio_request(gpio_cfg[board].msata_en, "msata_en");
diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h
index 3e67d469dd..35a5c86e81 100644
--- a/board/gateworks/gw_ventana/common.h
+++ b/board/gateworks/gw_ventana/common.h
@@ -61,7 +61,6 @@ struct ventana {
 	struct dio_cfg *dio_cfg;
 	int dio_num;
 	/* various gpios (0 if non-existent) */
-	int pcie_rst;
 	int mezz_pwren;
 	int mezz_irq;
 	int rs485en;
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 77a2f2ca4b..0d9e7b682a 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -372,18 +372,6 @@ int power_init_board(void)
 	return 0;
 }
 
-int imx6_pcie_toggle_reset(struct gpio_desc *gpio, bool active_high)
-{
-	if (board_type < GW_UNKNOWN) {
-		uint pin = gpio_cfg[board_type].pcie_rst;
-		gpio_request(pin, "pci_rst#");
-		gpio_direction_output(pin, 0);
-		mdelay(50);
-		gpio_direction_output(pin, 1);
-	}
-	return 0;
-}
-
 /*
  * Most Ventana boards have a PLX PEX860x PCIe switch onboard and use its
  * GPIO's as PERST# signals for its downstream ports - configure the GPIO's
-- 
2.17.1


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

* [RESEND PATCH 08/16] imx: ventana: remove hard-coded USB OTG pinmux
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (5 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 07/16] imx: ventana: remove hard-coded PCI reset Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 09/16] imx: ventana: remove hard-coded analog video codec enable Tim Harvey
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

pinmux is now done via dt. Add missing OTG_OC pinmux for boards that
use it.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 arch/arm/dts/imx6qdl-gw51xx.dtsi    | 1 +
 arch/arm/dts/imx6qdl-gw52xx.dtsi    | 1 +
 arch/arm/dts/imx6qdl-gw54xx.dtsi    | 1 +
 arch/arm/dts/imx6qdl-gw553x.dtsi    | 1 +
 board/gateworks/gw_ventana/common.c | 7 -------
 5 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/arm/dts/imx6qdl-gw51xx.dtsi b/arch/arm/dts/imx6qdl-gw51xx.dtsi
index 76a41d563c..812acf7ab8 100644
--- a/arch/arm/dts/imx6qdl-gw51xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw51xx.dtsi
@@ -629,6 +629,7 @@
 		fsl,pins = <
 			MX6QDL_PAD_GPIO_1__USB_OTG_ID		0x17059
 			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0 /* OTG_PWR_EN */
+			MX6QDL_PAD_KEY_COL4__USB_OTG_OC		0x17059
 		>;
 	};
 
diff --git a/arch/arm/dts/imx6qdl-gw52xx.dtsi b/arch/arm/dts/imx6qdl-gw52xx.dtsi
index 31a059f26b..81a9ce38b9 100644
--- a/arch/arm/dts/imx6qdl-gw52xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw52xx.dtsi
@@ -734,6 +734,7 @@
 		fsl,pins = <
 			MX6QDL_PAD_GPIO_1__USB_OTG_ID		0x17059
 			MX6QDL_PAD_EIM_D22__GPIO3_IO22	0x1b0b0 /* OTG_PWR_EN */
+			MX6QDL_PAD_KEY_COL4__USB_OTG_OC		0x17059
 		>;
 	};
 
diff --git a/arch/arm/dts/imx6qdl-gw54xx.dtsi b/arch/arm/dts/imx6qdl-gw54xx.dtsi
index 95939cf277..ffed4fb550 100644
--- a/arch/arm/dts/imx6qdl-gw54xx.dtsi
+++ b/arch/arm/dts/imx6qdl-gw54xx.dtsi
@@ -819,6 +819,7 @@
 		fsl,pins = <
 			MX6QDL_PAD_GPIO_1__USB_OTG_ID		0x17059
 			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0 /* PWR_EN */
+			MX6QDL_PAD_KEY_COL4__USB_OTG_OC		0x17059
 		>;
 	};
 
diff --git a/arch/arm/dts/imx6qdl-gw553x.dtsi b/arch/arm/dts/imx6qdl-gw553x.dtsi
index e21f068bec..b15c281852 100644
--- a/arch/arm/dts/imx6qdl-gw553x.dtsi
+++ b/arch/arm/dts/imx6qdl-gw553x.dtsi
@@ -688,6 +688,7 @@
 		fsl,pins = <
 			MX6QDL_PAD_GPIO_1__USB_OTG_ID		0x17059
 			MX6QDL_PAD_EIM_D22__GPIO3_IO22		0x1b0b0 /* OTG_PWR_EN */
+			MX6QDL_PAD_KEY_COL4__USB_OTG_OC		0x17059
 		>;
 	};
 
diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index c1a4f8d277..1dead66517 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -182,7 +182,6 @@ static iomux_v3_cfg_t const gw51xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
-
 	/* GPS_SHDN */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* VID_PWR */
@@ -321,8 +320,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
-	/* USBH2_PEN (OTG) */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* 12V0_PWR_EN */
 	IOMUX_PADS(PAD_DISP0_DAT5__GPIO4_IO26 | DIO_PAD_CFG),
 };
@@ -360,8 +357,6 @@ static iomux_v3_cfg_t const gw5902_gpio_pads[] = {
 	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[] = {
@@ -375,8 +370,6 @@ static iomux_v3_cfg_t const gw5903_gpio_pads[] = {
 	IOMUX_PADS(PAD_NANDF_D4__GPIO2_IO04 | DIO_PAD_CFG),
 	/* USBH1_PEN (EHCI) */
 	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
-	/* USBH2_PEN (OTG) */
-	IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG),
 	/* USBDPC_PEN */
 	IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG),
 	/* TOUCH_RST */
-- 
2.17.1


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

* [RESEND PATCH 09/16] imx: ventana: remove hard-coded analog video codec enable
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (6 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 08/16] imx: ventana: remove hard-coded USB OTG pinmux Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 10/16] imx: ventana: remove hard-coded flexcan standby pin Tim Harvey
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

Analog video codec enable is configured in kernel dt.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c | 25 -------------------------
 board/gateworks/gw_ventana/common.h |  1 -
 2 files changed, 26 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 1dead66517..719357f128 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -184,8 +184,6 @@ static iomux_v3_cfg_t const gw51xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
 	/* GPS_SHDN */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
-	/* VID_PWR */
-	IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
@@ -207,8 +205,6 @@ static iomux_v3_cfg_t const gw52xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG),
 	/* USBOTG_SEL */
 	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
-	/* VID_PWR */
-	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -232,8 +228,6 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG),
 	/* GPS_SHDN */
 	IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG),
-	/* VID_EN */
-	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -259,8 +253,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
 	/* DIOI2C_DIS# */
 	IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG),
-	/* VID_EN */
-	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -297,8 +289,6 @@ static iomux_v3_cfg_t const gw552x_gpio_pads[] = {
 static iomux_v3_cfg_t const gw553x_gpio_pads[] = {
 	/* SD3_VSELECT */
 	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
-	/* VID_PWR */
-	IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
@@ -314,8 +304,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
 	/* DIOI2C_DIS# */
 	IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG),
-	/* VID_EN */
-	IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG),
 	/* RS485_EN */
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
@@ -875,7 +863,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 2),
-		.vidin_en = IMX_GPIO_NR(5, 20),
 		.wdis = IMX_GPIO_NR(7, 12),
 	},
 
@@ -888,7 +875,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 27),
-		.vidin_en = IMX_GPIO_NR(3, 31),
 		.usb_sel = IMX_GPIO_NR(1, 2),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
@@ -906,7 +892,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 27),
-		.vidin_en = IMX_GPIO_NR(3, 31),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
 		.rs232_en = GP_RS232_EN,
@@ -923,7 +908,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.rs485en = IMX_GPIO_NR(7, 1),
-		.vidin_en = IMX_GPIO_NR(3, 31),
 		.dioi2c_en = IMX_GPIO_NR(4,  5),
 		.pcie_sson = IMX_GPIO_NR(1, 20),
 		.wdis = IMX_GPIO_NR(5, 17),
@@ -959,7 +943,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw553x_gpio_pads)/2,
 		.dio_cfg = gw553x_dio,
 		.dio_num = ARRAY_SIZE(gw553x_dio),
-		.vidin_en = IMX_GPIO_NR(5, 20),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
@@ -974,7 +957,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.rs232_en = GP_RS232_EN,
-		.vidin_en = IMX_GPIO_NR(3, 31),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
 	},
@@ -1049,7 +1031,6 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 		.gps_shdn = IMX_GPIO_NR(1, 27),
-		.vidin_en = IMX_GPIO_NR(3, 31),
 		.wdis = IMX_GPIO_NR(7, 12),
 		.msata_en = GP_MSATA_SEL,
 		.rs232_en = GP_RS232_EN,
@@ -1115,12 +1096,6 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 		gpio_direction_output(gpio_cfg[board].gps_shdn, 1);
 	}
 
-	/* Analog video codec power enable */
-	if (gpio_cfg[board].vidin_en) {
-		gpio_request(gpio_cfg[board].vidin_en, "anavidin_en");
-		gpio_direction_output(gpio_cfg[board].vidin_en, 1);
-	}
-
 	/* DIOI2C_DIS# */
 	if (gpio_cfg[board].dioi2c_en) {
 		gpio_request(gpio_cfg[board].dioi2c_en, "dioi2c_dis#");
diff --git a/board/gateworks/gw_ventana/common.h b/board/gateworks/gw_ventana/common.h
index 35a5c86e81..edfb065f6a 100644
--- a/board/gateworks/gw_ventana/common.h
+++ b/board/gateworks/gw_ventana/common.h
@@ -65,7 +65,6 @@ struct ventana {
 	int mezz_irq;
 	int rs485en;
 	int gps_shdn;
-	int vidin_en;
 	int dioi2c_en;
 	int pcie_sson;
 	int usb_sel;
-- 
2.17.1


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

* [RESEND PATCH 10/16] imx: ventana: remove hard-coded flexcan standby pin
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (7 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 09/16] imx: ventana: remove hard-coded analog video codec enable Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 11/16] imx: ventana: use dt for hwmon Tim Harvey
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

Flexcan pinmux is configured in kernel dt.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
 board/gateworks/gw_ventana/common.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 719357f128..f7819f841c 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -199,8 +199,6 @@ static iomux_v3_cfg_t const gw52xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
 	IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)),
-	/* CAN_STBY */
-	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
 	/* GPS_SHDN */
 	IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG),
 	/* USBOTG_SEL */
@@ -218,8 +216,6 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
 	/* MSATA_EN */
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
-	/* CAN_STBY */
-	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -241,8 +237,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
 	/* MSATA_EN */
 	IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG),
-	/* CAN_STBY */
-	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* MIPI_DIO */
 	IOMUX_PADS(PAD_SD1_DAT3__GPIO1_IO21 | DIO_PAD_CFG),
 	/* RS485_EN */
@@ -260,8 +254,6 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 };
 
 static iomux_v3_cfg_t const gw551x_gpio_pads[] = {
-	/* CAN_STBY */
-	IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
@@ -296,8 +288,6 @@ static iomux_v3_cfg_t const gw553x_gpio_pads[] = {
 static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 	/* RS232_EN# */
 	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
-	/* CAN_STBY */
-	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* IOEXP_PWREN# */
 	IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG),
 	/* IOEXP_IRQ# */
@@ -315,8 +305,6 @@ static iomux_v3_cfg_t const gw560x_gpio_pads[] = {
 static iomux_v3_cfg_t const gw5901_gpio_pads[] = {
 	/* ETH1_EN */
 	IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | DIO_PAD_CFG),
-	/* CAN_STBY */
-	IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG),
 	/* PMIC reset */
 	IOMUX_PADS(PAD_DISP0_DAT8__WDOG1_B | DIO_PAD_CFG),
 	/* COM_CFGA/B/C/D */
@@ -333,10 +321,6 @@ static iomux_v3_cfg_t const gw5901_gpio_pads[] = {
 };
 
 static iomux_v3_cfg_t const gw5902_gpio_pads[] = {
-	/* 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),
 	/* 5V_UVLO */
@@ -1139,12 +1123,7 @@ 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:
-- 
2.17.1


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

* [RESEND PATCH 11/16] imx: ventana: use dt for hwmon
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (8 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 10/16] imx: ventana: remove hard-coded flexcan standby pin Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 12/16] imx: ventana: add GW5910 support Tim Harvey
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

Use dt-bindings for GSC hwmon devices.

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

diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c
index ffed6b5fc8..443ecea572 100644
--- a/board/gateworks/gw_ventana/gsc.c
+++ b/board/gateworks/gw_ventana/gsc.c
@@ -15,10 +15,13 @@
 #include <linux/ctype.h>
 
 #include <asm/arch/sys_proto.h>
+#include <asm/global_data.h>
 
 #include "ventana_eeprom.h"
 #include "gsc.h"
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /*
  * The Gateworks System Controller will fail to ACK a master transaction if
  * it is busy, which can occur during its 1HZ timer tick while reading ADC's.
@@ -65,24 +68,116 @@ int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
 	return ret;
 }
 
-static void read_hwmon(const char *name, uint reg, uint size)
+int gsc_get_board_temp(void)
 {
-	unsigned char buf[3];
-	uint ui;
+	const void *fdt = gd->fdt_blob;
+	int node, reg, mode, val;
+	const char *label;
+	u8 buf[2];
+	int ret;
 
-	printf("%-8s:", name);
-	memset(buf, 0, sizeof(buf));
-	if (gsc_i2c_read(GSC_HWMON_ADDR, reg, 1, buf, size)) {
-		puts("fRD\n");
-	} else {
-		ui = buf[0] | (buf[1]<<8) | (buf[2]<<16);
-		if (size == 2 && ui > 0x8000)
-			ui -= 0xffff;
-		if (ui == 0xffffff)
-			puts("invalid\n");
-		else
-			printf("%d\n", ui);
+	node = fdt_node_offset_by_compatible(fdt, -1, "gw,gsc-adc");
+	if (node <= 0)
+		return node;
+	i2c_set_bus_num(0);
+
+	/* iterate over hwmon nodes */
+	node = fdt_first_subnode(fdt, node);
+	while (node > 0) {
+		reg = fdtdec_get_int(fdt, node, "reg", -1);
+		mode = fdtdec_get_int(fdt, node, "gw,mode", -1);
+		label = fdt_stringlist_get(fdt, node, "label", 0, NULL);
+
+		if ((reg == -1) || (mode == -1) || !label) {
+			printf("invalid dt:%s\n", fdt_get_name(fdt, node, NULL));
+			continue;
+		}
+
+		if ((mode != 0) || strcmp(label, "temp"))
+			continue;
+
+		memset(buf, 0, sizeof(buf));
+		ret = gsc_i2c_read(GSC_HWMON_ADDR, reg, 1, buf, sizeof(buf));
+		val = buf[0] | buf[1] << 8;
+		if (val >= 0) {
+			if (val > 0x8000)
+				val -= 0xffff;
+			return val;
+		}
+		node = fdt_next_subnode(fdt, node);
 	}
+
+	return 0;
+}
+
+/* display hardware monitor ADC channels */
+int gsc_hwmon(void)
+{
+	const void *fdt = gd->fdt_blob;
+	int node, reg, mode, len, val, offset;
+	const char *label;
+	u8 buf[2];
+	int ret;
+
+	node = fdt_node_offset_by_compatible(fdt, -1, "gw,gsc-adc");
+	if (node <= 0)
+		return node;
+	i2c_set_bus_num(0);
+
+	/* iterate over hwmon nodes */
+	node = fdt_first_subnode(fdt, node);
+	while (node > 0) {
+		reg = fdtdec_get_int(fdt, node, "reg", -1);
+		mode = fdtdec_get_int(fdt, node, "gw,mode", -1);
+		offset = fdtdec_get_int(fdt, node, "gw,voltage-offset-microvolt", 0);
+		label = fdt_stringlist_get(fdt, node, "label", 0, NULL);
+
+		if ((reg == -1) || (mode == -1) || !label)
+			printf("invalid dt:%s\n", fdt_get_name(fdt, node, NULL));
+
+		memset(buf, 0, sizeof(buf));
+		ret = gsc_i2c_read(GSC_HWMON_ADDR, reg, 1, buf, sizeof(buf));
+		val = buf[0] | buf[1] << 8;
+		if (val >= 0) {
+			const u32 *div;
+			int r[2];
+
+			switch (mode) {
+			case 0: /* temperature (C*10) */
+				if (val > 0x8000)
+					val -= 0xffff;
+				printf("%-8s: %d.%ldC\n", label, val / 10, abs(val % 10));
+				break;
+			case 1: /* prescaled voltage */
+				if (val != 0xffff)
+					printf("%-8s: %d.%03dV\n", label, val / 1000, val % 1000);
+				break;
+			case 2: /* scaled based on ref volt and resolution */
+				val *= 2500;
+				val /= 1 << 12;
+
+				/* apply pre-scaler voltage divider */
+				div  = fdt_getprop(fdt, node, "gw,voltage-divider-ohms", &len);
+				if (div && (len == sizeof(uint32_t) * 2)) {
+					r[0] = fdt32_to_cpu(div[0]);
+					r[1] = fdt32_to_cpu(div[1]);
+					if (r[0] && r[1]) {
+						val *= (r[0] + r[1]);
+						val /= r[1];
+					}
+				}
+
+				/* adjust by offset */
+				val += (offset / 1000);
+
+				printf("%-8s: %d.%03dV\n", label, val / 1000, val % 1000);
+				break;
+			}
+		}
+		node = fdt_next_subnode(fdt, node);
+	}
+
+	return 0;
 }
 
 int gsc_info(int verbose)
@@ -103,54 +198,13 @@ int gsc_info(int verbose)
 		gsc_i2c_write(GSC_SC_ADDR, GSC_SC_STATUS, 1,
 			      &buf[GSC_SC_STATUS], 1);
 	}
-	if (!gsc_i2c_read(GSC_HWMON_ADDR, GSC_HWMON_TEMP, 1, buf, 2)) {
-		int ui = buf[0] | buf[1]<<8;
-		if (ui > 0x8000)
-			ui -= 0xffff;
-		printf(" board temp at %dC", ui / 10);
-	}
+	printf(" board temp at %dC", gsc_get_board_temp() / 10);
 	puts("\n");
 	if (!verbose)
 		return CMD_RET_SUCCESS;
 
-	read_hwmon("Temp",     GSC_HWMON_TEMP, 2);
-	read_hwmon("VIN",      GSC_HWMON_VIN, 3);
-	read_hwmon("VBATT",    GSC_HWMON_VBATT, 3);
-	read_hwmon("VDD_3P3",  GSC_HWMON_VDD_3P3, 3);
-	read_hwmon("VDD_ARM",  GSC_HWMON_VDD_CORE, 3);
-	read_hwmon("VDD_SOC",  GSC_HWMON_VDD_SOC, 3);
-	read_hwmon("VDD_HIGH", GSC_HWMON_VDD_HIGH, 3);
-	read_hwmon("VDD_DDR",  GSC_HWMON_VDD_DDR, 3);
-	read_hwmon("VDD_5P0",  GSC_HWMON_VDD_5P0, 3);
-	if (strncasecmp((const char*) ventana_info.model, "GW553", 5))
-		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 (ventana_info.model[3]) {
-	case '1': /* GW51xx */
-		read_hwmon("VDD_IO3",  GSC_HWMON_VDD_IO4, 3); /* -C rev */
-		break;
-	case '2': /* GW52xx */
-		break;
-	case '3': /* GW53xx */
-		read_hwmon("VDD_IO4",  GSC_HWMON_VDD_IO4, 3); /* -C rev */
-		read_hwmon("VDD_GPS",  GSC_HWMON_VDD_IO3, 3);
-		break;
-	case '4': /* GW54xx */
-		read_hwmon("VDD_IO3",  GSC_HWMON_VDD_IO4, 3); /* -C rev */
-		read_hwmon("VDD_GPS",  GSC_HWMON_VDD_IO3, 3);
-		break;
-	case '5': /* GW55xx */
-		break;
-	case '6': /* GW560x */
-		read_hwmon("VDD_IO4",  GSC_HWMON_VDD_IO4, 3);
-		read_hwmon("VDD_GPS",  GSC_HWMON_VDD_IO3, 3);
-		break;
-	case '9': /* GW590x */
-		read_hwmon("AMONBMON",  GSC_HWMON_VDD_IO3, 3);
-		read_hwmon("BAT_VOLT",  GSC_HWMON_VDD_EXT, 3);
-		read_hwmon("BAT_TEMP",  GSC_HWMON_VDD_IO4, 2);
-	}
+	gsc_hwmon();
+
 	return 0;
 }
 
-- 
2.17.1


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

* [RESEND PATCH 12/16] imx: ventana: add GW5910 support
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (9 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 11/16] imx: ventana: use dt for hwmon Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 13/16] imx: ventana: add GW5912 support Tim Harvey
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The GW5910 is a Single Board Computer based on the NXP i.MX6Q/DL SoC
with the following features:
 - DDR3 DRAM
 - NAND FLASH (256MiB or 2048MiB)
 - microSD socket
 - Gateworks System Periperhal Controller
 - front panel LED's
 - front panel pushbutton
 - RS232 connector (2x UARTs)
 - Digital I/O connector (I2C/GPIO)
 - SPI connector
 - u-blox Zoe-M8Q GPS
 - LIS2DE12 Accellerometer
 - TI CC1352 ARM Cortex-M4 multiprotocol sub-1GHz / 2.4GHz wireless MCU
 - On-board brcmfmac WiFi and BT module
 - RGMII RJ45 GbE
 - 1x MiniPCIe socket with PCIe/USB 2.0
 - 1x MiniPCIe socket with USB 2.0 and nanoSIM socket
 - Passive PoE and wide-range DC power supply

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

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index f7819f841c..270c4cf3a3 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -19,6 +19,7 @@
 #include <power/pmic.h>
 #include <power/ltc3676_pmic.h>
 #include <power/pfuze100_pmic.h>
+#include <power/mp5416.h>
 
 #include "common.h"
 
@@ -420,6 +421,19 @@ static iomux_v3_cfg_t const gw5905_gpio_pads[] = {
 	IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG),
 };
 
+static iomux_v3_cfg_t const gw5910_gpio_pads[] = {
+	/* SD3_VSELECT */
+	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
+	/* RS232_EN# */
+	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
+	/* RF_RESET# */
+	IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG),
+	/* RF_BOOT */
+	IOMUX_PADS(PAD_GPIO_8__GPIO1_IO08 | DIO_PAD_CFG),
+	/* PCIESKT_WDIS# */
+	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
+};
+
 /* Digital I/O */
 struct dio_cfg gw51xx_dio[] = {
 	{
@@ -1029,6 +1043,18 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
 	},
+
+	/* GW5910 */
+	{
+		.gpio_pads = gw5910_gpio_pads,
+		.num_pads = ARRAY_SIZE(gw5910_gpio_pads) / 2,
+		.dio_cfg = gw52xx_dio,
+		.dio_num = ARRAY_SIZE(gw52xx_dio),
+		.wdis = IMX_GPIO_NR(7, 12),
+		.rs232_en = GP_RS232_EN,
+		.vsel_pin = IMX_GPIO_NR(6, 14),
+		.mmc_cd = IMX_GPIO_NR(7, 0),
+	},
 };
 
 #define SETUP_GPIO_OUTPUT(gpio, name, level) \
@@ -1181,6 +1207,11 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 		 */
 		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 8), "touch_rst", 1);
 		break;
+	case GW5910:
+		/* CC1352 */
+		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 7), "rf_reset#", 1);
+		SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 8), "rf_boot", 1);
+		break;
 	}
 }
 
@@ -1423,6 +1454,21 @@ void setup_pmic(void)
 		pmic_reg_write(p, LTC3676_BUCK3, 0xc0);
 		pmic_reg_write(p, LTC3676_BUCK4, 0xc0);
 	}
+
+	/* configure MP5416 PMIC */
+	else if (!i2c_probe(0x69)) {
+		puts("PMIC:  MP5416\n");
+		switch (board) {
+		case GW5910:
+			/* SW1: VDD_ARM 1.2V -> (1.275 to 1.475) */
+			reg = MP5416_VSET_EN | MP5416_VSET_SW1_SVAL(1475000);
+			i2c_write(0x69, MP5416_VSET_SW1, 1, (uint8_t *)&reg, 1);
+			/* SW4: VDD_SOC 1.2V -> (1.350 to 1.475) */
+			reg = MP5416_VSET_EN | MP5416_VSET_SW4_SVAL(1475000);
+			i2c_write(0x69, MP5416_VSET_SW4, 1, (uint8_t *)&reg, 1);
+			break;
+		}
+	}
 }
 
 #include <fdt_support.h>
@@ -1570,6 +1616,7 @@ int board_mmc_init(struct bd_info *bis)
 	case GW53xx:
 	case GW54xx:
 	case GW553x:
+	case GW5910:
 		/* usdhc3: 4bit microSD */
 		SETUP_IOMUX_PADS(usdhc3_pads);
 		usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR;
diff --git a/board/gateworks/gw_ventana/eeprom.c b/board/gateworks/gw_ventana/eeprom.c
index b9862c7dfc..1e48141160 100644
--- a/board/gateworks/gw_ventana/eeprom.c
+++ b/board/gateworks/gw_ventana/eeprom.c
@@ -124,6 +124,8 @@ read_eeprom(int bus, struct ventana_board_info *info)
 			type = GW5908;
 		else if (info->model[4] == '0' && info->model[5] == '9')
 			type = GW5909;
+		else if (info->model[4] == '1' && info->model[5] == '0')
+			type = GW5910;
 		break;
 	default:
 		printf("EEPROM: Unknown model in EEPROM: %s\n", info->model);
diff --git a/board/gateworks/gw_ventana/ventana_eeprom.h b/board/gateworks/gw_ventana/ventana_eeprom.h
index 4fa085b320..7c01e9edb4 100644
--- a/board/gateworks/gw_ventana/ventana_eeprom.h
+++ b/board/gateworks/gw_ventana/ventana_eeprom.h
@@ -121,6 +121,7 @@ enum {
 	GW5907,
 	GW5908,
 	GW5909,
+	GW5910,
 	GW_UNKNOWN,
 	GW_BADCRC,
 };
-- 
2.17.1


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

* [RESEND PATCH 13/16] imx: ventana: add GW5912 support
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (10 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 12/16] imx: ventana: add GW5910 support Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 14/16] imx: ventana: add GW5913 support Tim Harvey
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The GW5912 is a Single Board Computer based on the NXP i.MX6Q/DL SoC
with the following features:
 - DDR3 DRAM
 - NAND FLASH (256MiB or 2048MiB)
 - microSD socket
 - Gateworks System Periperhal Controller
 - front panel LED's
 - front panel pushbutton
 - RS232 connector (2x UARTs)
 - CAN/RS485 connector
 - Digital I/O connector (I2C/GPIO)
 - SPI connector
 - u-blox Zoe-M8Q GPS
 - LIS2DE12 Accellerometer
 - 1x FEC GbE RJ45 with 802.3at Active PoE
 - 1x PCI GbE RJ45 with Passive PoE
 - 5x MiniPCIe socket with PCIe/USB 2.0
 - 1x MiniPCIe socket with PCIe/USB 2.0 and SIM socket
 - Aux power input with wide-range DC power supply

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

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 270c4cf3a3..3a0b18672f 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -434,6 +434,15 @@ static iomux_v3_cfg_t const gw5910_gpio_pads[] = {
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
 };
 
+static iomux_v3_cfg_t const gw5912_gpio_pads[] = {
+	/* SD3_VSELECT */
+	IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG),
+	/* RS232_EN# */
+	IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG),
+	/* PCIESKT_WDIS# */
+	IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG),
+};
+
 /* Digital I/O */
 struct dio_cfg gw51xx_dio[] = {
 	{
@@ -850,6 +859,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.dioi2c_en = IMX_GPIO_NR(4,  5),
 		.pcie_sson = IMX_GPIO_NR(1, 20),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
+		.wdis = -1,
 	},
 
 	/* GW51xx */
@@ -964,6 +974,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.gpio_pads = gw5901_gpio_pads,
 		.num_pads = ARRAY_SIZE(gw5901_gpio_pads)/2,
 		.dio_cfg = gw5901_dio,
+		.wdis = -1,
 	},
 
 	/* GW5902 */
@@ -972,6 +983,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.num_pads = ARRAY_SIZE(gw5902_gpio_pads)/2,
 		.dio_cfg = gw5902_dio,
 		.rs232_en = GP_RS232_EN,
+		.wdis = -1,
 	},
 
 	/* GW5903 */
@@ -981,6 +993,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.dio_cfg = gw5903_dio,
 		.dio_num = ARRAY_SIZE(gw5903_dio),
 		.mmc_cd = IMX_GPIO_NR(6, 11),
+		.wdis = -1,
 	},
 
 	/* GW5904 */
@@ -991,6 +1004,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.dio_num = ARRAY_SIZE(gw5904_dio),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
+		.wdis = -1,
 	},
 
 	/* GW5905 */
@@ -1042,6 +1056,7 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.dio_num = ARRAY_SIZE(gw5904_dio),
 		.mezz_pwren = IMX_GPIO_NR(2, 19),
 		.mezz_irq = IMX_GPIO_NR(2, 18),
+		.wdis = -1,
 	},
 
 	/* GW5910 */
@@ -1055,6 +1070,18 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
 	},
+
+	/* GW5912 */
+	{
+		.gpio_pads = gw5912_gpio_pads,
+		.num_pads = ARRAY_SIZE(gw5912_gpio_pads) / 2,
+		.dio_cfg = gw54xx_dio,
+		.dio_num = ARRAY_SIZE(gw54xx_dio),
+		.wdis = IMX_GPIO_NR(1, 0),
+		.rs232_en = GP_RS232_EN,
+		.vsel_pin = IMX_GPIO_NR(6, 14),
+		.mmc_cd = IMX_GPIO_NR(7, 0),
+	},
 };
 
 #define SETUP_GPIO_OUTPUT(gpio, name, level) \
@@ -1125,7 +1152,7 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 	}
 
 	/* PCISKT_WDIS# (Wireless disable GPIO to miniPCIe sockets) */
-	if (gpio_cfg[board].wdis) {
+	if (gpio_cfg[board].wdis != -1) {
 		gpio_request(gpio_cfg[board].wdis, "wlan_dis");
 		gpio_direction_output(gpio_cfg[board].wdis, 1);
 	}
@@ -1617,6 +1644,7 @@ int board_mmc_init(struct bd_info *bis)
 	case GW54xx:
 	case GW553x:
 	case GW5910:
+	case GW5912:
 		/* usdhc3: 4bit microSD */
 		SETUP_IOMUX_PADS(usdhc3_pads);
 		usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR;
diff --git a/board/gateworks/gw_ventana/eeprom.c b/board/gateworks/gw_ventana/eeprom.c
index 1e48141160..a4f3065c7d 100644
--- a/board/gateworks/gw_ventana/eeprom.c
+++ b/board/gateworks/gw_ventana/eeprom.c
@@ -126,6 +126,8 @@ read_eeprom(int bus, struct ventana_board_info *info)
 			type = GW5909;
 		else if (info->model[4] == '1' && info->model[5] == '0')
 			type = GW5910;
+		else if (info->model[4] == '1' && info->model[5] == '2')
+			type = GW5912;
 		break;
 	default:
 		printf("EEPROM: Unknown model in EEPROM: %s\n", info->model);
diff --git a/board/gateworks/gw_ventana/ventana_eeprom.h b/board/gateworks/gw_ventana/ventana_eeprom.h
index 7c01e9edb4..9cac4a769c 100644
--- a/board/gateworks/gw_ventana/ventana_eeprom.h
+++ b/board/gateworks/gw_ventana/ventana_eeprom.h
@@ -122,6 +122,7 @@ enum {
 	GW5908,
 	GW5909,
 	GW5910,
+	GW5912,
 	GW_UNKNOWN,
 	GW_BADCRC,
 };
-- 
2.17.1


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

* [RESEND PATCH 14/16] imx: ventana: add GW5913 support
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (11 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 13/16] imx: ventana: add GW5912 support Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 15/16] imx: ventana: add support for GW53xx-G revision Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 16/16] imx: ventana: add support for GW54xx-G revision Tim Harvey
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The GW5913 is a Single Board Computer based on the NXP i.MX6Q/DL SoC
with the following features:
 - DDR3 DRAM
 - NAND FLASH (256MiB or 2048MiB)
 - Gateworks System Periperhal Controller
 - front panel LED's
 - front panel pushbutton
 - Digital I/O connector (I2C/GPIO/UART)
 - u-blox Zoe-M8Q GPS
 - 1x RJ45 GbE
 - 1x MiniPCIe socket with PCIe USB 2.0 and nanoSIM socket
 - Passive PoE and wide-range DC power supply

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

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 3a0b18672f..a4c2f5549f 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -843,6 +843,51 @@ struct dio_cfg gw5906_dio[] = {
 	},
 };
 
+struct dio_cfg gw5913_dio[] = {
+	{
+		{ IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) },
+		IMX_GPIO_NR(1, 16),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) },
+		IMX_GPIO_NR(1, 19),
+		{ IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) },
+		2
+	},
+	{
+		{ IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) },
+		IMX_GPIO_NR(1, 17),
+		{ IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) },
+		3
+	},
+	{
+		{ IOMUX_PADS(PAD_SD1_CMD__GPIO1_IO18) },
+		IMX_GPIO_NR(1, 18),
+		{ IOMUX_PADS(PAD_SD1_CMD__PWM4_OUT) },
+		4
+	},
+	{
+		{ IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15) },
+		IMX_GPIO_NR(1, 15),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14) },
+		IMX_GPIO_NR(1, 14),
+		{ 0, 0 },
+		0
+	},
+	{
+		{ IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05) },
+		IMX_GPIO_NR(4, 5),
+		{ 0, 0 },
+		0
+	},
+};
+
 /*
  * Board Specific GPIO
  */
@@ -1082,6 +1127,15 @@ struct ventana gpio_cfg[GW_UNKNOWN] = {
 		.vsel_pin = IMX_GPIO_NR(6, 14),
 		.mmc_cd = IMX_GPIO_NR(7, 0),
 	},
+
+	/* GW5913 */
+	{
+		.gpio_pads = gw5912_gpio_pads,
+		.num_pads = ARRAY_SIZE(gw5912_gpio_pads) / 2,
+		.dio_cfg = gw5913_dio,
+		.dio_num = ARRAY_SIZE(gw5913_dio),
+		.wdis = IMX_GPIO_NR(1, 0),
+	},
 };
 
 #define SETUP_GPIO_OUTPUT(gpio, name, level) \
diff --git a/board/gateworks/gw_ventana/eeprom.c b/board/gateworks/gw_ventana/eeprom.c
index a4f3065c7d..d21aa3c38f 100644
--- a/board/gateworks/gw_ventana/eeprom.c
+++ b/board/gateworks/gw_ventana/eeprom.c
@@ -128,6 +128,8 @@ read_eeprom(int bus, struct ventana_board_info *info)
 			type = GW5910;
 		else if (info->model[4] == '1' && info->model[5] == '2')
 			type = GW5912;
+		else if (info->model[4] == '1' && info->model[5] == '3')
+			type = GW5913;
 		break;
 	default:
 		printf("EEPROM: Unknown model in EEPROM: %s\n", info->model);
diff --git a/board/gateworks/gw_ventana/ventana_eeprom.h b/board/gateworks/gw_ventana/ventana_eeprom.h
index 9cac4a769c..2d5c27261e 100644
--- a/board/gateworks/gw_ventana/ventana_eeprom.h
+++ b/board/gateworks/gw_ventana/ventana_eeprom.h
@@ -123,6 +123,7 @@ enum {
 	GW5909,
 	GW5910,
 	GW5912,
+	GW5913,
 	GW_UNKNOWN,
 	GW_BADCRC,
 };
-- 
2.17.1


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

* [RESEND PATCH 15/16] imx: ventana: add support for GW53xx-G revision
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (12 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 14/16] imx: ventana: add GW5913 support Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  2021-07-24 17:40 ` [RESEND PATCH 16/16] imx: ventana: add support for GW54xx-G revision Tim Harvey
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The GW53xx-G revision has the foolowing changes:
 - replaces the EOL GbE PHY with an updated part (requires an enable pin)
 - replaces the EOL analog video decoder with an updated part
   (requires dt prop)
 - add power control to miniPCIe socket

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

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index a4c2f5549f..65e4de1dee 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -229,6 +229,10 @@ static iomux_v3_cfg_t const gw53xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG),
+	/* J6_PWREN */
+	IOMUX_PADS(PAD_EIM_DA15__GPIO3_IO15 | DIO_PAD_CFG),
+	/* PCIEGBE_EN */
+	IOMUX_PADS(PAD_EIM_DA14__GPIO3_IO14 | DIO_PAD_CFG),
 };
 
 static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
@@ -1226,6 +1230,12 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 
 	/* Anything else board specific */
 	switch(board) {
+	case GW53xx:
+		gpio_request(IMX_GPIO_NR(3, 15), "j6_pwren");
+		gpio_direction_output(IMX_GPIO_NR(3, 15), 1);
+		gpio_request(IMX_GPIO_NR(3, 14), "gbe_en");
+		gpio_direction_output(IMX_GPIO_NR(3, 14), 1);
+		break;
 	case GW560x:
 		gpio_request(IMX_GPIO_NR(4, 26), "12p0_en");
 		gpio_direction_output(IMX_GPIO_NR(4, 26), 1);
@@ -1645,6 +1655,15 @@ void ft_early_fixup(void *blob, int board_type)
 		/* GW53xx-E adds WDOG1_B external reset */
 		if (rev < 'E')
 			ft_board_wdog_fixup(blob, WDOG1_ADDR);
+
+		/* GW53xx-G has an adv7280 instead of an adv7180 */
+		else if (rev > 'F') {
+			i = fdt_node_offset_by_compatible(blob, -1, "adi,adv7180");
+			if (i) {
+				fdt_setprop_string(blob, i, "compatible", "adi,adv7280");
+				fdt_setprop_empty(blob, i, "adv,force-bt656-4");
+			}
+		}
 		break;
 
 	case GW54xx:
-- 
2.17.1


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

* [RESEND PATCH 16/16] imx: ventana: add support for GW54xx-G revision
  2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
                   ` (13 preceding siblings ...)
  2021-07-24 17:40 ` [RESEND PATCH 15/16] imx: ventana: add support for GW53xx-G revision Tim Harvey
@ 2021-07-24 17:40 ` Tim Harvey
  14 siblings, 0 replies; 16+ messages in thread
From: Tim Harvey @ 2021-07-24 17:40 UTC (permalink / raw)
  To: Stefano Babic, Fabio Estevam, NXP i . MX U-Boot Team; +Cc: u-boot, Tim Harvey

The GW54xx-G revision has the foolowing changes:
 - replaces the EOL GbE PHY with an updated part (requires an enable pin)
 - replaces the EOL analog video decoder with an updated part
   (requires dt prop)
 - add power control to miniPCIe socket

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

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 65e4de1dee..9e53765ef5 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -256,6 +256,10 @@ static iomux_v3_cfg_t const gw54xx_gpio_pads[] = {
 	IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG),
 	/* PCIESKT_WDIS# */
 	IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG),
+	/* J7_PWREN */
+	IOMUX_PADS(PAD_EIM_DA15__GPIO3_IO15 | DIO_PAD_CFG),
+	/* PCIEGBE_EN */
+	IOMUX_PADS(PAD_EIM_DA14__GPIO3_IO14 | DIO_PAD_CFG),
 };
 
 static iomux_v3_cfg_t const gw551x_gpio_pads[] = {
@@ -1236,6 +1240,12 @@ void setup_iomux_gpio(int board, struct ventana_board_info *info)
 		gpio_request(IMX_GPIO_NR(3, 14), "gbe_en");
 		gpio_direction_output(IMX_GPIO_NR(3, 14), 1);
 		break;
+	case GW54xx:
+		gpio_request(IMX_GPIO_NR(3, 15), "j7_pwren");
+		gpio_direction_output(IMX_GPIO_NR(3, 15), 1);
+		gpio_request(IMX_GPIO_NR(3, 14), "gbe_en");
+		gpio_direction_output(IMX_GPIO_NR(3, 14), 1);
+		break;
 	case GW560x:
 		gpio_request(IMX_GPIO_NR(4, 26), "12p0_en");
 		gpio_direction_output(IMX_GPIO_NR(4, 26), 1);
@@ -1677,6 +1687,15 @@ void ft_early_fixup(void *blob, int board_type)
 		/* GW54xx-E adds WDOG2_B external reset */
 		if (rev < 'E')
 			ft_board_wdog_fixup(blob, WDOG2_ADDR);
+
+		/* GW54xx-G has an adv7280 instead of an adv7180 */
+		else if (rev > 'F') {
+			i = fdt_node_offset_by_compatible(blob, -1, "adi,adv7180");
+			if (i) {
+				fdt_setprop_string(blob, i, "compatible", "adi,adv7280");
+				fdt_setprop_empty(blob, i, "adv,force-bt656-4");
+			}
+		}
 		break;
 
 	case GW551x:
-- 
2.17.1


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

end of thread, other threads:[~2021-07-24 18:08 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 17:40 [RESEND PATCH 01/16] imx: ventana: ignore EEPROM config when checking for NAND support Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 02/16] imx: ventana: move wdog/uhs-i board/revision dt fixups Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 03/16] imx: ventana: remove nand field from common ventana struct Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 04/16] imx: ventana: replace hard-coded LED config with dt based config Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 05/16] imx: ventana: remove hard-coded USB HUBRST# gpio config Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 06/16] imx: ventana: fix UMS support Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 07/16] imx: ventana: remove hard-coded PCI reset Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 08/16] imx: ventana: remove hard-coded USB OTG pinmux Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 09/16] imx: ventana: remove hard-coded analog video codec enable Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 10/16] imx: ventana: remove hard-coded flexcan standby pin Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 11/16] imx: ventana: use dt for hwmon Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 12/16] imx: ventana: add GW5910 support Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 13/16] imx: ventana: add GW5912 support Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 14/16] imx: ventana: add GW5913 support Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 15/16] imx: ventana: add support for GW53xx-G revision Tim Harvey
2021-07-24 17:40 ` [RESEND PATCH 16/16] imx: ventana: add support for GW54xx-G revision Tim Harvey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.