Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-watchdog-6.19-rc1' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

- Add watchdog support for:
- Renesas WWDT
- AST2700 platform
- MediaTek MT8189 SoC
- Loongson-2k0300 watchdog
- Qualcomm Kaanapali watchdog
- RK3506 compatible
- Airoha AN7583 SoC

- DT Schema conversions:
- lantiq,wdt
- TI OMAP
- marvell,orion-wdt

- Several other fixes and improvements

* tag 'linux-watchdog-6.19-rc1' of git://www.linux-watchdog.org/linux-watchdog: (30 commits)
watchdog: starfive: Fix resource leak in probe error path
dt-bindings: watchdog: airoha: Add support for Airoha AN7583 SoC
dt-bindings: watchdog: lantiq,wdt: convert bindings to dtschema
dt-bindings: watchdog: Add RK3506 compatible
dt-bindings: watchdog: Document Qualcomm Kaanapali watchdog
watchdog: wdat_wdt: Fix ACPI table leak in probe function
watchdog: loongson1: Add Loongson-2k0300 watchdog support
dt-bindings: watchdog: loongson,ls1x-wdt: Add ls2k0300-wdt compatible
watchdog: loongson1: Drop CONFIG_OF
watchdog: loongson1: Simplify ls1x_wdt_probe code
watchdog: loongson1: Add missing MODULE_PARM_DESC
watchdog/diag288: Fix module comment typos
dt-bindings: watchdog: Support MediaTek MT8189 wdt
dt-bindings: watchdog: mediatek,mtk-wdt: Add compatible for MT8189 SoC
dt-bindings: mfd: rohm,bd96801-pmic: Correct timeout-sec length and reference watchdog schema
dt-bindings: watchdog: Allow node names named 'pmic'
dt-bindings: watchdog: Restrict timeout-sec to one number
watchdog: renesas_wwdt: add driver
dt-bindings: watchdog: Add Renesas WWDT
dt-bindings: watchdog: Convert marvell,orion-wdt to DT schema
...

