Skip to contentSkip to conversation

GE Board fixes and cleanups

PATCH New Sebastian Reichel 2 participants 15 messages Apr 23, 2021 – May 2, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover GE Board fixes and cleanups

Collection of downstream fixes and cleanups for GE boards.

-- Sebastian

Ian Ray (5):
configs: ge: bx50v3: adjust watchdog period
configs: ge: use non-persistent environment
include: configs: ge: bx50v3: drop USB boot
include: configs: ge: simplify default boot command
include: configs: ge: avoid shell on boot failure

Sebastian Reichel (2):
board: ge: bx50v3: fix crystal bit
board: ge: bx50v3: add phy reset GPIO

 arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 12 ++++++++++++
 board/ge/bx50v3/bx50v3.c             | 26 ++++++++++++++++++++++++++
 configs/ge_bx50v3_defconfig          |  4 ++--
 configs/mx53ppd_defconfig            |  2 +-
 include/configs/ge_bx50v3.h          | 17 +++++------------
 include/configs/mx53ppd.h            | 18 +++++++++---------
 6 files changed, 55 insertions(+), 24 deletions(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/7 board: ge: bx50v3: fix crystal bit

The DA9063 enables the CRYSTAL bit by default, but there is no crystal populated on the BA16 system on module. Without explicitly clearing the CRYSTAL bit the system runs unstable and sometimes reboots unexpectedly.

---
 board/ge/bx50v3/bx50v3.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
board/ge/bx50v3/bx50v3.c +26 -0
index 6aced4086bdd..6a4e0e601d0a 100644
@@ -31,6 +31,7 @@
 #include <asm/arch/sys_proto.h>
 #include <power/regulator.h>
 #include <power/da9063_pmic.h>
+#include <power/pmic.h>
 #include <input.h>
 #include <pwm.h>
 #include <version.h>
@@ -533,6 +534,29 @@ static const struct boot_mode board_boot_modes[] = {
 };
 #endif
 
+
+/*
+ * The SoM used by these boards has XTAL not connected despite datasheet
+ * suggesting connecting unused XTAL pins to ground. Without explicitly
+ * clearing the CRYSTAL bit the system runs unstable and sometimes reboots
+ * unexpectedly.
+ */
+static void pmic_crystal_fix(void)
+{
+	struct udevice *pmic;
+	static const uint EN_32K_CRYSTAL = (1 << 3);
+
+	if (pmic_get("pmic@58", &pmic)) {
+		puts("failed to get device for PMIC\n");
+		return;
+	}
+
+	if (pmic_clrsetbits(pmic, DA9063_REG_EN_32K, EN_32K_CRYSTAL, 0) < 0) {
+		puts("failed to clear CRYSTAL bit\n");
+		return;
+	}
+}
+
 void pmic_init(void)
 {
 	struct udevice *reg;
@@ -546,6 +570,8 @@ void pmic_init(void)
 		"bperi",
 	};
 
+	pmic_crystal_fix();
+
 	for (i = 0; i < ARRAY_SIZE(bucks); i++) {
 		ret = regulator_get_by_devname(bucks[i], &reg);
 		if (reg < 0) {
Signature · 1 line
2.30.2
#2 lore raw

PATCH 1/7 board: ge: bx50v3: fix crystal bit

Quoted 5 lines

The DA9063 enables the CRYSTAL bit by default, but there is no crystal populated on the BA16 system on module. Without explicitly clearing the CRYSTAL bit the system runs unstable and sometimes reboots unexpectedly.

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: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 2/7 board: ge: bx50v3: add phy reset GPIO

In reply to Sebastian Reichel

Add PHY's reset GPIO, so that U-Boot does a PHY hard reset. This is needed, since the PHY might become unresponsive if watchdog reboots the system while a transaction is ongoing.

The reset GPIO is added to the U-Boot specific DT files, since the kernel does not setup the reserved registers correctly after resetting the PHY and thus must not reset it.

---
 arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/dts/imx6q-bx50v3-uboot.dtsi +12 -0
index 2de3b850ec8a..b54e8e6ada74 100644
@@ -35,3 +35,15 @@
 		};
 	};
 };
+
+/*
+ * This is not done in imx6q-ba16.dtsi, since that file is shared
+ * with the kernel and the kernel should not reset the PHY, since
+ * it lacks support for configuring the reserved registeres to
+ * avoid a board specific voltage peak issue.
+ */
+&fec {
+	phy-reset-gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
+	phy-reset-duration = <1>;
+	phy-reset-post-delay = <0>;
+};
Signature · 1 line
2.30.2
#4 lore raw

PATCH 2/7 board: ge: bx50v3: add phy reset GPIO

Quoted 7 lines

Add PHY's reset GPIO, so that U-Boot does a PHY hard reset. This is needed, since the PHY might become unresponsive if watchdog reboots the system while a transaction is ongoing. The reset GPIO is added to the U-Boot specific DT files, since the kernel does not setup the reserved registers correctly after resetting the PHY and thus must not reset 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: sbabic at denx.de
=====================================================================
#5 lore raw

