Part Number: AM62A7-Q1
Tool/software:
I have modified the device tree for release 9.2 with the following patches:
From: Judith Mendez <jm@ti.com>
Subject: [PATCH] watchdog: rti_wdt: Set min_hw_heartbeat_ms to accommodate 5% safety margin
Date: Wed, 3 Apr 2024 16:24:26 -0500
On AM62x, the watchdog is pet before the valid window
is open. Fix min_hw_heartbeat and accommodate a 5% safety
margin with the exception of open window size < 10%,
which shall use <5% due to the smaller open window size.
Signed-off-by: Judith Mendez <jm@ti.com>
---
 drivers/watchdog/rti_wdt.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c
index 8e1be7ba0103..0b16ada659cc 100644
--- a/drivers/watchdog/rti_wdt.c
+++ b/drivers/watchdog/rti_wdt.c
@@ -92,7 +92,7 @@ static int rti_wdt_start(struct watchdog_device *wdd)
         * to be 50% or less than that; we obviouly want to configure the open
         * window as large as possible so we select the 50% option.
         */
-       wdd->min_hw_heartbeat_ms = 500 * wdd->timeout;
+       wdd->min_hw_heartbeat_ms = 550 * wdd->timeout;
        /* Generate NMI when wdt expires */
        writel_relaxed(RTIWWDRX_NMI, wdt->base + RTIWWDRXCTRL);
@@ -126,31 +126,33 @@ static int rti_wdt_setup_hw_hb(struct watchdog_device *wdd, u32 wsize)
         * be petted during the open window; not too early or not too late.
         * The HW configuration options only allow for the open window size
         * to be 50% or less than that.
