Skip to contentSkip to conversation

Add i.MX8QXP system controller watchdog

PATCH Applied Anson Huang 4 participants 9 messages Mar 21, 2019 – Apr 3, 2019

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

v9 cover Add i.MX8QXP system controller watchdog

i.MX8QXP is an ARMv8 Cortex-A35 SoC with a Cortex-M4 system controller inside, the system controller manages overall power, clock, secure RTC and watchdog etc., so Linux kernel running on A35 needs to communicate with system controller for watchdog operation, this system controller watchdog will call SMC to trap to EL3 secure world ARM-Trusted-Firmware and then it will request system controller to do the watchdog operation via IPC.

Changes since V8:
- change the timeout value to be from DT instead of from module parameter, and also update the binding doc and dts to add timeout property.

Anson Huang (4):
dt-bindings: watchdog: add i.MX system controller watchdog
watchdog: imx_sc: Add i.MX system controller watchdog support
arm64: defconfig: add support for i.MX system controller watchdog
arm64: dts: imx8qxp: add system controller watchdog support

 .../bindings/watchdog/fsl-imx-sc-wdt.txt           |  24 +++
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi         |   5 +
 arch/arm64/configs/defconfig                       |   1 +
 drivers/watchdog/Kconfig                           |  16 ++
 drivers/watchdog/Makefile                          |   1 +
 drivers/watchdog/imx_sc_wdt.c                      | 177 +++++++++++++++++++++
 6 files changed, 224 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt
 create mode 100644 drivers/watchdog/imx_sc_wdt.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH v9 1/4 dt-bindings: watchdog: add i.MX system controller watchdog

Add i.MX system controller watchdog binding doc.

---
Changes since V8:
- add optional property "timeout-sec" according to driver change.

---
 .../bindings/watchdog/fsl-imx-sc-wdt.txt           | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt
Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt new file +24 -0
new file mode 100644
index 0000000..02b87e9
@@ -0,0 +1,24 @@
+* 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
maintainer Acked-by on v9 1/4
#2 lore raw

Re: [PATCH V9 1/4] dt-bindings: watchdog: add i.MX system controller watchdog

Quoted 10 lines · Anson Huang

Add i.MX system controller watchdog binding doc.

---
Changes since V8:
- add optional property "timeout-sec" according to driver change.

---
 .../bindings/watchdog/fsl-imx-sc-wdt.txt           | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-sc-wdt.txt

I still think what's in ATF should be discoverable, but:

#3 lore raw

RE: [PATCH V9 1/4] dt-bindings: watchdog: add i.MX system controller watchdog

Hi, Guenter/Shawn
Since DT has been acked, would you pick up this patch series if no additional comments?

Best Regards!
Anson Huang

Quoted 28 lines

-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: 2019年3月26日 4:37
To: Anson Huang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Aisheng Dong <[email protected]>; Daniel Baluta <[email protected]>; [email protected]; [email protected]; [email protected]; Andy Gross <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; dl-linux-imx <[email protected]>
Subject: Re: [PATCH V9 1/4] dt-bindings: watchdog: add i.MX system controller watchdog

Quoted 8 lines · Anson Huang

Add i.MX system controller watchdog binding doc.

---
Changes since V8:
- add optional property "timeout-sec" according to driver change.

---
 .../bindings/watchdog/fsl-imx-sc-wdt.txt           | 24
Quoted 8 lines

++++++++++++++++++++++

Quoted 2 lines
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/fsl-

imx-sc-wdt.txt

I still think what's in ATF should be discoverable, but:

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#4 lore raw

Re: [PATCH V9 1/4] dt-bindings: watchdog: add i.MX system controller watchdog

Quoted 3 lines · Anson Huang

Hi, Guenter/Shawn
Since DT has been acked, would you pick up this patch series if no additional comments?

I added patch 1 and 2 of the series to my watchdog-next tree. Wim usually picks it up from there.

Guenter

Quoted 39 lines

Best Regards!
Anson Huang

Quoted 36 lines

-----Original Message-----
From: Rob Herring [mailto:[email protected]]
Sent: 2019年3月26日 4:37
To: Anson Huang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Aisheng Dong <[email protected]>; Daniel Baluta <[email protected]>; [email protected]; [email protected]; [email protected]; Andy Gross <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; dl-linux-imx <[email protected]>
Subject: Re: [PATCH V9 1/4] dt-bindings: watchdog: add i.MX system controller watchdog

