Skip to contentSkip to conversation

dt-bindings: watchdog: move i.MX system controller watchdog binding to SCU

PATCH RESEND In review [email protected] 2 participants 4 messages May 27, 2019 – Jun 8, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v4 1/3 dt-bindings: watchdog: move i.MX system controller watchdog binding to SCU

From: Anson Huang <[email protected]>

i.MX system controller watchdog depends on SCU driver to support interrupt function, so it needs to be subnode of SCU node in DT, binding doc should be moved to fsl,scu.txt as well.

---
No changes, just rebase the patch to top of linux-next.

---
 .../devicetree/bindings/arm/freescale/fsl,scu.txt  | 15 ++++++++++++++
 .../bindings/watchdog/fsl-imx-sc-wdt.txt           | 24 ----------------------
 2 files changed, 15 insertions(+), 24 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +15 -0
index f378922..a575e42 100644
@@ -145,6 +145,16 @@ Optional Child nodes:
 - Data cells of ocotp:
   Detailed bindings are described in bindings/nvmem/nvmem.txt
 
+Watchdog bindings based on SCU Message Protocol
+------------------------------------------------------------
+
+Required properties:
+- compatible: should be:
+              "fsl,imx8qxp-sc-wdt"
+              followed by "fsl,imx-sc-wdt";
+Optional properties:
+- timeout-sec: contains the watchdog timeout in seconds.
+
 Example (imx8qxp):
 -------------
 aliases {
@@ -207,6 +217,11 @@ firmware {
 		rtc: rtc {
 			compatible = "fsl,imx8qxp-sc-rtc";
 		};
+
+		watchdog {
+			compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
+			timeout-sec = <60>;
+		};
 	};
 };
 
Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt deleted +0 -24
deleted file mode 100644
index 02b87e9..0000000
@@ -1,24 +0,0 @@
-* Freescale i.MX System Controller Watchdog
-
-i.MX system controller watchdog is for i.MX SoCs with system controller inside,
-the watchdog is managed by system controller, users can ONLY communicate with
-system controller from secure mode for watchdog operations, so Linux i.MX system
-controller watchdog driver will call ARM SMC API and trap into ARM-Trusted-Firmware
-for watchdog operations, ARM-Trusted-Firmware is running at secure EL3 mode and
-it will request system controller to execute the watchdog operation passed from
-Linux kernel.
-
-Required properties:
-- compatible:	Should be :
-		"fsl,imx8qxp-sc-wdt"
-		followed by "fsl,imx-sc-wdt";
-
-Optional properties:
-- timeout-sec : Contains the watchdog timeout in seconds.
-
-Examples:
-
-watchdog {
-	compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
-	timeout-sec = <60>;
-};
Signature · 1 line
2.7.4
#1 lore raw

PATCH RESEND v4 2/3 arm64: dts: imx8qxp: Move watchdog node into scu node

From: Anson Huang <[email protected]>

i.MX system controller watchdog has pretimeout function which depends on i.MX SCU driver, so it should be a subnode of SCU.

---
No change, just rebase the patch to top of linux-next.

---
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/freescale/imx8qxp.dtsi +5 -5
index fbfae90..9f52da6 100644
@@ -157,6 +157,11 @@
 		rtc: rtc {
 			compatible = "fsl,imx8qxp-sc-rtc";
 		};
+
+		watchdog {
+			compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
+			timeout-sec = <60>;
+		};
 	};
 
 	timer {
@@ -525,9 +530,4 @@
 			power-domains = <&pd IMX_SC_R_GPIO_7>;
 		};
 	};
-
-	watchdog {
-		compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
-		timeout-sec = <60>;
-	};
 };
Signature · 1 line
2.7.4
#2 lore raw

PATCH RESEND v4 3/3 watchdog: imx_sc: Add pretimeout support

In reply to [email protected]

From: Anson Huang <[email protected]>

i.MX system controller watchdog can support pretimeout IRQ via general SCU MU IRQ, it depends on IMX_SCU and driver MUST be probed after SCU IPC ready, then enable corresponding SCU IRQ group and register SCU IRQ notifier, when watchdog pretimeout IRQ fires, SCU MU IRQ will be handled and watchdog pretimeout notifier will be called to handle the event.

---
No change, just rebase the patch to top of linux-next.

---
 drivers/watchdog/Kconfig      |   1 +
 drivers/watchdog/imx_sc_wdt.c | 116 +++++++++++++++++++++++++++++++++++-------
 2 files changed, 98 insertions(+), 19 deletions(-)
drivers/watchdog/Kconfig +1 -0
index ffe7545..975e573 100644
@@ -717,6 +717,7 @@ config IMX2_WDT
 config IMX_SC_WDT
 	tristate "IMX SC Watchdog"
 	depends on HAVE_ARM_SMCCC
+	depends on IMX_SCU
 	select WATCHDOG_CORE
 	help
 	  This is the driver for the system controller watchdog
drivers/watchdog/imx_sc_wdt.c +97 -19

180 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Reviewed-by on v4 1/3
#3 lore raw
In reply to [email protected]
Quoted 8 lines · On Mon, May 27, 2019 at 03:03:15PM +0800, [email protected] wrote:

From: Anson Huang <[email protected]>

i.MX system controller watchdog depends on SCU driver to support interrupt function, so it needs to be subnode of SCU node in DT, binding doc should be moved to fsl,scu.txt as well.

Quoted 71 lines

---
No changes, just rebase the patch to top of linux-next.

---
 .../devicetree/bindings/arm/freescale/fsl,scu.txt  | 15 ++++++++++++++
 .../bindings/watchdog/fsl-imx-sc-wdt.txt           | 24 ----------------------
 2 files changed, 15 insertions(+), 24 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +15 -0
index f378922..a575e42 100644
@@ -145,6 +145,16 @@ Optional Child nodes:
 - Data cells of ocotp:
   Detailed bindings are described in bindings/nvmem/nvmem.txt
 
+Watchdog bindings based on SCU Message Protocol
+------------------------------------------------------------
+
+Required properties:
+- compatible: should be:
+              "fsl,imx8qxp-sc-wdt"
+              followed by "fsl,imx-sc-wdt";
+Optional properties:
+- timeout-sec: contains the watchdog timeout in seconds.
+
 Example (imx8qxp):
 -------------
 aliases {
@@ -207,6 +217,11 @@ firmware {
 		rtc: rtc {
 			compatible = "fsl,imx8qxp-sc-rtc";
 		};
+
+		watchdog {
+			compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
+			timeout-sec = <60>;
+		};
 	};
 };
 
Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt deleted +0 -24
deleted file mode 100644
index 02b87e9..0000000
@@ -1,24 +0,0 @@
-* Freescale i.MX System Controller Watchdog
-
-i.MX system controller watchdog is for i.MX SoCs with system controller inside,
-the watchdog is managed by system controller, users can ONLY communicate with
-system controller from secure mode for watchdog operations, so Linux i.MX system
-controller watchdog driver will call ARM SMC API and trap into ARM-Trusted-Firmware
-for watchdog operations, ARM-Trusted-Firmware is running at secure EL3 mode and
-it will request system controller to execute the watchdog operation passed from
-Linux kernel.
-
-Required properties:
-- compatible:	Should be :
-		"fsl,imx8qxp-sc-wdt"
-		followed by "fsl,imx-sc-wdt";
-
-Optional properties:
-- timeout-sec : Contains the watchdog timeout in seconds.
-
-Examples:
-
-watchdog {
-	compatible = "fsl,imx8qxp-sc-wdt", "fsl,imx-sc-wdt";
-	timeout-sec = <60>;
-};