[PATCH 0/7] 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(-)

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.
Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- board/ge/bx50v3/bx50v3.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/board/ge/bx50v3/bx50v3.c b/board/ge/bx50v3/bx50v3.c index 6aced4086bdd..6a4e0e601d0a 100644 --- a/board/ge/bx50v3/bx50v3.c +++ b/board/ge/bx50v3/bx50v3.c @@ -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], ®); if (reg < 0) {

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. Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

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.
Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- arch/arm/dts/imx6q-bx50v3-uboot.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/arch/arm/dts/imx6q-bx50v3-uboot.dtsi b/arch/arm/dts/imx6q-bx50v3-uboot.dtsi index 2de3b850ec8a..b54e8e6ada74 100644 --- a/arch/arm/dts/imx6q-bx50v3-uboot.dtsi +++ b/arch/arm/dts/imx6q-bx50v3-uboot.dtsi @@ -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>; +};

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. Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Ian Ray ian.ray@ge.com
Increase watchdog period, in order to accomodate recent kernel size and configuration changes.
Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- configs/ge_bx50v3_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig index f657e2929e6f..785fd30f51a5 100644 --- a/configs/ge_bx50v3_defconfig +++ b/configs/ge_bx50v3_defconfig @@ -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

From: Ian Ray ian.ray@ge.com Increase watchdog period, in order to accomodate recent kernel size and configuration changes. Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Ian Ray ian.ray@ge.com
Disable the unused persistent environment.
Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- configs/ge_bx50v3_defconfig | 2 +- configs/mx53ppd_defconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configs/ge_bx50v3_defconfig b/configs/ge_bx50v3_defconfig index 785fd30f51a5..79298ce41538 100644 --- a/configs/ge_bx50v3_defconfig +++ b/configs/ge_bx50v3_defconfig @@ -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 diff --git a/configs/mx53ppd_defconfig b/configs/mx53ppd_defconfig index be067598db77..af0e89b04844 100644 --- a/configs/mx53ppd_defconfig +++ b/configs/mx53ppd_defconfig @@ -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

From: Ian Ray ian.ray@ge.com Disable the unused persistent environment. Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Ian Ray ian.ray@ge.com
Remove unsupported USB boot.
Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- include/configs/ge_bx50v3.h | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index 2d854af9a06d..f1e0ec553ce6 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -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

From: Ian Ray ian.ray@ge.com Remove unsupported USB boot. Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Ian Ray ian.ray@ge.com
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.
Signed-off-by: Ian Ray Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- include/configs/ge_bx50v3.h | 9 +++------ include/configs/mx53ppd.h | 15 +++++++-------- 2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index f1e0ec553ce6..a4d5752bf460 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -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 diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index d3133293c69d..a8c5c828bd31 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -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@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

From: Ian Ray ian.ray@ge.com 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. Signed-off-by: Ian Ray Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic

From: Ian Ray ian.ray@ge.com
Prevent shell access on boot failure by entering an infinite loop.
Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com --- include/configs/ge_bx50v3.h | 3 ++- include/configs/mx53ppd.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/configs/ge_bx50v3.h b/include/configs/ge_bx50v3.h index a4d5752bf460..c8e9d3b17f5e 100644 --- a/include/configs/ge_bx50v3.h +++ b/include/configs/ge_bx50v3.h @@ -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; " \ diff --git a/include/configs/mx53ppd.h b/include/configs/mx53ppd.h index a8c5c828bd31..b1e6a5638b6c 100644 --- a/include/configs/mx53ppd.h +++ b/include/configs/mx53ppd.h @@ -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; " \

From: Ian Ray ian.ray@ge.com Prevent shell access on boot failure by entering an infinite loop. Signed-off-by: Ian Ray ian.ray@ge.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com
Applied to u-boot-imx, master, thanks !
Best regards, Stefano Babic
participants (2)
-
Sebastian Reichel
-
stefano.babic@babic.homelinux.org