Quoted 8 lines · Anson Huang

Add i.MX system controller watchdog binding doc.

---
Changes since V8:
- add optional property "timeout-sec" according to driver change.

---
 .../bindings/watchdog/fsl-imx-sc-wdt.txt           | 24

++++++++++++++++++++++

Quoted 2 lines
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/fsl-

imx-sc-wdt.txt

I still think what's in ATF should be discoverable, but:

Applied
#5 lore raw

Re: [PATCH V9 1/4] dt-bindings: watchdog: add i.MX system controller watchdog

In reply to Anson Huang
Quoted 3 lines · Anson Huang

Hi, Guenter/Shawn
Since DT has been acked, would you pick up this patch series if no additional comments?

Applied patch #3 and #4, thanks.

#6 lore raw

PATCH v9 2/4 watchdog: imx_sc: Add i.MX system controller watchdog support

In reply to Anson Huang

i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and watchdog etc..

This patch adds i.MX system controller watchdog driver support, watchdog operation needs to be done in secure EL3 mode via ARM-Trusted-Firmware, using SMC call, CPU will trap into ARM-Trusted-Firmware and then it will request system controller to do watchdog operation via IPC.

---
Changes since V8:
- change timeout value to be from DT instead of from module parameter.

---
 drivers/watchdog/Kconfig      |  16 ++++
 drivers/watchdog/Makefile     |   1 +
 drivers/watchdog/imx_sc_wdt.c | 177 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+)
 create mode 100644 drivers/watchdog/imx_sc_wdt.c
drivers/watchdog/Kconfig +16 -0
index 242eea8..44a3158 100644
@@ -641,6 +641,22 @@ config IMX2_WDT
 	  To compile this driver as a module, choose M here: the
 	  module will be called imx2_wdt.
 
+config IMX_SC_WDT
+	tristate "IMX SC Watchdog"
+	depends on HAVE_ARM_SMCCC
+	select WATCHDOG_CORE
+	help
+	  This is the driver for the system controller watchdog
+	  on the NXP i.MX SoCs with system controller inside, the
+	  watchdog driver will call ARM SMC API and trap into
+	  ARM-Trusted-Firmware for operations, ARM-Trusted-Firmware
+	  will request system controller to execute the operations.
+	  If you have one of these processors and wish to have
+	  watchdog support enabled, say Y, otherwise say N.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called imx_sc_wdt.
+
 config UX500_WATCHDOG
 	tristate "ST-Ericsson Ux500 watchdog"
 	depends on MFD_DB8500_PRCMU
drivers/watchdog/Makefile +1 -0
index ba930e4..136d9f0 100644
@@ -68,6 +68,7 @@ obj-$(CONFIG_NUC900_WATCHDOG) += nuc900_wdt.o
 obj-$(CONFIG_TS4800_WATCHDOG) += ts4800_wdt.o
 obj-$(CONFIG_TS72XX_WATCHDOG) += ts72xx_wdt.o
 obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o
+obj-$(CONFIG_IMX_SC_WDT) += imx_sc_wdt.o
 obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o
 obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o
 obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o
drivers/watchdog/imx_sc_wdt.c new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
2.7.4
#7 lore raw

PATCH v9 3/4 arm64: defconfig: add support for i.MX system controller watchdog

In reply to Anson Huang

Enable CONFIG_IMX_SC_WDT as module to support i.MX system controller watchdog.

---
no changes.

---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
index f575401..b4000aa 100644
@@ -429,6 +429,7 @@ CONFIG_WATCHDOG=y
 CONFIG_ARM_SP805_WATCHDOG=y
 CONFIG_S3C2410_WATCHDOG=y
 CONFIG_IMX2_WDT=y
+CONFIG_IMX_SC_WDT=m
 CONFIG_MESON_GXBB_WATCHDOG=m
 CONFIG_MESON_WATCHDOG=m
 CONFIG_RENESAS_WDT=y
Signature · 1 line
2.7.4
#8 lore raw

PATCH v9 4/4 arm64: dts: imx8qxp: add system controller watchdog support

In reply to Anson Huang

Add i.MX8QXP system controller watchdog support.

---
Changes since V8:
- add timeout property.

---
 arch/arm64/boot/dts/freescale/imx8qxp.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/freescale/imx8qxp.dtsi +5 -0
index 019abce..ca4541e 100644
@@ -473,4 +473,9 @@
 			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