This patch set adds last reset bootstatus support in
watchdog the Nuvoton NPCM Baseboard Management Controller (BMC).
The NPCM watchdog driver tested on NPCM750 evaluation board.
Addressed comments from:.
- Guenter Roeck: https://www.spinics.net/lists/kernel/msg3425926.html
- Guenter Roeck: https://lkml.org/lkml/2020/3/1/144
Changes since version 1:
- Remove restart priority support.
- Modify commit message.
- Modify define in alphabetic order.
- Add reset bootstatus remarks.
- Remove and modify whitespace.
Tomer Maimon (3):
dt-binding: watchdog: add bootstatus reset type documentation
watchdog: npcm: sets card ext1 and ext2 bootstatus during probe
watchdog: npcm: remove whitespaces
.../bindings/watchdog/nuvoton,npcm-wdt.txt | 30 ++++
drivers/watchdog/npcm_wdt.c | 131 ++++++++++++++++--
2 files changed, 151 insertions(+), 10 deletions(-)
--
2.22.0
Add device tree three bootstatus reset types documentation.
Signed-off-by: Tomer Maimon <[email protected]>
---
.../bindings/watchdog/nuvoton,npcm-wdt.txt | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt b/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
index 6d593003c933..65e24a80ee70 100644
--- a/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
+++ b/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
@@ -17,6 +17,33 @@ Required clocking property, have to be one of:
Optional properties:
- timeout-sec : Contains the watchdog timeout in seconds
+- nuvoton,card-reset-type : "porst|corst|wd0|wd1|wd2|sw1|sw2|sw3|sw4"
+ Contains the card reset type for checking and indicating
+ the last card reset status (WDIOF_CARDRESET)
+
+ If 'nuvoton,card-reset-type' is not specified the default is porst
+
+ Reset types:
+ - porst: Power reset
+ - corst: Core reset
+ - wdX : Watchdog reset X (X represante 0-2)
+ - swX : Software reset X (X represante 1-4)
+
+- nuvoton,ext1-reset-type : "porst|corst|wd0|wd1|wd2|sw1|sw2|sw3|sw4"
+ Contains the external 2 reset type for checking and indicating
+ the last external 2 reset status (WDIOF_EXTERN1)
+
+ If 'nuvoton,card-reset-type' is not specified the default is wd0.
+
+ Reset types are the same as in nuvoton,card-reset-type property.
+
+- nuvoton,ext2-reset-type : "porst|corst|wd0|wd1|wd2|sw1|sw2|sw3|sw4"
+ Contains the external 2 reset type for checking and indicating
+ the last external 2 reset status (WDIOF_EXTERN2)
+
+ If 'nuvoton,card-reset-type' is not specified the default is sw1.
+
+ Reset types are the same as in nuvoton,card-reset-type property.
Example:
@@ -25,4 +52,7 @@ timer@f000801c {
interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
reg = <0xf000801c 0x4>;
clocks = <&clk NPCM7XX_CLK_TIMER>;
+ nuvoton,card-reset-type = "porst";
+ nuvoton,ext1-reset-type = "wd1";
+ nuvoton,ext2-reset-type = "sw2";
};
--
2.22.0
On Tue, Mar 03, 2020 at 12:01:12PM +0200, Tomer Maimon wrote:
> Add device tree three bootstatus reset types documentation.
>
> Signed-off-by: Tomer Maimon <[email protected]>
> ---
> .../bindings/watchdog/nuvoton,npcm-wdt.txt | 30 +++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt b/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
> index 6d593003c933..65e24a80ee70 100644
> --- a/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
> +++ b/Documentation/devicetree/bindings/watchdog/nuvoton,npcm-wdt.txt
> @@ -17,6 +17,33 @@ Required clocking property, have to be one of:
>
> Optional properties:
> - timeout-sec : Contains the watchdog timeout in seconds
> +- nuvoton,card-reset-type : "porst|corst|wd0|wd1|wd2|sw1|sw2|sw3|sw4"
> + Contains the card reset type for checking and indicating
> + the last card reset status (WDIOF_CARDRESET)
> +
> + If 'nuvoton,card-reset-type' is not specified the default is porst
> +
> + Reset types:
> + - porst: Power reset
> + - corst: Core reset
> + - wdX : Watchdog reset X (X represante 0-2)
> + - swX : Software reset X (X represante 1-4)
> +
> +- nuvoton,ext1-reset-type : "porst|corst|wd0|wd1|wd2|sw1|sw2|sw3|sw4"
> + Contains the external 2 reset type for checking and indicating
> + the last external 2 reset status (WDIOF_EXTERN1)
> +
> + If 'nuvoton,card-reset-type' is not specified the default is wd0.
> +
> + Reset types are the same as in nuvoton,card-reset-type property.
> +
> +- nuvoton,ext2-reset-type : "porst|corst|wd0|wd1|wd2|sw1|sw2|sw3|sw4"
> + Contains the external 2 reset type for checking and indicating
> + the last external 2 reset status (WDIOF_EXTERN2)
> +
> + If 'nuvoton,card-reset-type' is not specified the default is sw1.
> +
> + Reset types are the same as in nuvoton,card-reset-type property.
>
> Example:
>
> @@ -25,4 +52,7 @@ timer@f000801c {
> interrupts = <GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>;
> reg = <0xf000801c 0x4>;
> clocks = <&clk NPCM7XX_CLK_TIMER>;
> + nuvoton,card-reset-type = "porst";
> + nuvoton,ext1-reset-type = "wd1";
> + nuvoton,ext2-reset-type = "sw2";
This set of properties maps chip reset types to reset types defined
by the Linux watchdog subsystem (ie WDIOF_CARDRESET, WDIOF_EXTERN1,
and WDIOF_EXTERN2). It is neither a hardware description nor a system
configuration.
It is up to Rob to decide, but I personally don't think it is appropriate.
Guenter