Skip to contentSkip to conversation

board: gateworks: venice: gsc: fix typo

PATCH New Tim Harvey 2 participants 10 messages Jul 1, 2021 – Jul 10, 2021 Arm i.MX and Layerscape

lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

PATCH 1/5 board: gateworks: venice: gsc: fix typo

Fix typo in error message.

---
 board/gateworks/venice/gsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/gateworks/venice/gsc.c +1 -1
index d2490e6063..23ad58094c 100644
@@ -176,7 +176,7 @@ static int gsc_read_eeprom(int bus, int slave, int alen, struct venice_board_inf
 		chksum += buf[i];
 	if ((info->chksum[0] != chksum >> 8) ||
 	    (info->chksum[1] != (chksum & 0xff))) {
-		printf("EEPROM: I2C%d@0x%02x: Invalid Model in EEPROM\n", bus, slave);
+		printf("EEPROM: I2C%d@0x%02x: Invalid Checksum\n", bus, slave);
 		print_hex_dump_bytes("", DUMP_PREFIX_NONE, buf, sizeof(*info));
 		memset(info, 0, sizeof(*info));
 		return -EINVAL;
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/5 board: gateworks: venice: gsc: fix voltage offset

The voltage offset property is in microvolts so must be scaled accordingly.

---
 board/gateworks/venice/gsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/gateworks/venice/gsc.c +1 -1
index 23ad58094c..9a6712ec88 100644
@@ -298,7 +298,7 @@ int gsc_hwmon(void)
 				}
 
 				/* adjust by offset */
-				val += offset;
+				val += (offset / 1000);
 
 				printf("%-8s: %d.%03dV\n", label, val / 1000, val % 1000);
 				break;
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/5 board: gateworks: venice: gsc: fix voltage offset

Quoted 3 lines

The voltage offset property is in microvolts so must be scaled accordingly.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#3 lore raw

PATCH 3/5 board: gateworks: venice: display DTB used

In reply to Tim Harvey

Display the DTB file used for U-Boot.

---
 board/gateworks/venice/imx8mm_venice.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
board/gateworks/venice/imx8mm_venice.c +5 -1
index 1d51b6ea9b..cb00f532bf 100644
@@ -42,12 +42,16 @@ int board_fit_config_name_match(const char *name)
 {
 	int i  = 0;
 	const char *dtb;
+	static char init;
 	char buf[32];
 
 	do {
 		dtb = gsc_get_dtb_name(i++, buf, sizeof(buf));
-		if (!strcmp(dtb, name))
+		if (!strcmp(dtb, name)) {
+			if (!init++)
+				printf("DTB     : %s\n", name);
 			return 0;
+		}
 	} while (dtb);
 
 	return -1;
Signature · 1 line
2.17.1
#4 lore raw

PATCH 3/5 board: gateworks: venice: display DTB used

Quoted 2 lines

Display the DTB file used for U-Boot.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#5 lore raw

PATCH 4/5 board: gateworks: venice: add ftd_file env vars on boot

In reply to Tim Harvey

The ftd_file* vars can be used by bootscripts to look for appropriate dtb's

---
 board/gateworks/venice/imx8mm_venice.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
board/gateworks/venice/imx8mm_venice.c +16 -3
index cb00f532bf..2657bd675f 100644
@@ -105,13 +105,26 @@ int board_init(void)
 
 int board_late_init(void)
 {
-	const char *ethmac;
+	const char *str;
 	char env[32];
 	int ret, i;
 	u8 enetaddr[6];
+	char fdt[64];
 
 	led_default_state();
 
+	/* Set fdt_file vars */
+	i = 0;
+	do {
+		str = gsc_get_dtb_name(i, fdt, sizeof(fdt));
+		if (str) {
+			sprintf(env, "fdt_file%d", i + 1);
+			strcat(fdt, ".dtb");
+			env_set(env, fdt);
+		}
+		i++;
+	} while (str);
+
 	/* Set mac addrs */
 	i = 0;
 	do {
@@ -119,8 +132,8 @@ int board_late_init(void)
 			sprintf(env, "eth%daddr", i);
 		else
 			sprintf(env, "ethaddr");
-		ethmac = env_get(env);
-		if (!ethmac) {
+		str = env_get(env);
+		if (!str) {
 			ret = gsc_getmac(i, enetaddr);
 			if (!ret)
 				eth_env_set_enetaddr(env, enetaddr);
Signature · 1 line
2.17.1
#6 lore raw

PATCH 4/5 board: gateworks: venice: add ftd_file env vars on boot

Quoted 3 lines

The ftd_file* vars can be used by bootscripts to look for appropriate dtb's

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
author
#7 lore raw

PATCH 5/5 board: gateworks: venice: remove forced enable of GSC thermal protection

In reply to Tim Harvey

The Gateworks System Controller thermal protection feature will disable the board primary power supply if the on-board temperature sensor reaches 86C. In many cases this could occur before the temperature critical components such as CPU, DRAM, eMMC, and power supplies have reached their max temperature.

Remove the forced re-enable of thermal protection so that users can knowingly disable it.

---
 board/gateworks/venice/gsc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
board/gateworks/venice/gsc.c +5 -3
index 9a6712ec88..c75bc6f855 100644
@@ -221,9 +221,11 @@ static const char *gsc_get_rst_cause(struct udevice *dev)
 
 	/* thermal protection */
 	if (!dm_i2c_read(dev, GSC_SC_THERM_PROTECT, &reg, 1)) {
-		reg |= 1;
-		dm_i2c_write(dev, GSC_SC_THERM_PROTECT, &reg, 1);
-		strcat(str, " Thermal Protection Enabled");
+		strcat(str, " Thermal Protection ");
+		if (reg & BIT(0))
+			strcat(str, "Enabled");
+		else
+			strcat(str, "Disabled");
 	}
 
 	return str;
Signature · 1 line
2.17.1
#8 lore raw

PATCH 5/5 board: gateworks: venice: remove forced enable of GSC thermal protection

Quoted 8 lines

The Gateworks System Controller thermal protection feature will disable the board primary power supply if the on-board temperature sensor reaches 86C. In many cases this could occur before the temperature critical components such as CPU, DRAM, eMMC, and power supplies have reached their max temperature.
Remove the forced re-enable of thermal protection so that users can knowingly disable it.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#9 lore raw

PATCH 1/5 board: gateworks: venice: gsc: fix typo

In reply to Tim Harvey
Quoted 2 lines

Fix typo in error message.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================