[PATCH] mx6cuboxi: Convert to watchdog driver model

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset.
Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset.
Signed-off-by: Fabio Estevam festevam@gmail.com --- Christian,
Can you test this, please?
.../dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi | 10 ++++++++++ configs/mx6cuboxi_defconfig | 3 +++ 2 files changed, 13 insertions(+)
diff --git a/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi b/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi index 23a05773b579..e9b188ed6587 100644 --- a/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi +++ b/arch/arm/dts/imx6qdl-hummingboard2-emmc-som-v15-u-boot.dtsi @@ -13,6 +13,12 @@ &gpio6 4 0 >; }; + + wdt-reboot { + compatible = "wdt-reboot"; + wdt = <&wdog1>; + bootph-pre-ram; + }; };
&soc { @@ -58,3 +64,7 @@ &usdhc3 { bootph-all; }; + +&wdog1 { + bootph-pre-ram; +}; diff --git a/configs/mx6cuboxi_defconfig b/configs/mx6cuboxi_defconfig index 66d4aaeda2d9..27ceb22599a6 100644 --- a/configs/mx6cuboxi_defconfig +++ b/configs/mx6cuboxi_defconfig @@ -71,6 +71,8 @@ CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_SERIAL=y CONFIG_MXC_UART=y +CONFIG_SYSRESET=y +CONFIG_SYSRESET_WATCHDOG=y CONFIG_DM_THERMAL=y CONFIG_IMX_THERMAL=y CONFIG_USB=y @@ -89,3 +91,4 @@ CONFIG_IMX_HDMI=y CONFIG_SPLASH_SCREEN=y CONFIG_SPLASH_SCREEN_ALIGN=y CONFIG_BMP_16BPP=y +CONFIG_IMX_WATCHDOG=y

On 2024-03-27 14:18, Fabio Estevam wrote:
Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset.
Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset.
Signed-off-by: Fabio Estevam festevam@gmail.com
Christian,
Can you test this, please?
Sure.
Before the patch:
U-Boot 2024.04-rc5-00003-g774ec4fda8 (Mar 27 2024 - 16:48:35 +0100)
CPU: Freescale i.MX6Q rev1.3 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 36C Reset cause: POR Model: SolidRun HummingBoard2 Dual/Quad (1.5som+emmc) Board: MX6 Cubox-i DRAM: 2 GiB Core: 82 devices, 17 uclasses, devicetree: fit MMC: FSL_SDHC: 1, FSL_SDHC: 2 Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: eth0: ethernet@2188000 Hit any key to stop autoboot: 0 => => reset resetting ... => => => reset resetting ... => =>
After the patch:
U-Boot 2024.04-rc5-00003-g3988fdb94c (Mar 27 2024 - 17:00:03 +0100)
CPU: Freescale i.MX6Q rev1.3 996 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 36C Reset cause: POR Model: SolidRun HummingBoard2 Dual/Quad (1.5som+emmc) Board: MX6 Cubox-i DRAM: 2 GiB Core: 84 devices, 19 uclasses, devicetree: fit WDT: Started watchdog@20bc000 with servicing every 1000ms (128s timeout) MMC: FSL_SDHC: 1, FSL_SDHC: 2 Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: eth0: ethernet@2188000 Hit any key to stop autoboot: 0 => => => reset resetting ...
U-Boot SPL 2024.04-rc5-00003-g3988fdb94c (Mar 27 2024 - 17:00:03 +0100) WDT: Started watchdog@20bc000 with servicing every 1000ms (128s timeout) ...
Tested-by: Christian Gmeiner cgmeiner@igalia.com
Thanks & Regards, Christian

On Wed, Mar 27, 2024 at 11:19 AM Fabio Estevam festevam@gmail.com wrote:
Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused the 'reset' command in U-Boot to not cause a board reset.
Fix it by switching to the watchdog driver model via sysreset, which is the preferred method for implementing the watchdog reset.
Signed-off-by: Fabio Estevam festevam@gmail.com
Applied, thanks.
participants (2)
-
Christian Gmeiner
-
Fabio Estevam