devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls.
@ 2020-04-21 11:05 Evan Benn
  2020-04-21 11:05 ` [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
  2020-04-21 14:32 ` [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Guenter Roeck
  0 siblings, 2 replies; 5+ messages in thread
From: Evan Benn @ 2020-04-21 11:05 UTC (permalink / raw)
  To: LKML
  Cc: xingyu.chen, jwerner, Evan Benn, Anson Huang, Bjorn Andersson,
	Catalin Marinas, David S. Miller, Geert Uytterhoeven,
	Greg Kroah-Hartman, Guenter Roeck, Leonard Crestez, Li Yang,
	Marcin Juszkiewicz, Matthias Brugger, Mauro Carvalho Chehab,
	Olof Johansson, Rob Herring, Rob Herring, Shawn Guo,
	Valentin Schneider, Will Deacon, Wim Van Sebroeck, devicetree,
	linux-arm-kernel, linux-mediatek, linux-watchdog

This is currently supported in firmware deployed on oak, hana and elm mt8173
chromebook devices. The kernel driver is written to be a generic SMC
watchdog driver.

Arm Trusted Firmware upstreaming review:
    https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/3405

Patch to add oak, hana, elm device tree:
    https://lore.kernel.org/linux-arm-kernel/20200110073730.213789-1-hsinyi@chromium.org/
I would like to add the device tree support after the above patch is
accepted.

Changes in v4:
- Add arm,smc-id property
- Get smc-id from of property
- Return a1 instead of a0 in timeleft

Changes in v3:
- Change name back to arm
- Add optional get_timeleft op
- change name to arm_smc_wdt

Changes in v2:
- Change name arm > mt8173
- use watchdog_stop_on_reboot
- use watchdog_stop_on_unregister
- use devm_watchdog_register_device
- remove smcwd_shutdown, smcwd_remove
- change error codes

Evan Benn (1):
  dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog

Julius Werner (1):
  watchdog: Add new arm_smc_wdt watchdog driver

 .../bindings/watchdog/arm-smc-wdt.yaml        |  36 ++++
 MAINTAINERS                                   |   7 +
 arch/arm64/configs/defconfig                  |   1 +
 drivers/watchdog/Kconfig                      |  13 ++
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/arm_smc_wdt.c                | 194 ++++++++++++++++++
 6 files changed, 252 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
 create mode 100644 drivers/watchdog/arm_smc_wdt.c

-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog
  2020-04-21 11:05 [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
@ 2020-04-21 11:05 ` Evan Benn
  2020-04-21 14:32 ` [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Guenter Roeck
  1 sibling, 0 replies; 5+ messages in thread
From: Evan Benn @ 2020-04-21 11:05 UTC (permalink / raw)
  To: LKML
  Cc: xingyu.chen, jwerner, Evan Benn, David S. Miller,
	Greg Kroah-Hartman, Guenter Roeck, Matthias Brugger,
	Mauro Carvalho Chehab, Rob Herring, Wim Van Sebroeck, devicetree,
	linux-arm-kernel, linux-mediatek, linux-watchdog

This watchdog can be used on ARM systems with a Secure
Monitor firmware to forward watchdog operations to
firmware via a Secure Monitor Call.

Signed-off-by: Evan Benn <evanbenn@chromium.org>

---

Changes in v4:
- Add arm,smc-id property

Changes in v3:
- Change name back to arm

Changes in v2:
- Change name arm > mt8173

 .../bindings/watchdog/arm-smc-wdt.yaml        | 36 +++++++++++++++++++
 MAINTAINERS                                   |  6 ++++
 2 files changed, 42 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
new file mode 100644
index 0000000000000..5379d9f798d84
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/arm-smc-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM Secure Monitor Call based watchdog
+
+allOf:
+  - $ref: "watchdog.yaml#"
+
+maintainers:
+  - Julius Werner <jwerner@chromium.org>
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt8173-smc-wdt
+  arm,smc-id:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - default: 0x82003D06
+    description:
+      The ATF smc function id used by the firmware.
+
+required:
+  - compatible
+
+examples:
+  - |
+    watchdog {
+      compatible = "mediatek,mt8173-smc-wdt";
+      timeout-sec = <15>;
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index b816a453b10eb..0f2b39767bfa9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1457,6 +1457,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt
 F:	drivers/irqchip/irq-vic.c
 
+ARM SMC WATCHDOG DRIVER
+M:	Julius Werner <jwerner@chromium.org>
+R:	Evan Benn <evanbenn@chromium.org>
+S:	Maintained
+F:	devicetree/bindings/watchdog/arm-smc-wdt.yaml
+
 ARM SMMU DRIVERS
 M:	Will Deacon <will@kernel.org>
 R:	Robin Murphy <robin.murphy@arm.com>
-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls.
  2020-04-21 11:05 [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
  2020-04-21 11:05 ` [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
@ 2020-04-21 14:32 ` Guenter Roeck
  2020-04-22  0:40   ` Evan Benn
  1 sibling, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2020-04-21 14:32 UTC (permalink / raw)
  To: Evan Benn, LKML
  Cc: xingyu.chen, jwerner, Anson Huang, Bjorn Andersson,
	Catalin Marinas, David S. Miller, Geert Uytterhoeven,
	Greg Kroah-Hartman, Leonard Crestez, Li Yang, Marcin Juszkiewicz,
	Matthias Brugger, Mauro Carvalho Chehab, Olof Johansson,
	Rob Herring, Rob Herring, Shawn Guo, Valentin Schneider,
	Will Deacon, Wim Van Sebroeck, devicetree, linux-arm-kernel,
	linux-mediatek, linux-watchdog

On 4/21/20 4:05 AM, Evan Benn wrote:
> This is currently supported in firmware deployed on oak, hana and elm mt8173
> chromebook devices. The kernel driver is written to be a generic SMC
> watchdog driver.
> 
> Arm Trusted Firmware upstreaming review:
>     https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/3405
> 
> Patch to add oak, hana, elm device tree:
>     https://lore.kernel.org/linux-arm-kernel/20200110073730.213789-1-hsinyi@chromium.org/
> I would like to add the device tree support after the above patch is
> accepted.
> 
> Changes in v4:
> - Add arm,smc-id property
> - Get smc-id from of property
> - Return a1 instead of a0 in timeleft
> 
Subject says v2. This is confusing, at the very least.

Guenter

> Changes in v3:
> - Change name back to arm
> - Add optional get_timeleft op
> - change name to arm_smc_wdt
> 
> Changes in v2:
> - Change name arm > mt8173
> - use watchdog_stop_on_reboot
> - use watchdog_stop_on_unregister
> - use devm_watchdog_register_device
> - remove smcwd_shutdown, smcwd_remove
> - change error codes
> 
> Evan Benn (1):
>   dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog
> 
> Julius Werner (1):
>   watchdog: Add new arm_smc_wdt watchdog driver
> 
>  .../bindings/watchdog/arm-smc-wdt.yaml        |  36 ++++
>  MAINTAINERS                                   |   7 +
>  arch/arm64/configs/defconfig                  |   1 +
>  drivers/watchdog/Kconfig                      |  13 ++
>  drivers/watchdog/Makefile                     |   1 +
>  drivers/watchdog/arm_smc_wdt.c                | 194 ++++++++++++++++++
>  6 files changed, 252 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
>  create mode 100644 drivers/watchdog/arm_smc_wdt.c
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls.
  2020-04-21 14:32 ` [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Guenter Roeck
@ 2020-04-22  0:40   ` Evan Benn
  0 siblings, 0 replies; 5+ messages in thread
From: Evan Benn @ 2020-04-22  0:40 UTC (permalink / raw)
  To: Guenter Roeck, Simon Glass
  Cc: LKML, Xingyu Chen, Julius Werner, Anson Huang, Bjorn Andersson,
	Catalin Marinas, David S. Miller, Geert Uytterhoeven,
	Greg Kroah-Hartman, Leonard Crestez, Li Yang, Marcin Juszkiewicz,
	Matthias Brugger, Mauro Carvalho Chehab, Olof Johansson,
	Rob Herring, Rob Herring, Shawn Guo, Valentin Schneider,
	Will Deacon, Wim Van Sebroeck, devicetree,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	moderated list:ARM/Mediatek SoC support, LINUX-WATCHDOG

> Subject says v2. This is confusing, at the very least.
>
> Guenter

Apologies! I am using the patman script, it threw this message that I
did not understand: 'Change log for unknown version v3'.
And I did not spot the issue in the emails before send. Not sure why
patman worked for v2 and v3 but not v4... I will take a look.

Evan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog
  2020-04-03  5:28 Evan Benn
@ 2020-04-03  5:28 ` Evan Benn
  0 siblings, 0 replies; 5+ messages in thread
From: Evan Benn @ 2020-04-03  5:28 UTC (permalink / raw)
  To: LKML
  Cc: xingyu.chen, jwerner, Evan Benn, Andy Shevchenko,
	David S. Miller, Greg Kroah-Hartman, Guenter Roeck,
	Jonathan Cameron, Mark Rutland, Matthias Brugger,
	Mauro Carvalho Chehab, Rob Herring, Wim Van Sebroeck, devicetree,
	linux-arm-kernel, linux-mediatek, linux-watchdog

This watchdog can be used on ARM systems with a Secure
Monitor firmware to forward watchdog operations to
firmware via a Secure Monitor Call.

Signed-off-by: Evan Benn <evanbenn@chromium.org>

---

Changes in v3:
- Change name back to arm

Changes in v2:
- Change name arm > mt8173

 .../bindings/watchdog/arm-smc-wdt.yaml        | 30 +++++++++++++++++++
 MAINTAINERS                                   |  6 ++++
 2 files changed, 36 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml

diff --git a/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
new file mode 100644
index 0000000000000..24968f199413b
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/arm-smc-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM Secure Monitor Call based watchdog
+
+allOf:
+  - $ref: "watchdog.yaml#"
+
+maintainers:
+  - Julius Werner <jwerner@chromium.org>
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt8173-smc-wdt
+
+required:
+  - compatible
+
+examples:
+  - |
+    watchdog {
+      compatible = "mediatek,mt8173-smc-wdt";
+      timeout-sec = <15>;
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index a6fbdf354d343..af8842b998a93 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1421,6 +1421,12 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/interrupt-controller/amazon,al-fic.txt
 F:	drivers/irqchip/irq-al-fic.c
 
+ARM SMC WATCHDOG DRIVER
+M:	Julius Werner <jwerner@chromium.org>
+R:	Evan Benn <evanbenn@chromium.org>
+S:	Maintained
+F:	devicetree/bindings/watchdog/arm-smc-wdt.yaml
+
 ARM SMMU DRIVERS
 M:	Will Deacon <will@kernel.org>
 R:	Robin Murphy <robin.murphy@arm.com>
-- 
2.26.0.292.g33ef6b2f38-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-04-22  0:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 11:05 [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
2020-04-21 11:05 ` [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
2020-04-21 14:32 ` [PATCH v2 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Guenter Roeck
2020-04-22  0:40   ` Evan Benn
  -- strict thread matches above, loose matches on Subject: below --
2020-04-03  5:28 Evan Benn
2020-04-03  5:28 ` [PATCH v2 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).