+1113 -290
+5 -3
Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml
··· 57 57 - prstb 58 58 - intb-only 59 59 60 - timeout-sec: 61 - maxItems: 2 60 + timeout-sec: true 62 61 63 62 regulators: 64 63 $ref: /schemas/regulator/rohm,bd96801-regulator.yaml ··· 71 72 - interrupt-names 72 73 - regulators 73 74 74 - additionalProperties: false 75 + allOf: 76 + - $ref: /schemas/watchdog/watchdog.yaml 77 + 78 + unevaluatedProperties: false 75 79 76 80 examples: 77 81 - |
+5 -1
Documentation/devicetree/bindings/watchdog/airoha,en7581-wdt.yaml
··· 14 14 15 15 properties: 16 16 compatible: 17 - const: airoha,en7581-wdt 17 + oneOf: 18 + - items: 19 + - const: airoha,an7583-wdt 20 + - const: airoha,en7581-wdt 21 + - const: airoha,en7581-wdt 18 22 19 23 reg: 20 24 maxItems: 1
+6 -2
Documentation/devicetree/bindings/watchdog/aspeed,ast2400-wdt.yaml
··· 15 15 - aspeed,ast2400-wdt 16 16 - aspeed,ast2500-wdt 17 17 - aspeed,ast2600-wdt 18 + - aspeed,ast2700-wdt 18 19 19 20 reg: 20 21 maxItems: 1 ··· 88 87 aspeed,reset-mask: 89 88 $ref: /schemas/types.yaml#/definitions/uint32-array 90 89 minItems: 1 91 - maxItems: 2 90 + maxItems: 5 92 91 description: > 93 92 A bitmask indicating which peripherals will be reset if the watchdog 94 93 timer expires. On AST2500 SoCs this should be a single word defined using 95 94 the AST2500_WDT_RESET_* macros; on AST2600 SoCs this should be a two-word 96 95 array with the first word defined using the AST2600_WDT_RESET1_* macros, 97 - and the second word defined using the AST2600_WDT_RESET2_* macros. 96 + and the second word defined using the AST2600_WDT_RESET2_* macros; on 97 + AST2700 SoCs, this should be five-word array from AST2700_WDT_RESET1_* 98 + macros to AST2700_WDT_RESET5_* macros. 98 99 99 100 required: 100 101 - compatible ··· 117 114 enum: 118 115 - aspeed,ast2500-wdt 119 116 - aspeed,ast2600-wdt 117 + - aspeed,ast2700-wdt 120 118 - if: 121 119 required: 122 120 - aspeed,ext-active-high
+57
Documentation/devicetree/bindings/watchdog/lantiq,wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/lantiq,wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Lantiq WTD watchdog 8 + 9 + maintainers: 10 + - Hauke Mehrtens <hauke@hauke-m.de> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - enum: 16 + - lantiq,falcon-wdt 17 + - lantiq,wdt 18 + - lantiq,xrx100-wdt 19 + - items: 20 + - enum: 21 + - lantiq,xrx200-wdt 22 + - const: lantiq,xrx100-wdt 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + lantiq,rcu: 28 + $ref: /schemas/types.yaml#/definitions/phandle 29 + description: Phandle to the RCU syscon node 30 + 31 + required: 32 + - compatible 33 + - reg 34 + 35 + allOf: 36 + - $ref: watchdog.yaml# 37 + - if: 38 + properties: 39 + compatible: 40 + contains: 41 + enum: 42 + - lantiq,xrx100-wdt 43 + - lantiq,falcon-wdt 44 + then: 45 + required: 46 + - lantiq,rcu 47 + 48 + unevaluatedProperties: false 49 + 50 + examples: 51 + - | 52 + watchdog@803f0 { 53 + compatible = "lantiq,xrx200-wdt", "lantiq,xrx100-wdt"; 54 + reg = <0x803f0 0x10>; 55 + 56 + lantiq,rcu = <&rcu0>; 57 + };
-24
Documentation/devicetree/bindings/watchdog/lantiq-wdt.txt
··· 1 - Lantiq WTD watchdog binding 2 - ============================ 3 - 4 - This describes the binding of the Lantiq watchdog driver. 5 - 6 - ------------------------------------------------------------------------------- 7 - Required properties: 8 - - compatible : Should be one of 9 - "lantiq,wdt" 10 - "lantiq,xrx100-wdt" 11 - "lantiq,xrx200-wdt", "lantiq,xrx100-wdt" 12 - "lantiq,falcon-wdt" 13 - - reg : Address of the watchdog block 14 - - lantiq,rcu : A phandle to the RCU syscon (required for 15 - "lantiq,falcon-wdt" and "lantiq,xrx100-wdt") 16 - 17 - ------------------------------------------------------------------------------- 18 - Example for the watchdog on the xRX200 SoCs: 19 - watchdog@803f0 { 20 - compatible = "lantiq,xrx200-wdt", "lantiq,xrx100-wdt"; 21 - reg = <0x803f0 0x10>; 22 - 23 - lantiq,rcu = <&rcu0>; 24 - };
+2 -1
Documentation/devicetree/bindings/watchdog/loongson,ls1x-wdt.yaml
··· 4 4 $id: http://devicetree.org/schemas/watchdog/loongson,ls1x-wdt.yaml# 5 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 6 6 7 - title: Loongson-1 Watchdog Timer 7 + title: Loongson Watchdog Timer 8 8 9 9 maintainers: 10 10 - Keguang Zhang <keguang.zhang@gmail.com> ··· 17 17 enum: 18 18 - loongson,ls1b-wdt 19 19 - loongson,ls1c-wdt 20 + - loongson,ls2k0300-wdt 20 21 21 22 reg: 22 23 maxItems: 1
-45
Documentation/devicetree/bindings/watchdog/marvel.txt
··· 1 - * Marvell Orion Watchdog Time 2 - 3 - Required Properties: 4 - 5 - - Compatibility : "marvell,orion-wdt" 6 - "marvell,armada-370-wdt" 7 - "marvell,armada-xp-wdt" 8 - "marvell,armada-375-wdt" 9 - "marvell,armada-380-wdt" 10 - 11 - - reg : Should contain two entries: first one with the 12 - timer control address, second one with the 13 - rstout enable address. 14 - 15 - For "marvell,armada-375-wdt" and "marvell,armada-380-wdt": 16 - 17 - - reg : A third entry is mandatory and should contain the 18 - shared mask/unmask RSTOUT address. 19 - 20 - Clocks required for compatibles = "marvell,orion-wdt", 21 - "marvell,armada-370-wdt": 22 - - clocks : Must contain a single entry describing the clock input 23 - 24 - Clocks required for compatibles = "marvell,armada-xp-wdt" 25 - "marvell,armada-375-wdt" 26 - "marvell,armada-380-wdt": 27 - - clocks : Must contain an entry for each entry in clock-names. 28 - - clock-names : Must include the following entries: 29 - "nbclk" (L2/coherency fabric clock), 30 - "fixed" (Reference 25 MHz fixed-clock). 31 - 32 - Optional properties: 33 - 34 - - interrupts : Contains the IRQ for watchdog expiration 35 - - timeout-sec : Contains the watchdog timeout in seconds 36 - 37 - Example: 38 - 39 - wdt@20300 { 40 - compatible = "marvell,orion-wdt"; 41 - reg = <0x20300 0x28>, <0x20108 0x4>; 42 - interrupts = <3>; 43 - timeout-sec = <10>; 44 - clocks = <&gate_clk 7>; 45 - };
+100
Documentation/devicetree/bindings/watchdog/marvell,orion-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/marvell,orion-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Marvell Orion Watchdog Timer 8 + 9 + maintainers: 10 + - Andrew Lunn <andrew@lunn.ch> 11 + - Gregory Clement <gregory.clement@bootlin.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - marvell,orion-wdt 17 + - marvell,armada-370-wdt 18 + - marvell,armada-xp-wdt 19 + - marvell,armada-375-wdt 20 + - marvell,armada-380-wdt 21 + 22 + reg: 23 + minItems: 2 24 + items: 25 + - description: Timer control register address 26 + - description: RSTOUT enable register address 27 + - description: Shared mask/unmask RSTOUT register address 28 + 29 + clocks: 30 + minItems: 1 31 + items: 32 + - description: L2/coherency fabric clock input 33 + - description: Reference 25 MHz fixed-clock supply 34 + 35 + clock-names: 36 + minItems: 1 37 + items: 38 + - const: nbclk 39 + - const: fixed 40 + 41 + interrupts: 42 + minItems: 1 43 + items: 44 + - description: timeout 45 + - description: pre-timeout 46 + 47 + allOf: 48 + - $ref: watchdog.yaml# 49 + - if: 50 + properties: 51 + compatible: 52 + contains: 53 + enum: 54 + - marvell,armada-375-wdt 55 + - marvell,armada-380-wdt 56 + then: 57 + properties: 58 + reg: 59 + minItems: 3 60 + else: 61 + properties: 62 + reg: 63 + maxItems: 2 64 + 65 + - if: 66 + properties: 67 + compatible: 68 + contains: 69 + enum: 70 + - marvell,armada-xp-wdt 71 + - marvell,armada-375-wdt 72 + - marvell,armada-380-wdt 73 + then: 74 + properties: 75 + clocks: 76 + minItems: 2 77 + clock-names: 78 + minItems: 2 79 + interrupts: 80 + minItems: 2 81 + 82 + required: 83 + - clock-names 84 + 85 + required: 86 + - compatible 87 + - reg 88 + - clocks 89 + 90 + unevaluatedProperties: false 91 + 92 + examples: 93 + - | 94 + watchdog@20300 { 95 + compatible = "marvell,orion-wdt"; 96 + reg = <0x20300 0x28>, <0x20108 0x4>; 97 + interrupts = <3>; 98 + timeout-sec = <10>; 99 + clocks = <&gate_clk 7>; 100 + };
+2
Documentation/devicetree/bindings/watchdog/mediatek,mtk-wdt.yaml
··· 41 41 - mediatek,mt7623-wdt 42 42 - mediatek,mt7629-wdt 43 43 - mediatek,mt8173-wdt 44 + - mediatek,mt8188-wdt 45 + - mediatek,mt8189-wdt 44 46 - mediatek,mt8365-wdt 45 47 - mediatek,mt8516-wdt 46 48 - const: mediatek,mt6589-wdt
-15
Documentation/devicetree/bindings/watchdog/omap-wdt.txt
··· 1 - TI Watchdog Timer (WDT) Controller for OMAP 2 - 3 - Required properties: 4 - - compatible : "ti,omap3-wdt" for OMAP3 or "ti,omap4-wdt" for OMAP4 5 - - ti,hwmods : Name of the hwmod associated to the WDT 6 - 7 - Optional properties: 8 - - timeout-sec : default watchdog timeout in seconds 9 - 10 - Examples: 11 - 12 - wdt2: wdt@4a314000 { 13 - compatible = "ti,omap4-wdt", "ti,omap3-wdt"; 14 - ti,hwmods = "wd_timer2"; 15 - };
+1
Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
··· 22 22 - qcom,apss-wdt-ipq5332 23 23 - qcom,apss-wdt-ipq5424 24 24 - qcom,apss-wdt-ipq9574 25 + - qcom,apss-wdt-kaanapali 25 26 - qcom,apss-wdt-msm8226 26 27 - qcom,apss-wdt-msm8974 27 28 - qcom,apss-wdt-msm8994
+99
Documentation/devicetree/bindings/watchdog/renesas,r9a09g057-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/renesas,r9a09g057-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas RZ/V2H(P) Watchdog Timer (WDT) Controller 8 + 9 + maintainers: 10 + - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - items: 16 + - enum: 17 + - renesas,r9a09g047-wdt # RZ/G3E 18 + - renesas,r9a09g056-wdt # RZ/V2N 19 + - const: renesas,r9a09g057-wdt # RZ/V2H(P) 20 + 21 + - items: 22 + - const: renesas,r9a09g087-wdt # RZ/N2H 23 + - const: renesas,r9a09g077-wdt # RZ/T2H 24 + 25 + - enum: 26 + - renesas,r9a09g057-wdt # RZ/V2H(P) 27 + - renesas,r9a09g077-wdt # RZ/T2H 28 + 29 + reg: 30 + minItems: 1 31 + maxItems: 2 32 + 33 + clocks: 34 + minItems: 1 35 + items: 36 + - description: Register access clock 37 + - description: Main clock 38 + 39 + clock-names: 40 + minItems: 1 41 + items: 42 + - const: pclk 43 + - const: oscclk 44 + 45 + power-domains: 46 + maxItems: 1 47 + 48 + resets: 49 + maxItems: 1 50 + 51 + timeout-sec: true 52 + 53 + required: 54 + - compatible 55 + - reg 56 + - clocks 57 + - clock-names 58 + - power-domains 59 + 60 + allOf: 61 + - $ref: watchdog.yaml# 62 + 63 + - if: 64 + properties: 65 + compatible: 66 + contains: 67 + const: renesas,r9a09g057-wdt 68 + then: 69 + properties: 70 + reg: 71 + maxItems: 1 72 + clocks: 73 + minItems: 2 74 + clock-names: 75 + minItems: 2 76 + else: 77 + properties: 78 + clocks: 79 + maxItems: 1 80 + clock-names: 81 + maxItems: 1 82 + reg: 83 + minItems: 2 84 + resets: false 85 + 86 + additionalProperties: false 87 + 88 + examples: 89 + - | 90 + #include <dt-bindings/clock/renesas,r9a09g057-cpg.h> 91 + 92 + watchdog@11c00400 { 93 + compatible = "renesas,r9a09g057-wdt"; 94 + reg = <0x11c00400 0x400>; 95 + clocks = <&cpg CPG_MOD 0x4b>, <&cpg CPG_MOD 0x4c>; 96 + clock-names = "pclk", "oscclk"; 97 + resets = <&cpg 0x75>; 98 + power-domains = <&cpg>; 99 + };
+114
Documentation/devicetree/bindings/watchdog/renesas,rcar-gen3-wwdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/renesas,rcar-gen3-wwdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas Window Watchdog Timer (WWDT) Controller 8 + 9 + maintainers: 10 + - Wolfram Sang <wsa+renesas@sang-engineering.com> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - items: 16 + - enum: 17 + - renesas,r8a77970-wwdt # R-Car V3M 18 + - renesas,r8a77980-wwdt # R-Car V3H 19 + - const: renesas,rcar-gen3-wwdt 20 + 21 + - items: 22 + - enum: 23 + - renesas,r8a779a0-wwdt # R-Car V3U 24 + - renesas,r8a779f0-wwdt # R-Car S4 25 + - renesas,r8a779g0-wwdt # R-Car V4H 26 + - renesas,r8a779h0-wwdt # R-Car V4M 27 + - const: renesas,rcar-gen4-wwdt 28 + 29 + reg: 30 + maxItems: 1 31 + 32 + interrupts: 33 + items: 34 + - description: Pretimeout, 75% of overflow reached 35 + - description: Error occurred 36 + 37 + interrupt-names: 38 + items: 39 + - const: pretimeout 40 + - const: error 41 + 42 + clocks: 43 + items: 44 + - description: Counting clock 45 + - description: Bus clock 46 + 47 + clock-names: 48 + items: 49 + - const: cnt 50 + - const: bus 51 + 52 + resets: 53 + minItems: 1 54 + maxItems: 2 55 + 56 + reset-names: 57 + minItems: 1 58 + items: 59 + - const: cnt 60 + - const: bus 61 + 62 + power-domains: 63 + maxItems: 1 64 + 65 + required: 66 + - compatible 67 + - reg 68 + - interrupts 69 + - interrupt-names 70 + - clocks 71 + - clock-names 72 + - resets 73 + - reset-names 74 + - power-domains 75 + 76 + allOf: 77 + - $ref: watchdog.yaml# 78 + 79 + - if: 80 + properties: 81 + compatible: 82 + contains: 83 + enum: 84 + - renesas,r8a779a0-wwdt 85 + - renesas,r8a779f0-wwdt 86 + then: 87 + properties: 88 + resets: 89 + minItems: 2 90 + reset-names: 91 + minItems: 2 92 + 93 + additionalProperties: false 94 + 95 + examples: 96 + - | 97 + #include <dt-bindings/clock/r8a779g0-cpg-mssr.h> 98 + #include <dt-bindings/power/r8a779g0-sysc.h> 99 + #include <dt-bindings/interrupt-controller/arm-gic.h> 100 + 101 + watchdog@ffc90000 { 102 + compatible = "renesas,r8a779g0-wwdt", 103 + "renesas,rcar-gen4-wwdt"; 104 + reg = <0xffc90000 0x10>; 105 + interrupts = <GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH>, 106 + <GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH>; 107 + interrupt-names = "pretimeout", "error"; 108 + clocks = <&cpg CPG_CORE R8A779G0_CLK_R>, 109 + <&cpg CPG_CORE R8A779G0_CLK_SASYNCRT>; 110 + clock-names = "cnt", "bus"; 111 + power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>; 112 + resets = <&cpg 1200>; 113 + reset-names = "cnt"; 114 + };
+51
Documentation/devicetree/bindings/watchdog/renesas,rza-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/renesas,rza-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas RZ/A Watchdog Timer (WDT) Controller 8 + 9 + maintainers: 10 + - Wolfram Sang <wsa+renesas@sang-engineering.com> 11 + 12 + properties: 13 + compatible: 14 + items: 15 + - enum: 16 + - renesas,r7s72100-wdt # RZ/A1 17 + - renesas,r7s9210-wdt # RZ/A2 18 + - const: renesas,rza-wdt # RZ/A 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + interrupts: 24 + maxItems: 1 25 + 26 + clocks: 27 + maxItems: 1 28 + 29 + timeout-sec: true 30 + 31 + required: 32 + - compatible 33 + - reg 34 + - clocks 35 + 36 + allOf: 37 + - $ref: watchdog.yaml# 38 + 39 + additionalProperties: false 40 + 41 + examples: 42 + - | 43 + #include <dt-bindings/clock/r7s72100-clock.h> 44 + #include <dt-bindings/interrupt-controller/arm-gic.h> 45 + 46 + watchdog@fcfe0000 { 47 + compatible = "renesas,r7s72100-wdt", "renesas,rza-wdt"; 48 + reg = <0xfcfe0000 0x6>; 49 + interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>; 50 + clocks = <&p0_clk>; 51 + };
+111
Documentation/devicetree/bindings/watchdog/renesas,rzg2l-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/renesas,rzg2l-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas RZ/G2L Watchdog Timer (WDT) Controller 8 + 9 + maintainers: 10 + - Biju Das <biju.das.jz@bp.renesas.com> 11 + 12 + properties: 13 + compatible: 14 + oneOf: 15 + - items: 16 + - enum: 17 + - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five 18 + - renesas,r9a07g044-wdt # RZ/G2{L,LC} 19 + - renesas,r9a07g054-wdt # RZ/V2L 20 + - renesas,r9a08g045-wdt # RZ/G3S 21 + - const: renesas,rzg2l-wdt 22 + 23 + - items: 24 + - const: renesas,r9a09g011-wdt # RZ/V2M 25 + - const: renesas,rzv2m-wdt # RZ/V2M 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + interrupts: 31 + minItems: 1 32 + items: 33 + - description: Timeout 34 + - description: Parity error 35 + 36 + interrupt-names: 37 + minItems: 1 38 + items: 39 + - const: wdt 40 + - const: perrout 41 + 42 + clocks: 43 + items: 44 + - description: Register access clock 45 + - description: Main clock 46 + 47 + clock-names: 48 + items: 49 + - const: pclk 50 + - const: oscclk 51 + 52 + power-domains: 53 + maxItems: 1 54 + 55 + resets: 56 + maxItems: 1 57 + 58 + timeout-sec: true 59 + 60 + required: 61 + - compatible 62 + - reg 63 + - interrupts 64 + - clocks 65 + - clock-names 66 + - power-domains 67 + - resets 68 + 69 + allOf: 70 + - $ref: watchdog.yaml# 71 + 72 + - if: 73 + properties: 74 + compatible: 75 + contains: 76 + const: renesas,rzg2l-wdt 77 + then: 78 + properties: 79 + interrupts: 80 + minItems: 2 81 + interrupt-names: 82 + minItems: 2 83 + required: 84 + - interrupt-names 85 + else: 86 + properties: 87 + interrupts: 88 + maxItems: 1 89 + interrupt-names: 90 + maxItems: 1 91 + 92 + additionalProperties: false 93 + 94 + examples: 95 + - | 96 + #include <dt-bindings/clock/r9a07g044-cpg.h> 97 + #include <dt-bindings/interrupt-controller/arm-gic.h> 98 + 99 + watchdog@12800800 { 100 + compatible = "renesas,r9a07g044-wdt", 101 + "renesas,rzg2l-wdt"; 102 + reg = <0x12800800 0x400>; 103 + clocks = <&cpg CPG_MOD R9A07G044_WDT0_PCLK>, 104 + <&cpg CPG_MOD R9A07G044_WDT0_CLK>; 105 + clock-names = "pclk", "oscclk"; 106 + interrupts = <GIC_SPI 49 IRQ_TYPE_LEVEL_HIGH>, 107 + <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>; 108 + interrupt-names = "wdt", "perrout"; 109 + resets = <&cpg R9A07G044_WDT0_PRESETN>; 110 + power-domains = <&cpg>; 111 + };
+50
Documentation/devicetree/bindings/watchdog/renesas,rzn1-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/renesas,rzn1-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas RZ/N1 Watchdog Timer (WDT) Controller 8 + 9 + maintainers: 10 + - Wolfram Sang <wsa+renesas@sang-engineering.com> 11 + 12 + properties: 13 + compatible: 14 + items: 15 + - const: renesas,r9a06g032-wdt # RZ/N1D 16 + - const: renesas,rzn1-wdt # RZ/N1 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + interrupts: 22 + maxItems: 1 23 + 24 + clocks: 25 + maxItems: 1 26 + 27 + timeout-sec: true 28 + 29 + required: 30 + - compatible 31 + - reg 32 + - interrupts 33 + - clocks 34 + 35 + allOf: 36 + - $ref: watchdog.yaml# 37 + 38 + additionalProperties: false 39 + 40 + examples: 41 + - | 42 + #include <dt-bindings/clock/r9a06g032-sysctrl.h> 43 + #include <dt-bindings/interrupt-controller/arm-gic.h> 44 + 45 + watchdog@40008000 { 46 + compatible = "renesas,r9a06g032-wdt", "renesas,rzn1-wdt"; 47 + reg = <0x40008000 0x1000>; 48 + interrupts = <GIC_SPI 73 IRQ_TYPE_EDGE_RISING>; 49 + clocks = <&sysctrl R9A06G032_CLK_WATCHDOG>; 50 + };
+6 -140
Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml
··· 15 15 oneOf: 16 16 - items: 17 17 - enum: 18 - - renesas,r7s72100-wdt # RZ/A1 19 - - renesas,r7s9210-wdt # RZ/A2 20 - - const: renesas,rza-wdt # RZ/A 21 - 22 - - items: 23 - - enum: 24 - - renesas,r9a06g032-wdt # RZ/N1D 25 - - const: renesas,rzn1-wdt # RZ/N1 26 - 27 - - items: 28 - - enum: 29 - - renesas,r9a07g043-wdt # RZ/G2UL and RZ/Five 30 - - renesas,r9a07g044-wdt # RZ/G2{L,LC} 31 - - renesas,r9a07g054-wdt # RZ/V2L 32 - - renesas,r9a08g045-wdt # RZ/G3S 33 - - const: renesas,rzg2l-wdt 34 - 35 - - items: 36 - - enum: 37 - - renesas,r9a09g011-wdt # RZ/V2M 38 - - const: renesas,rzv2m-wdt # RZ/V2M 39 - 40 - - items: 41 - - enum: 42 18 - renesas,r8a7742-wdt # RZ/G1H 43 19 - renesas,r8a7743-wdt # RZ/G1M 44 20 - renesas,r8a7744-wdt # RZ/G1N ··· 51 75 - renesas,r8a779h0-wdt # R-Car V4M 52 76 - const: renesas,rcar-gen4-wdt # R-Car Gen4 53 77 54 - - items: 55 - - enum: 56 - - renesas,r9a09g047-wdt # RZ/G3E 57 - - renesas,r9a09g056-wdt # RZ/V2N 58 - - const: renesas,r9a09g057-wdt # RZ/V2H(P) 59 - 60 - - enum: 61 - - renesas,r9a09g057-wdt # RZ/V2H(P) 62 - - renesas,r9a09g077-wdt # RZ/T2H 63 - 64 - - items: 65 - - const: renesas,r9a09g087-wdt # RZ/N2H 66 - - const: renesas,r9a09g077-wdt # RZ/T2H 67 - 68 78 reg: 69 - minItems: 1 70 - maxItems: 2 79 + maxItems: 1 71 80 72 81 interrupts: 73 - minItems: 1 74 - items: 75 - - description: Timeout 76 - - description: Parity error 77 - 78 - interrupt-names: 79 - minItems: 1 80 - items: 81 - - const: wdt 82 - - const: perrout 82 + maxItems: 1 83 83 84 84 clocks: 85 - minItems: 1 86 - items: 87 - - description: Register access clock 88 - - description: Main clock 89 - 90 - clock-names: 91 - minItems: 1 92 - items: 93 - - const: pclk 94 - - const: oscclk 85 + maxItems: 1 95 86 96 87 power-domains: 97 88 maxItems: 1 ··· 72 129 - compatible 73 130 - reg 74 131 - clocks 132 + - interrupts 133 + - power-domains 75 134 76 135 allOf: 77 136 - $ref: watchdog.yaml# ··· 83 138 properties: 84 139 compatible: 85 140 contains: 86 - enum: 87 - - renesas,r9a09g077-wdt 88 - - renesas,rza-wdt 89 - - renesas,rzn1-wdt 141 + const: renesas,r8a77980-wdt 90 142 then: 91 143 required: 92 - - power-domains 93 144 - resets 94 - 95 - - if: 96 - properties: 97 - compatible: 98 - contains: 99 - enum: 100 - - renesas,r9a09g057-wdt 101 - - renesas,rzg2l-wdt 102 - - renesas,rzv2m-wdt 103 - then: 104 - properties: 105 - clocks: 106 - minItems: 2 107 - clock-names: 108 - minItems: 2 109 - required: 110 - - clock-names 111 - else: 112 - properties: 113 - clocks: 114 - maxItems: 1 115 - 116 - - if: 117 - properties: 118 - compatible: 119 - contains: 120 - enum: 121 - - renesas,rzg2l-wdt 122 - then: 123 - properties: 124 - interrupts: 125 - minItems: 2 126 - interrupt-names: 127 - minItems: 2 128 - required: 129 - - interrupt-names 130 - else: 131 - properties: 132 - interrupts: 133 - maxItems: 1 134 - 135 - - if: 136 - properties: 137 - compatible: 138 - contains: 139 - enum: 140 - - renesas,r9a09g057-wdt 141 - - renesas,r9a09g077-wdt 142 - then: 143 - properties: 144 - interrupts: false 145 - interrupt-names: false 146 - else: 147 - required: 148 - - interrupts 149 - 150 - - if: 151 - properties: 152 - compatible: 153 - contains: 154 - const: renesas,r9a09g077-wdt 155 - then: 156 - properties: 157 - resets: false 158 - clock-names: 159 - maxItems: 1 160 - reg: 161 - minItems: 2 162 - required: 163 - - clock-names 164 - - power-domains 165 - else: 166 - properties: 167 - reg: 168 - maxItems: 1 169 145 170 146 additionalProperties: false 171 147
+1
Documentation/devicetree/bindings/watchdog/snps,dw-wdt.yaml
··· 28 28 - rockchip,rk3328-wdt 29 29 - rockchip,rk3368-wdt 30 30 - rockchip,rk3399-wdt 31 + - rockchip,rk3506-wdt 31 32 - rockchip,rk3562-wdt 32 33 - rockchip,rk3568-wdt 33 34 - rockchip,rk3576-wdt
+51
Documentation/devicetree/bindings/watchdog/ti,omap2-wdt.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/watchdog/ti,omap2-wdt.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: TI OMAP Watchdog Timer Controller 8 + 9 + maintainers: 10 + - Aaro Koskinen <aaro.koskinen@iki.fi> 11 + 12 + allOf: 13 + - $ref: watchdog.yaml# 14 + 15 + properties: 16 + compatible: 17 + oneOf: 18 + - enum: 19 + - ti,omap2-wdt 20 + - ti,omap3-wdt 21 + - items: 22 + - enum: 23 + - ti,am4372-wdt 24 + - ti,omap4-wdt 25 + - ti,omap5-wdt 26 + - const: ti,omap3-wdt 27 + 28 + reg: 29 + maxItems: 1 30 + 31 + interrupts: 32 + maxItems: 1 33 + 34 + ti,hwmods: 35 + description: Name of the hardware module associated with the watchdog. 36 + $ref: /schemas/types.yaml#/definitions/string 37 + deprecated: true 38 + 39 + required: 40 + - compatible 41 + - reg 42 + 43 + unevaluatedProperties: false 44 + 45 + examples: 46 + - | 47 + watchdog@48314000 { 48 + compatible = "ti,omap3-wdt"; 49 + reg = <0x48314000 0x80>; 50 + ti,hwmods = "wd_timer2"; 51 + };
+2 -1
Documentation/devicetree/bindings/watchdog/watchdog.yaml
··· 21 21 22 22 properties: 23 23 $nodename: 24 - pattern: "^(timer|watchdog)(@.*|-([0-9]|[1-9][0-9]+))?$" 24 + pattern: "^(pmic|timer|watchdog)(@.*|-([0-9]|[1-9][0-9]+))?$" 25 25 26 26 timeout-sec: 27 + maxItems: 1 27 28 description: 28 29 Contains the watchdog timeout in seconds. 29 30
+10 -2
drivers/watchdog/Kconfig
··· 969 969 This driver adds watchdog support for the integrated watchdogs in the 970 970 Renesas R-Car and other SH-Mobile SoCs (usually named RWDT or SWDT). 971 971 972 + config RENESAS_WWDT 973 + tristate "Renesas Window WWDT Watchdog" 974 + depends on ARCH_RENESAS || COMPILE_TEST 975 + select WATCHDOG_CORE 976 + help 977 + This driver adds watchdog support for a window timer found in some 978 + Renesas R-Car Gen3 and later SoCs. 979 + 972 980 config RENESAS_RZAWDT 973 981 tristate "Renesas RZ/A WDT Watchdog" 974 982 depends on ARCH_RENESAS || COMPILE_TEST ··· 1984 1976 1985 1977 config LOONGSON1_WDT 1986 1978 tristate "Loongson1 SoC hardware watchdog" 1987 - depends on MACH_LOONGSON32 || COMPILE_TEST 1979 + depends on MACH_LOONGSON32 || MACH_LOONGSON64 || COMPILE_TEST 1988 1980 select WATCHDOG_CORE 1989 1981 help 1990 - Hardware driver for the Loongson1 SoC Watchdog Timer. 1982 + Hardware driver for the Loongson family Watchdog Timer. 1991 1983 1992 1984 config RALINK_WDT 1993 1985 tristate "Ralink SoC watchdog"
+1
drivers/watchdog/Makefile
··· 85 85 obj-$(CONFIG_LPC18XX_WATCHDOG) += lpc18xx_wdt.o 86 86 obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o 87 87 obj-$(CONFIG_RENESAS_WDT) += renesas_wdt.o 88 + obj-$(CONFIG_RENESAS_WWDT) += renesas_wwdt.o 88 89 obj-$(CONFIG_RENESAS_RZAWDT) += rza_wdt.o 89 90 obj-$(CONFIG_RENESAS_RZN1WDT) += rzn1_wdt.o 90 91 obj-$(CONFIG_RENESAS_RZG2LWDT) += rzg2l_wdt.o
+23 -7
drivers/watchdog/aspeed_wdt.c
··· 35 35 u32 irq_shift; 36 36 u32 irq_mask; 37 37 struct aspeed_wdt_scu scu; 38 + u32 num_reset_masks; 38 39 }; 39 40 40 41 struct aspeed_wdt { ··· 67 66 .wdt_reset_mask = 0x1, 68 67 .wdt_reset_mask_shift = 2, 69 68 }, 69 + .num_reset_masks = 1, 70 70 }; 71 71 72 72 static const struct aspeed_wdt_config ast2600_config = { ··· 80 78 .wdt_reset_mask = 0xf, 81 79 .wdt_reset_mask_shift = 16, 82 80 }, 81 + .num_reset_masks = 2, 82 + }; 83 + 84 + static const struct aspeed_wdt_config ast2700_config = { 85 + .ext_pulse_width_mask = 0xfffff, 86 + .irq_shift = 0, 87 + .irq_mask = GENMASK(31, 10), 88 + .scu = { 89 + .compatible = "aspeed,ast2700-scu0", 90 + .reset_status_reg = 0x70, 91 + .wdt_reset_mask = 0xf, 92 + .wdt_reset_mask_shift = 0, 93 + }, 94 + .num_reset_masks = 5, 83 95 }; 84 96 85 97 static const struct of_device_id aspeed_wdt_of_table[] = { 86 98 { .compatible = "aspeed,ast2400-wdt", .data = &ast2400_config }, 87 99 { .compatible = "aspeed,ast2500-wdt", .data = &ast2500_config }, 88 100 { .compatible = "aspeed,ast2600-wdt", .data = &ast2600_config }, 101 + { .compatible = "aspeed,ast2700-wdt", .data = &ast2700_config }, 89 102 { }, 90 103 }; 91 104 MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table); ··· 496 479 set_bit(WDOG_HW_RUNNING, &wdt->wdd.status); 497 480 } 498 481 499 - if ((of_device_is_compatible(np, "aspeed,ast2500-wdt")) || 500 - (of_device_is_compatible(np, "aspeed,ast2600-wdt"))) { 501 - u32 reset_mask[2]; 502 - size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1; 482 + if (!of_device_is_compatible(np, "aspeed,ast2400-wdt")) { 483 + u32 reset_mask[5]; 484 + size_t nrstmask = wdt->cfg->num_reset_masks; 503 485 u32 reg = readl(wdt->base + WDT_RESET_WIDTH); 486 + int i; 504 487 505 488 reg &= wdt->cfg->ext_pulse_width_mask; 506 489 if (of_property_read_bool(np, "aspeed,ext-active-high")) ··· 520 503 521 504 ret = of_property_read_u32_array(np, "aspeed,reset-mask", reset_mask, nrstmask); 522 505 if (!ret) { 523 - writel(reset_mask[0], wdt->base + WDT_RESET_MASK1); 524 - if (nrstmask > 1) 525 - writel(reset_mask[1], wdt->base + WDT_RESET_MASK2); 506 + for (i = 0; i < nrstmask; i++) 507 + writel(reset_mask[i], wdt->base + WDT_RESET_MASK1 + i * 4); 526 508 } 527 509 } 528 510
+3 -3
drivers/watchdog/diag288_wdt.c
··· 6 6 * to CP. 7 7 * 8 8 * The command can be altered using the module parameter "cmd". This is 9 - * not recommended because it's only supported on z/VM but not whith LPAR. 9 + * not recommended because it's only supported on z/VM but not with LPAR. 10 10 * 11 - * On LPAR, the watchdog will always trigger a system restart. the module 12 - * paramter cmd is meaningless here. 11 + * On LPAR, the watchdog will always trigger a system restart. The module 12 + * parameter cmd is meaningless here. 13 13 * 14 14 * 15 15 * Copyright IBM Corp. 2004, 2013
+65 -24
drivers/watchdog/loongson1_wdt.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 /* 3 3 * Copyright (c) 2016 Yang Ling <gnaygnil@gmail.com> 4 + * Copyright (C) 2025 Binbin Zhou <zhoubinbin@loongson.cn> 4 5 */ 5 6 6 7 #include <linux/clk.h> ··· 11 10 #include <linux/platform_device.h> 12 11 #include <linux/watchdog.h> 13 12 14 - /* Loongson 1 Watchdog Register Definitions */ 13 + /* Loongson Watchdog Register Definitions */ 15 14 #define WDT_EN 0x0 16 - #define WDT_TIMER 0x4 17 - #define WDT_SET 0x8 18 15 19 16 #define DEFAULT_HEARTBEAT 30 20 17 21 18 static bool nowayout = WATCHDOG_NOWAYOUT; 22 - module_param(nowayout, bool, 0444); 19 + module_param(nowayout, bool, 0); 20 + MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" 21 + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 23 22 24 23 static unsigned int heartbeat; 25 - module_param(heartbeat, uint, 0444); 24 + module_param(heartbeat, uint, 0); 25 + MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (default=" 26 + __MODULE_STRING(DEFAULT_HEARTBEAT) ")"); 27 + 28 + struct ls1x_wdt_pdata { 29 + u32 timer_offset; 30 + u32 set_offset; 31 + u32 wdt_en_bit; 32 + }; 33 + 34 + static const struct ls1x_wdt_pdata ls1b_wdt_pdata = { 35 + .timer_offset = 0x4, 36 + .set_offset = 0x8, 37 + .wdt_en_bit = BIT(0), 38 + }; 39 + 40 + static const struct ls1x_wdt_pdata ls2k0300_wdt_pdata = { 41 + .timer_offset = 0x8, 42 + .set_offset = 0x4, 43 + .wdt_en_bit = BIT(1), 44 + }; 26 45 27 46 struct ls1x_wdt_drvdata { 28 47 void __iomem *base; 29 48 struct clk *clk; 30 49 unsigned long clk_rate; 31 50 struct watchdog_device wdt; 51 + const struct ls1x_wdt_pdata *pdata; 32 52 }; 33 53 34 54 static int ls1x_wdt_ping(struct watchdog_device *wdt_dev) 35 55 { 36 56 struct ls1x_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev); 37 57 38 - writel(0x1, drvdata->base + WDT_SET); 58 + writel(0x1, drvdata->base + drvdata->pdata->set_offset); 39 59 40 60 return 0; 41 61 } ··· 71 49 wdt_dev->timeout = timeout; 72 50 73 51 counts = drvdata->clk_rate * min(timeout, max_hw_heartbeat); 74 - writel(counts, drvdata->base + WDT_TIMER); 52 + writel(counts, drvdata->base + drvdata->pdata->timer_offset); 75 53 76 54 return 0; 77 55 } ··· 80 58 { 81 59 struct ls1x_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev); 82 60 83 - writel(0x1, drvdata->base + WDT_EN); 61 + writel(drvdata->pdata->wdt_en_bit, drvdata->base + WDT_EN); 84 62 85 63 return 0; 86 64 } ··· 88 66 static int ls1x_wdt_stop(struct watchdog_device *wdt_dev) 89 67 { 90 68 struct ls1x_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev); 69 + u32 val = readl(drvdata->base + WDT_EN); 91 70 92 - writel(0x0, drvdata->base + WDT_EN); 71 + val &= ~(drvdata->pdata->wdt_en_bit); 72 + writel(val, drvdata->base + WDT_EN); 93 73 94 74 return 0; 95 75 } ··· 101 77 { 102 78 struct ls1x_wdt_drvdata *drvdata = watchdog_get_drvdata(wdt_dev); 103 79 104 - writel(0x1, drvdata->base + WDT_EN); 105 - writel(0x1, drvdata->base + WDT_TIMER); 106 - writel(0x1, drvdata->base + WDT_SET); 80 + writel(drvdata->pdata->wdt_en_bit, drvdata->base + WDT_EN); 81 + writel(0x1, drvdata->base + drvdata->pdata->timer_offset); 82 + writel(0x1, drvdata->base + drvdata->pdata->set_offset); 107 83 108 84 return 0; 109 85 } ··· 128 104 struct ls1x_wdt_drvdata *drvdata; 129 105 struct watchdog_device *ls1x_wdt; 130 106 unsigned long clk_rate; 131 - int err; 132 107 133 108 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); 134 109 if (!drvdata) 135 110 return -ENOMEM; 111 + platform_set_drvdata(pdev, drvdata); 112 + 113 + drvdata->pdata = of_device_get_match_data(dev); 136 114 137 115 drvdata->base = devm_platform_ioremap_resource(pdev, 0); 138 116 if (IS_ERR(drvdata->base)) ··· 161 135 watchdog_set_nowayout(ls1x_wdt, nowayout); 162 136 watchdog_set_drvdata(ls1x_wdt, drvdata); 163 137 164 - err = devm_watchdog_register_device(dev, &drvdata->wdt); 165 - if (err) 166 - return err; 138 + return devm_watchdog_register_device(dev, &drvdata->wdt); 139 + } 167 140 168 - platform_set_drvdata(pdev, drvdata); 141 + static int ls1x_wdt_resume(struct device *dev) 142 + { 143 + struct ls1x_wdt_drvdata *data = dev_get_drvdata(dev); 169 144 170 - dev_info(dev, "Loongson1 Watchdog driver registered\n"); 145 + if (watchdog_active(&data->wdt)) 146 + ls1x_wdt_start(&data->wdt); 171 147 172 148 return 0; 173 149 } 174 150 175 - #ifdef CONFIG_OF 151 + static int ls1x_wdt_suspend(struct device *dev) 152 + { 153 + struct ls1x_wdt_drvdata *data = dev_get_drvdata(dev); 154 + 155 + if (watchdog_active(&data->wdt)) 156 + ls1x_wdt_stop(&data->wdt); 157 + 158 + return 0; 159 + } 160 + 161 + static DEFINE_SIMPLE_DEV_PM_OPS(ls1x_wdt_pm_ops, ls1x_wdt_suspend, ls1x_wdt_resume); 162 + 176 163 static const struct of_device_id ls1x_wdt_dt_ids[] = { 177 - { .compatible = "loongson,ls1b-wdt", }, 178 - { .compatible = "loongson,ls1c-wdt", }, 164 + { .compatible = "loongson,ls1b-wdt", .data = &ls1b_wdt_pdata }, 165 + { .compatible = "loongson,ls1c-wdt", .data = &ls1b_wdt_pdata }, 166 + { .compatible = "loongson,ls2k0300-wdt", .data = &ls2k0300_wdt_pdata }, 179 167 { /* sentinel */ } 180 168 }; 181 169 MODULE_DEVICE_TABLE(of, ls1x_wdt_dt_ids); 182 - #endif 183 170 184 171 static struct platform_driver ls1x_wdt_driver = { 185 172 .probe = ls1x_wdt_probe, 186 173 .driver = { 187 174 .name = "ls1x-wdt", 188 - .of_match_table = of_match_ptr(ls1x_wdt_dt_ids), 175 + .of_match_table = ls1x_wdt_dt_ids, 176 + .pm = pm_ptr(&ls1x_wdt_pm_ops), 189 177 }, 190 178 }; 191 179 192 180 module_platform_driver(ls1x_wdt_driver); 193 181 194 182 MODULE_AUTHOR("Yang Ling <gnaygnil@gmail.com>"); 195 - MODULE_DESCRIPTION("Loongson1 Watchdog Driver"); 183 + MODULE_AUTHOR("Binbin Zhou <zhoubinbin@loongson.cn>"); 184 + MODULE_DESCRIPTION("Loongson Watchdog Driver"); 196 185 MODULE_LICENSE("GPL");
+163
drivers/watchdog/renesas_wwdt.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Driver for the Renesas Window Watchdog Timer (WWDT) 4 + * 5 + * The WWDT can only be setup once after boot. Because we cannot know if this 6 + * already happened in early boot stages, it is mandated that the firmware 7 + * configures the watchdog. Linux then adapts according to the given setup. 8 + * Note that this watchdog reports in the default configuration an overflow to 9 + * the Error Control Module which then decides further actions. Or the WWDT is 10 + * configured to generate an interrupt. 11 + */ 12 + 13 + #include <linux/bitfield.h> 14 + #include <linux/clk.h> 15 + #include <linux/interrupt.h> 16 + #include <linux/io.h> 17 + #include <linux/kernel.h> 18 + #include <linux/module.h> 19 + #include <linux/of.h> 20 + #include <linux/platform_device.h> 21 + #include <linux/watchdog.h> 22 + 23 + #define WDTA0WDTE 0x00 24 + #define WDTA0RUN BIT(7) 25 + #define WDTA0_KEY 0x2c 26 + 27 + #define WDTA0MD 0x0c 28 + #define WDTA0OVF(x) FIELD_GET(GENMASK(6, 4), x) 29 + #define WDTA0WIE BIT(3) 30 + #define WDTA0ERM BIT(2) 31 + #define WDTA0WS(x) FIELD_GET(GENMASK(1, 0), x) 32 + 33 + struct wwdt_priv { 34 + void __iomem *base; 35 + struct watchdog_device wdev; 36 + }; 37 + 38 + static int wwdt_start(struct watchdog_device *wdev) 39 + { 40 + struct wwdt_priv *priv = container_of(wdev, struct wwdt_priv, wdev); 41 + 42 + writeb(WDTA0RUN | WDTA0_KEY, priv->base + WDTA0WDTE); 43 + return 0; 44 + } 45 + 46 + static const struct watchdog_info wwdt_ident = { 47 + .options = WDIOF_KEEPALIVEPING | WDIOF_ALARMONLY, 48 + .identity = "Renesas Window Watchdog", 49 + }; 50 + 51 + static const struct watchdog_ops wwdt_ops = { 52 + .owner = THIS_MODULE, 53 + .start = wwdt_start, 54 + }; 55 + 56 + static irqreturn_t wwdt_error_irq(int irq, void *dev_id) 57 + { 58 + struct device *dev = dev_id; 59 + 60 + dev_warn(dev, "Watchdog timed out\n"); 61 + return IRQ_HANDLED; 62 + } 63 + 64 + static irqreturn_t wwdt_pretimeout_irq(int irq, void *dev_id) 65 + { 66 + struct watchdog_device *wdev = dev_id; 67 + 68 + watchdog_notify_pretimeout(wdev); 69 + return IRQ_HANDLED; 70 + } 71 + 72 + static int wwdt_probe(struct platform_device *pdev) 73 + { 74 + struct device *dev = &pdev->dev; 75 + struct wwdt_priv *priv; 76 + struct watchdog_device *wdev; 77 + struct clk *clk; 78 + unsigned long rate; 79 + unsigned int interval, window_size; 80 + int ret; 81 + u8 val; 82 + 83 + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 84 + if (!priv) 85 + return -ENOMEM; 86 + 87 + priv->base = devm_platform_ioremap_resource(pdev, 0); 88 + if (IS_ERR(priv->base)) 89 + return PTR_ERR(priv->base); 90 + 91 + clk = devm_clk_get(dev, "cnt"); 92 + if (IS_ERR(clk)) 93 + return PTR_ERR(clk); 94 + 95 + rate = clk_get_rate(clk); 96 + if (!rate) 97 + return -EINVAL; 98 + 99 + wdev = &priv->wdev; 100 + 101 + val = readb(priv->base + WDTA0WDTE); 102 + if (val & WDTA0RUN) 103 + set_bit(WDOG_HW_RUNNING, &wdev->status); 104 + 105 + val = readb(priv->base + WDTA0MD); 106 + interval = 1 << (9 + WDTA0OVF(val)); 107 + /* size of the closed(!) window per mille */ 108 + window_size = 250 * (3 - WDTA0WS(val)); 109 + 110 + wdev->info = &wwdt_ident; 111 + wdev->ops = &wwdt_ops; 112 + wdev->parent = dev; 113 + wdev->min_hw_heartbeat_ms = window_size * interval / rate; 114 + wdev->max_hw_heartbeat_ms = 1000 * interval / rate; 115 + wdev->timeout = DIV_ROUND_UP(wdev->max_hw_heartbeat_ms, 1000); 116 + watchdog_set_nowayout(wdev, true); 117 + 118 + if (!(val & WDTA0ERM)) { 119 + ret = platform_get_irq_byname(pdev, "error"); 120 + if (ret < 0) 121 + return ret; 122 + 123 + ret = devm_request_threaded_irq(dev, ret, NULL, wwdt_error_irq, 124 + IRQF_ONESHOT, NULL, dev); 125 + if (ret < 0) 126 + return ret; 127 + } 128 + 129 + if (val & WDTA0WIE) { 130 + ret = platform_get_irq_byname(pdev, "pretimeout"); 131 + if (ret < 0) 132 + return ret; 133 + 134 + ret = devm_request_threaded_irq(dev, ret, NULL, wwdt_pretimeout_irq, 135 + IRQF_ONESHOT, NULL, wdev); 136 + if (ret < 0) 137 + return ret; 138 + } 139 + 140 + devm_watchdog_register_device(dev, wdev); 141 + 142 + return 0; 143 + } 144 + 145 + static const struct of_device_id renesas_wwdt_ids[] = { 146 + { .compatible = "renesas,rcar-gen3-wwdt", }, 147 + { .compatible = "renesas,rcar-gen4-wwdt", }, 148 + { /* sentinel */ } 149 + }; 150 + MODULE_DEVICE_TABLE(of, renesas_wwdt_ids); 151 + 152 + static struct platform_driver renesas_wwdt_driver = { 153 + .driver = { 154 + .name = "renesas_wwdt", 155 + .of_match_table = renesas_wwdt_ids, 156 + }, 157 + .probe = wwdt_probe, 158 + }; 159 + module_platform_driver(renesas_wwdt_driver); 160 + 161 + MODULE_DESCRIPTION("Renesas Window Watchdog (WWDT) Driver"); 162 + MODULE_LICENSE("GPL"); 163 + MODULE_AUTHOR("Wolfram Sang <wsa+renesas@sang-engineering.com>");
+3 -1
drivers/watchdog/starfive-wdt.c
··· 500 500 if (pm_runtime_enabled(&pdev->dev)) { 501 501 ret = pm_runtime_put_sync(&pdev->dev); 502 502 if (ret) 503 - goto err_exit; 503 + goto err_unregister_wdt; 504 504 } 505 505 } 506 506 507 507 return 0; 508 508 509 + err_unregister_wdt: 510 + watchdog_unregister_device(&wdt->wdd); 509 511 err_exit: 510 512 starfive_wdt_disable_clock(wdt); 511 513 pm_runtime_disable(&pdev->dev);
+1
drivers/watchdog/via_wdt.c
··· 165 165 dev_err(&pdev->dev, "cannot enable PCI device\n"); 166 166 return -ENODEV; 167 167 } 168 + wdt_res.name = "via_wdt"; 168 169 169 170 /* 170 171 * Allocate a MMIO region which contains watchdog control register
+43 -21
drivers/watchdog/wdat_wdt.c
··· 326 326 return -ENODEV; 327 327 328 328 wdat = devm_kzalloc(dev, sizeof(*wdat), GFP_KERNEL); 329 - if (!wdat) 330 - return -ENOMEM; 329 + if (!wdat) { 330 + ret = -ENOMEM; 331 + goto out_put_table; 332 + } 331 333 332 334 regs = devm_kcalloc(dev, pdev->num_resources, sizeof(*regs), 333 335 GFP_KERNEL); 334 - if (!regs) 335 - return -ENOMEM; 336 + if (!regs) { 337 + ret = -ENOMEM; 338 + goto out_put_table; 339 + } 336 340 337 341 /* WDAT specification wants to have >= 1ms period */ 338 - if (tbl->timer_period < 1) 339 - return -EINVAL; 340 - if (tbl->min_count > tbl->max_count) 341 - return -EINVAL; 342 + if (tbl->timer_period < 1) { 343 + ret = -EINVAL; 344 + goto out_put_table; 345 + } 346 + if (tbl->min_count > tbl->max_count) { 347 + ret = -EINVAL; 348 + goto out_put_table; 349 + } 342 350 343 351 wdat->period = tbl->timer_period; 344 352 wdat->wdd.min_timeout = DIV_ROUND_UP(wdat->period * tbl->min_count, 1000); ··· 363 355 res = &pdev->resource[i]; 364 356 if (resource_type(res) == IORESOURCE_MEM) { 365 357 reg = devm_ioremap_resource(dev, res); 366 - if (IS_ERR(reg)) 367 - return PTR_ERR(reg); 358 + if (IS_ERR(reg)) { 359 + ret = PTR_ERR(reg); 360 + goto out_put_table; 361 + } 368 362 } else if (resource_type(res) == IORESOURCE_IO) { 369 363 reg = devm_ioport_map(dev, res->start, 1); 370 - if (!reg) 371 - return -ENOMEM; 364 + if (!reg) { 365 + ret = -ENOMEM; 366 + goto out_put_table; 367 + } 372 368 } else { 373 369 dev_err(dev, "Unsupported resource\n"); 374 - return -EINVAL; 370 + ret = -EINVAL; 371 + goto out_put_table; 375 372 } 376 373 377 374 regs[i] = reg; ··· 398 385 } 399 386 400 387 instr = devm_kzalloc(dev, sizeof(*instr), GFP_KERNEL); 401 - if (!instr) 402 - return -ENOMEM; 388 + if (!instr) { 389 + ret = -ENOMEM; 390 + goto out_put_table; 391 + } 403 392 404 393 INIT_LIST_HEAD(&instr->node); 405 394 instr->entry = entries[i]; ··· 432 417 433 418 if (!instr->reg) { 434 419 dev_err(dev, "I/O resource not found\n"); 435 - return -EINVAL; 420 + ret = -EINVAL; 421 + goto out_put_table; 436 422 } 437 423 438 424 instructions = wdat->instructions[action]; ··· 441 425 instructions = devm_kzalloc(dev, 442 426 sizeof(*instructions), 443 427 GFP_KERNEL); 444 - if (!instructions) 445 - return -ENOMEM; 428 + if (!instructions) { 429 + ret = -ENOMEM; 430 + goto out_put_table; 431 + } 446 432 447 433 INIT_LIST_HEAD(instructions); 448 434 wdat->instructions[action] = instructions; ··· 461 443 462 444 ret = wdat_wdt_enable_reboot(wdat); 463 445 if (ret) 464 - return ret; 446 + goto out_put_table; 465 447 466 448 platform_set_drvdata(pdev, wdat); 467 449 ··· 478 460 479 461 ret = wdat_wdt_set_timeout(&wdat->wdd, timeout); 480 462 if (ret) 481 - return ret; 463 + goto out_put_table; 482 464 483 465 watchdog_set_nowayout(&wdat->wdd, nowayout); 484 466 watchdog_stop_on_reboot(&wdat->wdd); 485 467 watchdog_stop_on_unregister(&wdat->wdd); 486 - return devm_watchdog_register_device(dev, &wdat->wdd); 468 + ret = devm_watchdog_register_device(dev, &wdat->wdd); 469 + 470 + out_put_table: 471 + acpi_put_table((struct acpi_table_header *)tbl); 472 + return ret; 487 473 } 488 474 489 475 static int wdat_wdt_suspend_noirq(struct device *dev)
+138
include/dt-bindings/watchdog/aspeed-wdt.h
··· 89 89 90 90 #define AST2600_WDT_RESET2_DEFAULT 0x03fffff1 91 91 92 + #define AST2700_WDT_RESET1_CPU (1 << 0) 93 + #define AST2700_WDT_RESET1_DRAM (1 << 1) 94 + #define AST2700_WDT_RESET1_SLI0 (1 << 2) 95 + #define AST2700_WDT_RESET1_EHCI (1 << 3) 96 + #define AST2700_WDT_RESET1_HACE (1 << 4) 97 + #define AST2700_WDT_RESET1_SOC_MISC0 (1 << 5) 98 + #define AST2700_WDT_RESET1_VIDEO (1 << 6) 99 + #define AST2700_WDT_RESET1_2D_GRAPHIC (1 << 7) 100 + #define AST2700_WDT_RESET1_RAVS0 (1 << 8) 101 + #define AST2700_WDT_RESET1_RAVS1 (1 << 9) 102 + #define AST2700_WDT_RESET1_GPIO0 (1 << 10) 103 + #define AST2700_WDT_RESET1_SSP (1 << 11) 104 + #define AST2700_WDT_RESET1_TSP (1 << 12) 105 + #define AST2700_WDT_RESET1_CRT (1 << 13) 106 + #define AST2700_WDT_RESET1_USB20_HOST (1 << 14) 107 + #define AST2700_WDT_RESET1_USB11_HOST (1 << 15) 108 + #define AST2700_WDT_RESET1_UFS (1 << 16) 109 + #define AST2700_WDT_RESET1_EMMC (1 << 17) 110 + #define AST2700_WDT_RESET1_AHB_TO_PCIE1 (1 << 18) 111 + #define AST2700_WDT_RESET1_XDMA0 (1 << 22) 112 + #define AST2700_WDT_RESET1_MCTP1 (1 << 23) 113 + #define AST2700_WDT_RESET1_MCTP0 (1 << 24) 114 + #define AST2700_WDT_RESET1_JTAG0 (1 << 25) 115 + #define AST2700_WDT_RESET1_ECC (1 << 26) 116 + #define AST2700_WDT_RESET1_XDMA1 (1 << 27) 117 + #define AST2700_WDT_RESET1_DP (1 << 28) 118 + #define AST2700_WDT_RESET1_DP_MCU (1 << 29) 119 + #define AST2700_WDT_RESET1_AHB_TO_PCIE0 (1 << 31) 120 + 121 + #define AST2700_WDT_RESET1_DEFAULT 0x8207ff71 122 + 123 + #define AST2700_WDT_RESET2_USB3_A_HOST (1 << 0) 124 + #define AST2700_WDT_RESET2_USB3_A_VHUB3 (1 << 1) 125 + #define AST2700_WDT_RESET2_USB3_A_VHUB2 (1 << 2) 126 + #define AST2700_WDT_RESET2_USB3_B_HOST (1 << 3) 127 + #define AST2700_WDT_RESET2_USB3_B_VHUB3 (1 << 4) 128 + #define AST2700_WDT_RESET2_USB3_B_VHUB2 (1 << 5) 129 + #define AST2700_WDT_RESET2_SM3 (1 << 6) 130 + #define AST2700_WDT_RESET2_SM4 (1 << 7) 131 + #define AST2700_WDT_RESET2_SHA3 (1 << 8) 132 + #define AST2700_WDT_RESET2_RSA (1 << 9) 133 + 134 + #define AST2700_WDT_RESET2_DEFAULT 0x000003f6 135 + 136 + #define AST2700_WDT_RESET3_LPC0 (1 << 0) 137 + #define AST2700_WDT_RESET3_LPC1 (1 << 1) 138 + #define AST2700_WDT_RESET3_MDIO (1 << 2) 139 + #define AST2700_WDT_RESET3_PECI (1 << 3) 140 + #define AST2700_WDT_RESET3_PWM (1 << 4) 141 + #define AST2700_WDT_RESET3_MAC0 (1 << 5) 142 + #define AST2700_WDT_RESET3_MAC1 (1 << 6) 143 + #define AST2700_WDT_RESET3_MAC2 (1 << 7) 144 + #define AST2700_WDT_RESET3_ADC (1 << 8) 145 + #define AST2700_WDT_RESET3_SDC (1 << 9) 146 + #define AST2700_WDT_RESET3_ESPI0 (1 << 10) 147 + #define AST2700_WDT_RESET3_ESPI1 (1 << 11) 148 + #define AST2700_WDT_RESET3_JTAG1 (1 << 12) 149 + #define AST2700_WDT_RESET3_SPI0 (1 << 13) 150 + #define AST2700_WDT_RESET3_SPI1 (1 << 14) 151 + #define AST2700_WDT_RESET3_SPI2 (1 << 15) 152 + #define AST2700_WDT_RESET3_I3C0 (1 << 16) 153 + #define AST2700_WDT_RESET3_I3C1 (1 << 17) 154 + #define AST2700_WDT_RESET3_I3C2 (1 << 18) 155 + #define AST2700_WDT_RESET3_I3C3 (1 << 19) 156 + #define AST2700_WDT_RESET3_I3C4 (1 << 20) 157 + #define AST2700_WDT_RESET3_I3C5 (1 << 21) 158 + #define AST2700_WDT_RESET3_I3C6 (1 << 22) 159 + #define AST2700_WDT_RESET3_I3C7 (1 << 23) 160 + #define AST2700_WDT_RESET3_I3C8 (1 << 24) 161 + #define AST2700_WDT_RESET3_I3C9 (1 << 25) 162 + #define AST2700_WDT_RESET3_I3C10 (1 << 26) 163 + #define AST2700_WDT_RESET3_I3C11 (1 << 27) 164 + #define AST2700_WDT_RESET3_I3C12 (1 << 28) 165 + #define AST2700_WDT_RESET3_I3C13 (1 << 29) 166 + #define AST2700_WDT_RESET3_I3C14 (1 << 30) 167 + #define AST2700_WDT_RESET3_I3C15 (1 << 31) 168 + 169 + #define AST2700_WDT_RESET3_DEFAULT 0x000093ec 170 + 171 + #define AST2700_WDT_RESET4_FMC (1 << 0) 172 + #define AST2700_WDT_RESET4_SOC_MISC1 (1 << 1) 173 + #define AST2700_WDT_RESET4_AHB (1 << 2) 174 + #define AST2700_WDT_RESET4_SLI1 (1 << 3) 175 + #define AST2700_WDT_RESET4_UART0 (1 << 4) 176 + #define AST2700_WDT_RESET4_UART1 (1 << 5) 177 + #define AST2700_WDT_RESET4_UART2 (1 << 6) 178 + #define AST2700_WDT_RESET4_UART3 (1 << 7) 179 + #define AST2700_WDT_RESET4_I2C_MONITOR (1 << 8) 180 + #define AST2700_WDT_RESET4_HOST_TO_SPI1 (1 << 9) 181 + #define AST2700_WDT_RESET4_HOST_TO_SPI2 (1 << 10) 182 + #define AST2700_WDT_RESET4_GPIO1 (1 << 11) 183 + #define AST2700_WDT_RESET4_FSI (1 << 12) 184 + #define AST2700_WDT_RESET4_CANBUS (1 << 13) 185 + #define AST2700_WDT_RESET4_MCTP (1 << 14) 186 + #define AST2700_WDT_RESET4_XDMA (1 << 15) 187 + #define AST2700_WDT_RESET4_UART5 (1 << 16) 188 + #define AST2700_WDT_RESET4_UART6 (1 << 17) 189 + #define AST2700_WDT_RESET4_UART7 (1 << 18) 190 + #define AST2700_WDT_RESET4_UART8 (1 << 19) 191 + #define AST2700_WDT_RESET4_BOOT_MCU (1 << 20) 192 + #define AST2700_WDT_RESET4_IO_MCU (1 << 21) 193 + #define AST2700_WDT_RESET4_LTPI0 (1 << 22) 194 + #define AST2700_WDT_RESET4_VGA_LINK (1 << 23) 195 + #define AST2700_WDT_RESET4_LTPI1 (1 << 24) 196 + #define AST2700_WDT_RESET4_LTPI_PHY (1 << 25) 197 + #define AST2700_WDT_RESET4_ACE (1 << 26) 198 + #define AST2700_WDT_RESET4_LTPI_GPIO0 (1 << 28) 199 + #define AST2700_WDT_RESET4_LTPI_GPIO1 (1 << 29) 200 + #define AST2700_WDT_RESET4_AHB_TO_PCIE1 (1 << 30) 201 + #define AST2700_WDT_RESET4_I3C_DMA (1 << 31) 202 + 203 + #define AST2700_WDT_RESET4_DEFAULT 0x40303803 204 + 205 + #define AST2700_WDT_RESET5_I2C_GLOBAL (1 << 0) 206 + #define AST2700_WDT_RESET5_I2C0 (1 << 1) 207 + #define AST2700_WDT_RESET5_I2C1 (1 << 2) 208 + #define AST2700_WDT_RESET5_I2C2 (1 << 3) 209 + #define AST2700_WDT_RESET5_I2C3 (1 << 4) 210 + #define AST2700_WDT_RESET5_I2C4 (1 << 5) 211 + #define AST2700_WDT_RESET5_I2C5 (1 << 6) 212 + #define AST2700_WDT_RESET5_I2C6 (1 << 7) 213 + #define AST2700_WDT_RESET5_I2C7 (1 << 8) 214 + #define AST2700_WDT_RESET5_I2C8 (1 << 9) 215 + #define AST2700_WDT_RESET5_I2C9 (1 << 10) 216 + #define AST2700_WDT_RESET5_I2C10 (1 << 11) 217 + #define AST2700_WDT_RESET5_I2C11 (1 << 12) 218 + #define AST2700_WDT_RESET5_I2C12 (1 << 13) 219 + #define AST2700_WDT_RESET5_I2C13 (1 << 14) 220 + #define AST2700_WDT_RESET5_I2C14 (1 << 15) 221 + #define AST2700_WDT_RESET5_I2C15 (1 << 16) 222 + #define AST2700_WDT_RESET5_UHCI (1 << 17) 223 + #define AST2700_WDT_RESET5_USB2_C_UART (1 << 18) 224 + #define AST2700_WDT_RESET5_USB2_C (1 << 19) 225 + #define AST2700_WDT_RESET5_USB2_D_UART (1 << 20) 226 + #define AST2700_WDT_RESET5_USB2_D (1 << 21) 227 + 228 + #define AST2700_WDT_RESET5_DEFAULT 0x00320000 229 + 92 230 #endif