From b7a53735d55e36b4aa0428d5192175ee7cb5239c Mon Sep 17 00:00:00 2001 From: Ozan Durgut Date: Mon, 3 Aug 2026 20:52:51 +0200 Subject: [PATCH 1/2] Revert "watchdog: adi_wdt: get SEC fault source ID from DT" This reverts commit ebfefb80d517de9966fdaf5290c485876b843eab. --- arch/arm/dts/sc57x.dtsi | 1 - arch/arm/dts/sc58x.dtsi | 1 - arch/arm/dts/sc594-som.dtsi | 1 - arch/arm/dts/sc598-som.dtsi | 1 - drivers/watchdog/adi_wdt.c | 9 +-------- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/arch/arm/dts/sc57x.dtsi b/arch/arm/dts/sc57x.dtsi index 794e80c3cf16..e4cc612959fc 100644 --- a/arch/arm/dts/sc57x.dtsi +++ b/arch/arm/dts/sc57x.dtsi @@ -113,7 +113,6 @@ &wdog { clocks = <&clk ADSP_SC57X_CLK_CGU0_SCLK0>; - secid = <3>; }; ð0 { diff --git a/arch/arm/dts/sc58x.dtsi b/arch/arm/dts/sc58x.dtsi index d4008ba7988b..7b07589de47f 100644 --- a/arch/arm/dts/sc58x.dtsi +++ b/arch/arm/dts/sc58x.dtsi @@ -158,7 +158,6 @@ &wdog { clocks = <&clk ADSP_SC58X_CLK_CGU0_SCLK0>; - secid = <3>; }; ð0 { diff --git a/arch/arm/dts/sc594-som.dtsi b/arch/arm/dts/sc594-som.dtsi index 59a012fca67d..c4373aea60f4 100644 --- a/arch/arm/dts/sc594-som.dtsi +++ b/arch/arm/dts/sc594-som.dtsi @@ -67,7 +67,6 @@ &wdog { clocks = <&clk ADSP_SC594_CLK_CGU0_SCLK0>; - secid = <3>; }; &i2c0 { diff --git a/arch/arm/dts/sc598-som.dtsi b/arch/arm/dts/sc598-som.dtsi index 4b8ee1d397ea..ac1f24c86c39 100644 --- a/arch/arm/dts/sc598-som.dtsi +++ b/arch/arm/dts/sc598-som.dtsi @@ -124,7 +124,6 @@ &wdog { clocks = <&clk ADSP_SC598_CLK_CGU0_SCLK0>; - secid = <3>; }; &i2c0 { diff --git a/drivers/watchdog/adi_wdt.c b/drivers/watchdog/adi_wdt.c index 8e7ff958121c..7d7cf98b55eb 100644 --- a/drivers/watchdog/adi_wdt.c +++ b/drivers/watchdog/adi_wdt.c @@ -36,7 +36,6 @@ struct adi_wdt_priv { void __iomem *rcu_base; void __iomem *sec_base; void __iomem *wdt_base; - u32 secid; struct clk clock; }; @@ -73,7 +72,7 @@ static int adi_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) iowrite32(0xc1, priv->sec_base + SEC_FCTL); /* enable SEC fault source for watchdog0 */ - setbits_32(priv->sec_base + SEC_SCTL0 + (priv->secid * 8), 0x6); + setbits_32(priv->sec_base + SEC_SCTL0 + (3*8), 0x6); /* Enable SYSCD_RESETb input */ iowrite32(0x100, priv->rcu_base + RCU_CTL); @@ -96,7 +95,6 @@ static int adi_wdt_probe(struct udevice *dev) struct adi_wdt_priv *priv = dev_get_priv(dev); int ret; struct resource res; - u32 secid; ret = dev_read_resource_byname(dev, "rcu", &res); if (ret) @@ -113,11 +111,6 @@ static int adi_wdt_probe(struct udevice *dev) return ret; priv->wdt_base = devm_ioremap(dev, res.start, resource_size(&res)); - ret = dev_read_u32(dev, "secid", &secid); - if (ret) - return ret; - priv->secid = secid; - ret = clk_get_by_name(dev, "sclk0", &priv->clock); if (ret < 0) { printf("Can't get WDT clk: %d\n", ret); From 6ddc687fd3753ad94d0a219861e9aa73c92cdb20 Mon Sep 17 00:00:00 2001 From: UtsavAgarwalADI Date: Mon, 2 Feb 2026 19:04:38 +0100 Subject: [PATCH 2/2] watchdog: adi_wdt: get SEC fault source ID from DT The ADI watchdog drives a reset through a Security (SEC) controller fault source. The source index was hardcoded to 3 in adi_wdt_start(), which is only correct for the SC5xx parts that happen to use that index; other ADI SoCs map WDOG0 to a different SEC fault source. Read the index from a new "adi,secid" device tree property so boards that route the watchdog fault to a different SEC source can configure it. The property is required; if it is absent the driver prints a diagnostic and fails to probe, which makes a stale device tree from before this change easy to spot. Set adi,secid = <3> in the SC57x, SC58x, SC594 and SC598 device trees to match the value they relied on before. Link: https://lore.kernel.org/u-boot/20260730190256.114708-1-ozndrgt@gmail.com/ Co-developed-by: Ozan Durgut Signed-off-by: Ozan Durgut Signed-off-by: UtsavAgarwalADI --- arch/arm/dts/sc57x.dtsi | 1 + arch/arm/dts/sc58x.dtsi | 1 + arch/arm/dts/sc594-som.dtsi | 1 + arch/arm/dts/sc598-som.dtsi | 1 + drivers/watchdog/adi_wdt.c | 10 +++++++++- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/sc57x.dtsi b/arch/arm/dts/sc57x.dtsi index e4cc612959fc..3eff76c94096 100644 --- a/arch/arm/dts/sc57x.dtsi +++ b/arch/arm/dts/sc57x.dtsi @@ -113,6 +113,7 @@ &wdog { clocks = <&clk ADSP_SC57X_CLK_CGU0_SCLK0>; + adi,secid = <3>; }; ð0 { diff --git a/arch/arm/dts/sc58x.dtsi b/arch/arm/dts/sc58x.dtsi index 7b07589de47f..abc58adf8472 100644 --- a/arch/arm/dts/sc58x.dtsi +++ b/arch/arm/dts/sc58x.dtsi @@ -158,6 +158,7 @@ &wdog { clocks = <&clk ADSP_SC58X_CLK_CGU0_SCLK0>; + adi,secid = <3>; }; ð0 { diff --git a/arch/arm/dts/sc594-som.dtsi b/arch/arm/dts/sc594-som.dtsi index c4373aea60f4..bfb3dc6c889d 100644 --- a/arch/arm/dts/sc594-som.dtsi +++ b/arch/arm/dts/sc594-som.dtsi @@ -67,6 +67,7 @@ &wdog { clocks = <&clk ADSP_SC594_CLK_CGU0_SCLK0>; + adi,secid = <3>; }; &i2c0 { diff --git a/arch/arm/dts/sc598-som.dtsi b/arch/arm/dts/sc598-som.dtsi index ac1f24c86c39..026ee11c49c0 100644 --- a/arch/arm/dts/sc598-som.dtsi +++ b/arch/arm/dts/sc598-som.dtsi @@ -124,6 +124,7 @@ &wdog { clocks = <&clk ADSP_SC598_CLK_CGU0_SCLK0>; + adi,secid = <3>; }; &i2c0 { diff --git a/drivers/watchdog/adi_wdt.c b/drivers/watchdog/adi_wdt.c index 7d7cf98b55eb..55a68ea0b324 100644 --- a/drivers/watchdog/adi_wdt.c +++ b/drivers/watchdog/adi_wdt.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,7 @@ struct adi_wdt_priv { void __iomem *rcu_base; void __iomem *sec_base; void __iomem *wdt_base; + u32 secid; struct clk clock; }; @@ -72,7 +74,7 @@ static int adi_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags) iowrite32(0xc1, priv->sec_base + SEC_FCTL); /* enable SEC fault source for watchdog0 */ - setbits_32(priv->sec_base + SEC_SCTL0 + (3*8), 0x6); + setbits_32(priv->sec_base + SEC_SCTL0 + (priv->secid * 8), 0x6); /* Enable SYSCD_RESETb input */ iowrite32(0x100, priv->rcu_base + RCU_CTL); @@ -111,6 +113,12 @@ static int adi_wdt_probe(struct udevice *dev) return ret; priv->wdt_base = devm_ioremap(dev, res.start, resource_size(&res)); + ret = dev_read_u32(dev, "adi,secid", &priv->secid); + if (ret) { + dev_err(dev, "Missing property 'adi,secid'\n"); + return ret; + } + ret = clk_get_by_name(dev, "sclk0", &priv->clock); if (ret < 0) { printf("Can't get WDT clk: %d\n", ret);