diff mbox series

[05/11] imx: ventana: add PMIC fix for GW54xx-G

Message ID 20210611194628.5572-5-tharvey@gateworks.com
State Accepted
Commit a32be88da0b2908f464ba6263ef82630b851df59
Delegated to: Stefano Babic
Headers show
Series [01/11] imx: ventana: remove USB_KEYBOARD support | expand

Commit Message

Tim Harvey June 11, 2021, 7:46 p.m. UTC
Substitutions in EOL parts changes the VDD_2P5 voltage rail such that
the previously unused VGEN6 LDO is needed in place of the lower power
VGEN5 for the GW54xx-G.

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

Comments

Stefano Babic July 10, 2021, 3:53 p.m. UTC | #1
> Substitutions in EOL parts changes the VDD_2P5 voltage rail such that
> the previously unused VGEN6 LDO is needed in place of the lower power
> VGEN5 for the GW54xx-G.
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
Stefano Babic July 10, 2021, 7:36 p.m. UTC | #2
> Substitutions in EOL parts changes the VDD_2P5 voltage rail such that
> the previously unused VGEN6 LDO is needed in place of the lower power
> VGEN5 for the GW54xx-G.
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/board/gateworks/gw_ventana/common.c b/board/gateworks/gw_ventana/common.c
index 4627a156fe..9f5f20f781 100644
--- a/board/gateworks/gw_ventana/common.c
+++ b/board/gateworks/gw_ventana/common.c
@@ -1550,6 +1550,17 @@  void setup_pmic(void)
 	int board = read_eeprom(CONFIG_I2C_GSC, &ventana_info);
 	const int i2c_pmic = 1;
 	u32 reg;
+	char rev;
+	int i;
+
+	/* determine board revision */
+	rev = 'A';
+	for (i = sizeof(ventana_info.model) - 1; i > 0; i--) {
+		if (ventana_info.model[i] >= 'A') {
+			rev = ventana_info.model[i];
+			break;
+		}
+	}
 
 	i2c_set_bus_num(i2c_pmic);
 
@@ -1573,6 +1584,17 @@  void setup_pmic(void)
 			reg &= ~(SWBST_MODE_MASK | SWBST_VOL_MASK);
 			reg |= (SWBST_5_00V | (SWBST_MODE_AUTO << SWBST_MODE_SHIFT));
 			pmic_reg_write(p, PFUZE100_SWBSTCON1, reg);
+
+			if (board == GW54xx && (rev == 'G')) {
+				/* Disable VGEN5 */
+				pmic_reg_write(p, PFUZE100_VGEN5VOL, 0);
+
+				/* Set VGEN6 to 2.5V and enable */
+				pmic_reg_read(p, PFUZE100_VGEN6VOL, &reg);
+				reg &= ~(LDO_VOL_MASK);
+				reg |= (LDOB_2_50V | LDO_EN);
+				pmic_reg_write(p, PFUZE100_VGEN6VOL, reg);
+			}
 		}
 	}