diff mbox series

[3/3] smegw01: Convert to watchdog driver model

Message ID 20230808214040.1382330-3-festevam@gmail.com
State Awaiting Upstream
Delegated to: Stefano Babic
Headers show
Series [1/3] imx7d-sdb-u-boot: Pass SPDX-License tag | expand

Commit Message

Fabio Estevam Aug. 8, 2023, 9:40 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

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@denx.de>
---
 arch/arm/dts/imx7d-smegw01-u-boot.dtsi | 13 +++++++++++++
 configs/smegw01_defconfig              |  3 +++
 2 files changed, 16 insertions(+)
 create mode 100644 arch/arm/dts/imx7d-smegw01-u-boot.dtsi

Comments

Marek Vasut Aug. 8, 2023, 9:46 p.m. UTC | #1
On 8/8/23 23:40, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> 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@denx.de>

Reviewed-by: Marek Vasut <marex@denx.de>
Stefano Babic Oct. 16, 2023, 4:46 p.m. UTC | #2
> From: Fabio Estevam <festevam@denx.de>
> 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@denx.de>
> Reviewed-by: Marek Vasut <marex@denx.de>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/dts/imx7d-smegw01-u-boot.dtsi b/arch/arm/dts/imx7d-smegw01-u-boot.dtsi
new file mode 100644
index 000000000000..cf7ba3a95817
--- /dev/null
+++ b/arch/arm/dts/imx7d-smegw01-u-boot.dtsi
@@ -0,0 +1,13 @@ 
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/ {
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+		bootph-pre-ram;
+	};
+};
+
+&wdog1 {
+	bootph-pre-ram;
+};
diff --git a/configs/smegw01_defconfig b/configs/smegw01_defconfig
index 7f1b2bee8e16..a3d289eeca1a 100644
--- a/configs/smegw01_defconfig
+++ b/configs/smegw01_defconfig
@@ -80,5 +80,8 @@  CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPECIFY_CONSOLE_INDEX=y
 CONFIG_DM_SERIAL=y
 CONFIG_MXC_UART=y
+CONFIG_SYSRESET=y
+CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_IMX_THERMAL=y
+CONFIG_IMX_WATCHDOG=y
 # CONFIG_CMD_BOOTEFI_BOOTMGR is not set