PATCH 3/7 configs: ge: bx50v3: adjust watchdog period

In reply to Sebastian Reichel

From: Ian Ray <[email protected]>

Increase watchdog period, in order to accomodate recent kernel size and configuration changes.

---
 configs/ge_bx50v3_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configs/ge_bx50v3_defconfig +1 -1
index f657e2929e6f..785fd30f51a5 100644
@@ -99,7 +99,7 @@ CONFIG_DM_VIDEO=y
 # CONFIG_VIDEO_BPP32 is not set
 CONFIG_SYS_WHITE_ON_BLACK=y
 CONFIG_VIDEO_IPUV3=y
-CONFIG_WATCHDOG_TIMEOUT_MSECS=6000
+CONFIG_WATCHDOG_TIMEOUT_MSECS=8000
 CONFIG_IMX_WATCHDOG=y
 CONFIG_BCH=y
 # CONFIG_EFI_LOADER is not set
Signature · 1 line
2.30.2
#6 lore raw

PATCH 3/7 configs: ge: bx50v3: adjust watchdog period

Quoted 5 lines

From: Ian Ray <[email protected]>
Increase watchdog period, in order to accomodate recent kernel size and configuration changes.

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: sbabic at denx.de
=====================================================================
#7 lore raw

PATCH 4/7 configs: ge: use non-persistent environment

In reply to Sebastian Reichel

From: Ian Ray <[email protected]>

Disable the unused persistent environment.

---
 configs/ge_bx50v3_defconfig | 2 +-
 configs/mx53ppd_defconfig   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
configs/ge_bx50v3_defconfig +1 -1
index 785fd30f51a5..79298ce41538 100644
@@ -44,7 +44,6 @@ CONFIG_OF_LIST="imx6q-bx50v3 imx6q-b850v3 imx6q-b650v3 imx6q-b450v3 imx6q-cs1kv1
 CONFIG_DTB_RESELECT=y
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_BOUNCE_BUFFER=y
@@ -103,3 +102,4 @@ CONFIG_WATCHDOG_TIMEOUT_MSECS=8000
 CONFIG_IMX_WATCHDOG=y
 CONFIG_BCH=y
 # CONFIG_EFI_LOADER is not set
+CONFIG_ENV_IS_NOWHERE=y
configs/mx53ppd_defconfig +1 -1
index be067598db77..af0e89b04844 100644
@@ -38,7 +38,6 @@ CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
-CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
@@ -79,3 +78,4 @@ CONFIG_VIDEO_IPUV3=y
 CONFIG_WATCHDOG_TIMEOUT_MSECS=8000
 CONFIG_IMX_WATCHDOG=y
 CONFIG_BCH=y
+CONFIG_ENV_IS_NOWHERE=y
Signature · 1 line
2.30.2
#8 lore raw

PATCH 4/7 configs: ge: use non-persistent environment

Quoted 4 lines

From: Ian Ray <[email protected]> Disable the unused persistent environment.

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: sbabic at denx.de
=====================================================================
#9 lore raw

PATCH 5/7 include: configs: ge: bx50v3: drop USB boot

In reply to Sebastian Reichel

From: Ian Ray <[email protected]>

Remove unsupported USB boot.

---
 include/configs/ge_bx50v3.h | 5 -----
 1 file changed, 5 deletions(-)
include/configs/ge_bx50v3.h +0 -5
index 2d854af9a06d..f1e0ec553ce6 100644
@@ -125,13 +125,8 @@
 		"run tryboot; " \
 	"fi; " \
 
-#define CONFIG_USBBOOTCOMMAND \
-	"echo Unsupported; " \
-
 #ifdef CONFIG_CMD_NFS
 #define CONFIG_BOOTCOMMAND CONFIG_NETWORKBOOTCOMMAND
-#elif CONFIG_CMD_USB
-#define CONFIG_BOOTCOMMAND CONFIG_USBBOOTCOMMAND
 #else
 #define CONFIG_BOOTCOMMAND CONFIG_MMCBOOTCOMMAND
 #endif
Signature · 1 line
2.30.2
#10 lore raw

PATCH 5/7 include: configs: ge: bx50v3: drop USB boot

Quoted 4 lines

From: Ian Ray <[email protected]> Remove unsupported USB 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: sbabic at denx.de
=====================================================================
#11 lore raw

PATCH 6/7 include: configs: ge: simplify default boot command

In reply to Sebastian Reichel

From: Ian Ray <[email protected]>