+        * To avoid any glitches, we accommodate 5% safety margin, with the
+        * exception of open window size < 10%.
         */
        switch (wsize) {
        case RTIWWDSIZE_50P:
-               /* 50% open window => 50% min heartbeat */
-               wdd->min_hw_heartbeat_ms = 500 * heartbeat;
+               /* 50% open window => 55% min heartbeat */
+               wdd->min_hw_heartbeat_ms = 550 * heartbeat;
                break;
        case RTIWWDSIZE_25P:
-               /* 25% open window => 75% min heartbeat */
-               wdd->min_hw_heartbeat_ms = 750 * heartbeat;
+               /* 25% open window => 80% min heartbeat */
+               wdd->min_hw_heartbeat_ms = 800 * heartbeat;
                break;
        case RTIWWDSIZE_12P5:
-               /* 12.5% open window => 87.5% min heartbeat */
-               wdd->min_hw_heartbeat_ms = 875 * heartbeat;
+               /* 12.5% open window => 92.5% min heartbeat */
+               wdd->min_hw_heartbeat_ms = 925 * heartbeat;
                break;
        case RTIWWDSIZE_6P25:
-               /* 6.5% open window => 93.5% min heartbeat */
-               wdd->min_hw_heartbeat_ms = 935 * heartbeat;
+               /* 6.5% open window => 96.5% min heartbeat */
+               wdd->min_hw_heartbeat_ms = 965 * heartbeat;
                break;
        case RTIWWDSIZE_3P125:
-               /* 3.125% open window => 96.9% min heartbeat */
-               wdd->min_hw_heartbeat_ms = 969 * heartbeat;
+               /* 3.125% open window => 97.9% min heartbeat */
+               wdd->min_hw_heartbeat_ms = 979 * heartbeat;
                break;
        default:
--
2.43.2From 64aa78a25bbfbbd037d1f756e0a6cee0bc6c876f Mon Sep 17 00:00:00 2001
From: Bas Vermeulen <sebastiaan.vermeulen@bench.com>
Date: Wed, 17 Jul 2024 12:26:21 +0200
Subject: [PATCH] arm64: boot: dts: ti: am62a: add main_esm and main_rti* nodes
Add watchdog and esm node for am62a
---
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 52 +++++++++++++++++++++++
 1 file changed, 52 insertions(+)
diff --git a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
index 1b3b492c7086..ab5c479f7851 100644
--- a/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62a-main.dtsi
@@ -248,6 +248,13 @@ main_pmx0: pinctrl@f4000 {
                #interrupt-cells = <1>;
        };
+       main_esm: esm@420000 {
+               compatible = "ti,j721e-esm";
+               reg = <0x0 0x420000 0x0 0x1000>;
+               ti,esm-pins = <192>, <193>, <195>, <209>, <210>, <204>;
+               bootph-pre-ram;
+       };
+
        main_timer0: timer@2400000 {
                compatible = "ti,am654-timer";
                reg = <0x00 0x2400000 0x00 0x400>;
@@ -819,6 +826,51 @@ main_mcan0: can@20701000 {
                status = "disabled";
        };
+       main_rti0: watchdog@e000000 {
+               compatible = "ti,j7-rti-wdt";
+               reg = <0x00 0x0e000000 0x00 0x100>;
+               clocks = <&k3_clks 125 0>;
+               power-domains = <&k3_pds 125 TI_SCI_PD_EXCLUSIVE>;
+               assigned-clocks = <&k3_clks 125 0>;
+               assigned-clock-parents = <&k3_clks 125 2>;
+       };
+
+       main_rti1: watchdog@e010000 {
+               compatible = "ti,j7-rti-wdt";
+               reg = <0x00 0x0e010000 0x00 0x100>;
+               clocks = <&k3_clks 126 0>;
+               power-domains = <&k3_pds 126 TI_SCI_PD_EXCLUSIVE>;
+               assigned-clocks = <&k3_clks 126 0>;
+               assigned-clock-parents = <&k3_clks 126 2>;
+       };
+
+       main_rti2: watchdog@e020000 {
+               compatible = "ti,j7-rti-wdt";
+               reg = <0x00 0x0e020000 0x00 0x100>;
+               clocks = <&k3_clks 127 0>;
+               power-domains = <&k3_pds 127 TI_SCI_PD_EXCLUSIVE>;
+               assigned-clocks = <&k3_clks 127 0>;
+               assigned-clock-parents = <&k3_clks 127 2>;
+       };
+
+       main_rti3: watchdog@e030000 {
+               compatible = "ti,j7-rti-wdt";
+               reg = <0x00 0x0e030000 0x00 0x100>;
+               clocks = <&k3_clks 128 0>;
+               power-domains = <&k3_pds 128 TI_SCI_PD_EXCLUSIVE>;
+               assigned-clocks = <&k3_clks 128 0>;
+               assigned-clock-parents = <&k3_clks 128 2>;
+       };
+
+       main_rti4: watchdog@e040000 {
+               compatible = "ti,j7-rti-wdt";
+               reg = <0x00 0x0e040000 0x00 0x100>;
+               clocks = <&k3_clks 205 0>;
+               power-domains = <&k3_pds 205 TI_SCI_PD_EXCLUSIVE>;
+               assigned-clocks = <&k3_clks 205 0>;
+               assigned-clock-parents = <&k3_clks 205 2>;
+       };
+
        epwm0: pwm@23000000 {
                compatible = "ti,am64-epwm", "ti,am3352-ehrpwm";
                #pwm-cells = <3>;
--
2.34.1
This adds the main_esm node (with ti,esm-pins from the E2E thread on here), and adds 5 watchdog nodes.
When I do a cat /dev/watchdog, since the kernel is compiled with nowayout, the board should reboot after the watchdog times out.
Unfortunately, it does not.
My questions:
- Am I using the correct ti,esm-pins for main_esm combined with the AM62A?
- Are the watchdog devices correct in the device tree patch? (Taken from ti-6.6.y, as referenced in another watchdog thread)
- Should I get the reboot I am expecting if I open /dev/watchdog0 and close it again (provided nowayout is set).
Any help would be appreciated, and I am available to test.
Regards,
Bas Vermeulen
 
				 
		 
					 
                           
				