diff mbox series

warp7: Convert to watchdog driver model

Message ID 20240327134651.2113527-1-festevam@gmail.com
State Accepted
Commit ea2b074a1ca646a9a88454753af0676599917b02
Delegated to: Fabio Estevam
Headers show
Series warp7: Convert to watchdog driver model | expand

Commit Message

Fabio Estevam March 27, 2024, 1:46 p.m. UTC
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>
---
 arch/arm/dts/imx7s-warp-u-boot.dtsi | 10 ++++++++++
 configs/warp7_defconfig             |  3 +++
 2 files changed, 13 insertions(+)

Comments

Peng Fan March 27, 2024, 11:41 p.m. UTC | #1
> Subject: [PATCH] warp7: 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>

Reviewed-by: Peng Fan <peng.fan@nxp.com>
> ---
>  arch/arm/dts/imx7s-warp-u-boot.dtsi | 10 ++++++++++
>  configs/warp7_defconfig             |  3 +++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/arch/arm/dts/imx7s-warp-u-boot.dtsi b/arch/arm/dts/imx7s-warp-
> u-boot.dtsi
> index 4f44598c9a27..98784fd7a2ef 100644
> --- a/arch/arm/dts/imx7s-warp-u-boot.dtsi
> +++ b/arch/arm/dts/imx7s-warp-u-boot.dtsi
> @@ -7,6 +7,12 @@
>  	chosen {
>  		stdout-path = &uart1;
>  	};
> +
> +	wdt-reboot {
> +		compatible = "wdt-reboot";
> +		wdt = <&wdog1>;
> +		bootph-pre-ram;
> +	};
>  };
> 
>  &aips3 {
> @@ -24,3 +30,7 @@
>  &uart1 {
>  	bootph-all;
>  };
> +
> +&wdog1 {
> +	bootph-pre-ram;
> +};
> diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index
> 9b518a121be6..48042b702c22 100644
> --- a/configs/warp7_defconfig
> +++ b/configs/warp7_defconfig
> @@ -67,6 +67,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_USB=y
>  CONFIG_USB_EHCI_HCD=y
> @@ -80,5 +82,6 @@ CONFIG_USB_GADGET_DOWNLOAD=y
> CONFIG_USB_ETHER=y  CONFIG_USB_ETH_CDC=y
> CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
> +CONFIG_IMX_WATCHDOG=y
>  CONFIG_OPTEE_TZDRAM_SIZE=0x3000000
>  CONFIG_BOOTM_OPTEE=y
> --
> 2.34.1
Fabio Estevam March 30, 2024, 5:37 p.m. UTC | #2
On Wed, Mar 27, 2024 at 10:46 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.
diff mbox series

Patch

diff --git a/arch/arm/dts/imx7s-warp-u-boot.dtsi b/arch/arm/dts/imx7s-warp-u-boot.dtsi
index 4f44598c9a27..98784fd7a2ef 100644
--- a/arch/arm/dts/imx7s-warp-u-boot.dtsi
+++ b/arch/arm/dts/imx7s-warp-u-boot.dtsi
@@ -7,6 +7,12 @@ 
 	chosen {
 		stdout-path = &uart1;
 	};
+
+	wdt-reboot {
+		compatible = "wdt-reboot";
+		wdt = <&wdog1>;
+		bootph-pre-ram;
+	};
 };
 
 &aips3 {
@@ -24,3 +30,7 @@ 
 &uart1 {
 	bootph-all;
 };
+
+&wdog1 {
+	bootph-pre-ram;
+};
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 9b518a121be6..48042b702c22 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -67,6 +67,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_USB=y
 CONFIG_USB_EHCI_HCD=y
@@ -80,5 +82,6 @@  CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_ETHER=y
 CONFIG_USB_ETH_CDC=y
 CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00"
+CONFIG_IMX_WATCHDOG=y
 CONFIG_OPTEE_TZDRAM_SIZE=0x3000000
 CONFIG_BOOTM_OPTEE=y