devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls.
@ 2020-05-05  3:13 Evan Benn
  2020-05-05  3:13 ` [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
  0 siblings, 1 reply; 4+ messages in thread
From: Evan Benn @ 2020-05-05  3:13 UTC (permalink / raw)
  To: LKML
  Cc: jwerner, xingyu.chen, 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, 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 v6:
- Don't use dt default
- Use default arm,smc-id value if non provided by dt

Changes in v5:
- Change compatible to arm,smc-wdt
- Make timeleft return 0 on error
- Use type punning on smc_func_id to save an alloc
- Change compatible to arm,smc-wdt

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        |  37 ++++
 MAINTAINERS                                   |   7 +
 arch/arm64/configs/defconfig                  |   1 +
 drivers/watchdog/Kconfig                      |  13 ++
 drivers/watchdog/Makefile                     |   1 +
 drivers/watchdog/arm_smc_wdt.c                | 188 ++++++++++++++++++
 6 files changed, 247 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
 create mode 100644 drivers/watchdog/arm_smc_wdt.c

-- 
2.26.2.526.g744177e7f7-goog


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

* [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog
  2020-05-05  3:13 [PATCH v6 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
@ 2020-05-05  3:13 ` Evan Benn
  2020-05-05 19:09   ` Rob Herring
  2020-05-06 13:45   ` Guenter Roeck
  0 siblings, 2 replies; 4+ messages in thread
From: Evan Benn @ 2020-05-05  3:13 UTC (permalink / raw)
  To: LKML
  Cc: jwerner, xingyu.chen, Evan Benn, David S. Miller,
	Greg Kroah-Hartman, Guenter Roeck, Mauro Carvalho Chehab,
	Rob Herring, Wim Van Sebroeck, devicetree, 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 v6:
- Don't use dt default

Changes in v5:
- Change compatible to arm,smc-wdt

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        | 37 +++++++++++++++++++
 MAINTAINERS                                   |  6 +++
 2 files changed, 43 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..bec651541e0c8
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
@@ -0,0 +1,37 @@
+# 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:
+      - arm,smc-wdt
+  arm,smc-id:
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      The ATF smc function id used by the firmware.
+      Defaults to 0x82003D06 if unset.
+
+required:
+  - compatible
+
+examples:
+  - |
+    watchdog {
+      compatible = "arm,smc-wdt";
+      arm,smc-id = <0x82003D06>;
+      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.2.526.g744177e7f7-goog


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

* Re: [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog
  2020-05-05  3:13 ` [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
@ 2020-05-05 19:09   ` Rob Herring
  2020-05-06 13:45   ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2020-05-05 19:09 UTC (permalink / raw)
  To: Evan Benn
  Cc: LKML, jwerner, xingyu.chen, Evan Benn, David S. Miller,
	Greg Kroah-Hartman, Guenter Roeck, Mauro Carvalho Chehab,
	Wim Van Sebroeck, devicetree, linux-watchdog

On Tue,  5 May 2020 13:13:30 +1000, Evan Benn wrote:
> 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 v6:
> - Don't use dt default
> 
> Changes in v5:
> - Change compatible to arm,smc-wdt
> 
> 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        | 37 +++++++++++++++++++
>  MAINTAINERS                                   |  6 +++
>  2 files changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog
  2020-05-05  3:13 ` [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
  2020-05-05 19:09   ` Rob Herring
@ 2020-05-06 13:45   ` Guenter Roeck
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2020-05-06 13:45 UTC (permalink / raw)
  To: Evan Benn, LKML
  Cc: jwerner, xingyu.chen, David S. Miller, Greg Kroah-Hartman,
	Mauro Carvalho Chehab, Rob Herring, Wim Van Sebroeck, devicetree,
	linux-watchdog

On 5/4/20 8:13 PM, Evan Benn wrote:
> 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>
> 
Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Changes in v6:
> - Don't use dt default
> 
> Changes in v5:
> - Change compatible to arm,smc-wdt
> 
> 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        | 37 +++++++++++++++++++
>  MAINTAINERS                                   |  6 +++
>  2 files changed, 43 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..bec651541e0c8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml
> @@ -0,0 +1,37 @@
> +# 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:
> +      - arm,smc-wdt
> +  arm,smc-id:
> +    allOf:
> +      - $ref: /schemas/types.yaml#/definitions/uint32
> +    description: |
> +      The ATF smc function id used by the firmware.
> +      Defaults to 0x82003D06 if unset.
> +
> +required:
> +  - compatible
> +
> +examples:
> +  - |
> +    watchdog {
> +      compatible = "arm,smc-wdt";
> +      arm,smc-id = <0x82003D06>;
> +      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>
> 


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

end of thread, other threads:[~2020-05-06 13:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-05  3:13 [PATCH v6 0/2] Add a watchdog driver that uses ARM Secure Monitor Calls Evan Benn
2020-05-05  3:13 ` [PATCH v6 1/2] dt-bindings: watchdog: Add ARM smc wdt for mt8173 watchdog Evan Benn
2020-05-05 19:09   ` Rob Herring
2020-05-06 13:45   ` Guenter Roeck

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).