Minor cosmetic changes to unify `CONFIG_EXTRA_ENV_SETTINGS' indentation between Bx50v3 and PPD to make comparison and review easier and simplify the default boot command.

---
 include/configs/ge_bx50v3.h |  9 +++------
 include/configs/mx53ppd.h   | 15 +++++++--------
 2 files changed, 10 insertions(+), 14 deletions(-)
include/configs/ge_bx50v3.h +3 -6
index f1e0ec553ce6..a4d5752bf460 100644
@@ -92,7 +92,6 @@
 	"swappartitions=" \
 		"setexpr partnum 3 - ${partnum}\0" \
 	"failbootcmd=" \
-		"echo reached failbootcmd; " \
 		"cls; " \
 		"setcurs 5 4; " \
 		"lcdputs \"Monitor failed to start. " \
@@ -115,15 +114,13 @@
 	"tryboot=" \
 		"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
 		"run loadimage || run swappartitions && run loadimage || " \
-		"setenv partnum 0 && echo MISSING IMAGE;" \
+			"setenv partnum 0 && echo MISSING IMAGE;" \
 		"run doboot; " \
 		"run failbootcmd\0" \
 
 #define CONFIG_MMCBOOTCOMMAND \
-	"if mmc dev ${devnum}; then " \
-		"run doquiet; " \
-		"run tryboot; " \
-	"fi; " \
+	"run doquiet; " \
+	"run tryboot; " \
 
 #ifdef CONFIG_CMD_NFS
 #define CONFIG_BOOTCOMMAND CONFIG_NETWORKBOOTCOMMAND
include/configs/mx53ppd.h +7 -8
index d3133293c69d..a8c5c828bd31 100644
@@ -64,11 +64,13 @@
 		"vt.global_cursor_default=0 bootcause=${bootcause} ${quiet}\0" \
 	"bootargs_emmc=setenv bootargs root=/dev/${rootdev}${partnum} ro " \
 		"rootwait ${bootargs}\0" \
-	"doquiet=if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
-		"then setenv quiet; fi\0" \
+	"doquiet=" \
+		"if ext2load ${dev} ${devnum}:5 0x7000A000 /boot/console; " \
+			"then setenv quiet; fi\0" \
 	"hasfirstboot=" \
 		"test -e ${dev} ${devnum}:${partnum} /boot/bootcause/firstboot\0" \
-	"swappartitions=setexpr partnum 3 - ${partnum}\0" \
+	"swappartitions=" \
+		"setexpr partnum 3 - ${partnum}\0" \
 	"failbootcmd=" \
 		"cls; " \
 		"setcurs 5 4; " \
@@ -80,7 +82,6 @@
 		"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
 		"run hasfirstboot || setenv partnum 0; " \
 		"if test ${partnum} != 0; then " \
-			"setenv bootcause REVERT; " \
 			"run swappartitions loadimage doboot; " \
 		"fi; " \
 		"run failbootcmd\0" \
@@ -101,10 +102,8 @@
 		"lcd:800x480-24 at 60,monitor=lcd\0" \
 
 #define CONFIG_MMCBOOTCOMMAND \
-	"if mmc dev ${devnum}; then " \
-		"run doquiet; " \
-		"run tryboot; " \
-	"fi; " \
+	"run doquiet; " \
+	"run tryboot; " \
 
 #define CONFIG_BOOTCOMMAND CONFIG_MMCBOOTCOMMAND
 
Signature · 1 line
2.30.2
#12 lore raw

PATCH 6/7 include: configs: ge: simplify default boot command

Quoted 6 lines

From: Ian Ray <[email protected]>
Minor cosmetic changes to unify `CONFIG_EXTRA_ENV_SETTINGS' indentation between Bx50v3 and PPD to make comparison and review easier and simplify the default boot command.

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: sbabic at denx.de
=====================================================================
#13 lore raw

PATCH 7/7 include: configs: ge: avoid shell on boot failure

In reply to Sebastian Reichel

From: Ian Ray <[email protected]>

Prevent shell access on boot failure by entering an infinite loop.

---
 include/configs/ge_bx50v3.h | 3 ++-
 include/configs/mx53ppd.h   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
include/configs/ge_bx50v3.h +2 -1
index a4d5752bf460..c8e9d3b17f5e 100644
@@ -96,7 +96,8 @@
 		"setcurs 5 4; " \
 		"lcdputs \"Monitor failed to start. " \
 		"Try again, or contact GE Service for support.\"; " \
-		"bootcount reset; \0" \
+		"bootcount reset; " \
+		"while true; do sleep 1; done; \0" \
 	"altbootcmd=" \
 		"run doquiet; " \
 		"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
include/configs/mx53ppd.h +2 -1
index a8c5c828bd31..b1e6a5638b6c 100644
@@ -76,7 +76,8 @@
 		"setcurs 5 4; " \
 		"lcdputs \"Monitor failed to start. " \
 		"Try again, or contact GE Service for support.\"; " \
-		"bootcount reset; \0" \
+		"bootcount reset; " \
+		"while true; do sleep 1; done; \0" \
 	"altbootcmd=" \
 		"run doquiet; " \
 		"setenv partnum 1; run hasfirstboot || setenv partnum 2; " \
Signature · 1 line
2.30.2
#14 lore raw

PATCH 7/7 include: configs: ge: avoid shell on boot failure

Quoted 5 lines

From: Ian Ray <[email protected]>
Prevent shell access on boot failure by entering an infinite loop.

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: sbabic at denx.de
=====================================================================