Skip to contentSkip to conversation

dt-bindings: watchdog: convert Broadcom's WDT to the json-schema

PATCH Superseded Rafał Miłecki 1 participant 3 messages Oct 29, 2021

Subsystems (4)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 dt-bindings: watchdog: convert Broadcom's WDT to the json-schema

From: Rafał Miłecki <[email protected]>

This helps validating DTS files.

---
V2: Don't rename to bcm63xx
Add driver authors as maintainers

---
 .../bindings/watchdog/brcm,bcm7038-wdt.txt    | 19 ---------
 .../bindings/watchdog/brcm,bcm7038-wdt.yaml   | 40 +++++++++++++++++++
 2 files changed, 40 insertions(+), 19 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt
 create mode 100644 Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.yaml
Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt deleted +0 -19
deleted file mode 100644
index 84122270be8f..000000000000
@@ -1,19 +0,0 @@
-BCM7038 Watchdog timer
-
-Required properties:
-
-- compatible : should be "brcm,bcm7038-wdt"
-- reg : Specifies base physical address and size of the registers.
-
-Optional properties:
-
-- clocks: The clock running the watchdog. If no clock is found the
-	  driver will default to 27000000 Hz.
-
-Example:
-
-watchdog@f040a7e8 {
-	compatible = "brcm,bcm7038-wdt";
-	clocks = <&upg_fixed>;
-	reg = <0xf040a7e8 0x16>;
-};
Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.yaml new file +40 -0
new file mode 100644
index 000000000000..69e5a1ef6a1f
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/watchdog/brcm,bcm63xx-wdt.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: BCM7038 watchdog timer
+
+allOf:
+  - $ref: "watchdog.yaml#"
+
+maintainers:
+  - Florian Fainelli <[email protected]>
+  - Justin Chen <[email protected]>
+  - Rafał Miłecki <[email protected]>
+
+properties:
+  compatible:
+    const: brcm,bcm7038-wdt
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    description: >
+      The clock running the watchdog. If no clock is found the driver will
+      default to 27000000 Hz.
+
+unevaluatedProperties: false
+
+required:
+  - reg
+
+examples:
+  - |
+    watchdog@f040a7e8 {
+      compatible = "brcm,bcm7038-wdt";
+      reg = <0xf040a7e8 0x16>;
+      clocks = <&upg_fixed>;
+    };
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 2/3 dt-bindings: watchdog: brcm, bcm63xx-wdt: add BCM4908 compatibility

From: Rafał Miłecki <[email protected]>

BCM4908 is another SoC with the same hardware block. It just uses a slightly different registers layout.

---
V2: Update title

---
 .../devicetree/bindings/watchdog/brcm,bcm7038-wdt.yaml      | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.yaml +4 -2
index 69e5a1ef6a1f..5e37bf47efe8 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/watchdog/brcm,bcm63xx-wdt.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: BCM7038 watchdog timer
+title: BCM4908 and BCM7038 watchdog timer
 
 allOf:
   - $ref: "watchdog.yaml#"
@@ -16,7 +16,9 @@ maintainers:
 
 properties:
   compatible:
-    const: brcm,bcm7038-wdt
+    enum:
+      - brcm,bcm4908-wdt
+      - brcm,bcm7038-wdt
 
   reg:
     maxItems: 1
Signature · 1 line
2.31.1
#2 lore raw

PATCH v2 3/3 watchdog: bcm7038_wdt: support BCM4908 SoC

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

Hardware supported by this driver goes back to the old bcm63xx days. It was then reused in BCM7038 and later also in BCM4908.

Depending on SoC model registers layout differs a bit. This commit introduces support for per-chipset registers offsets & adds BCM4908 layout.

---
V2: Simplify commit message
Use registers names matching Broadcom's SDK / docs

---
 drivers/watchdog/Kconfig       |  2 +-
 drivers/watchdog/bcm7038_wdt.c | 89 ++++++++++++++++++++++++++--------
 2 files changed, 69 insertions(+), 22 deletions(-)
drivers/watchdog/Kconfig +1 -1
index 0fab8230b663..ca600e6d21be 100644
@@ -1743,7 +1743,7 @@ config BCM7038_WDT
 	tristate "BCM7038 Watchdog"
 	select WATCHDOG_CORE
 	depends on HAS_IOMEM
-	depends on ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
+	depends on ARCH_BCM4908 || ARCH_BRCMSTB || BMIPS_GENERIC || COMPILE_TEST
 	help
 	 Watchdog driver for the built-in hardware in Broadcom 7038 and
 	 later SoCs used in set-top boxes.  BCM7038 was made public
drivers/watchdog/bcm7038_wdt.c +68 -21

160 lines not on this page · raw message

Signature · 1 line
2.31.1