Skip to contentSkip to conversation

dt-bindings: timer: Add SiFive CLINT2

PATCH Superseded Nick Hu 2 participants 5 messages Mar 14, 2025 – Mar 19, 2025

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Nick Hu

author
#0 lore raw

PATCH v2 1/1 dt-bindings: timer: Add SiFive CLINT2

Add compatible string and property for the SiFive CLINT v2.

---
- v2 changes:
- Don't allow sifive,clint2 by itself. Add '-{}' to the first entry
- Mark the sifive,fine-ctr-bits as the required property when the compatible includes the sifive,clint2

 .../bindings/timer/sifive,clint.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +20 -0
index 76d83aea4e2b..4b9dad11c1e9 100644
@@ -36,6 +36,10 @@ properties:
               - starfive,jh7110-clint   # StarFive JH7110
               - starfive,jh8100-clint   # StarFive JH8100
           - const: sifive,clint0        # SiFive CLINT v0 IP block
+      - items:
+          - {}
+          - const: sifive,clint2        # SiFive CLINT v2 IP block
+        description: SiFive CLINT v2 is the HRT that supports the Zicntr
       - items:
           - enum:
               - allwinner,sun20i-d1-clint
@@ -62,6 +66,22 @@ properties:
     minItems: 1
     maxItems: 4095
 
+  sifive,fine-ctr-bits:
+    maximum: 15
+    description: The width in bits of the fine counter.
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: sifive,clint2
+then:
+  required:
+    - sifive,fine-ctr-bits
+else:
+  properties:
+    sifive,fine-ctr-bits: false
+
 additionalProperties: false
 
 required:
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 1 line · Nick Hu

Add compatible string and property for the SiFive CLINT v2.

Conor asked about being backwards compatible with v1. Please say why it isn't here.

Quoted 53 lines

---
- v2 changes:
- Don't allow sifive,clint2 by itself. Add '-{}' to the first entry
- Mark the sifive,fine-ctr-bits as the required property when the compatible includes the sifive,clint2

 .../bindings/timer/sifive,clint.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +20 -0
index 76d83aea4e2b..4b9dad11c1e9 100644
@@ -36,6 +36,10 @@ properties:
               - starfive,jh7110-clint   # StarFive JH7110
               - starfive,jh8100-clint   # StarFive JH8100
           - const: sifive,clint0        # SiFive CLINT v0 IP block
+      - items:
+          - {}
+          - const: sifive,clint2        # SiFive CLINT v2 IP block
+        description: SiFive CLINT v2 is the HRT that supports the Zicntr
       - items:
           - enum:
               - allwinner,sun20i-d1-clint
@@ -62,6 +66,22 @@ properties:
     minItems: 1
     maxItems: 4095
 
+  sifive,fine-ctr-bits:
+    maximum: 15
+    description: The width in bits of the fine counter.
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: sifive,clint2
+then:
+  required:
+    - sifive,fine-ctr-bits
+else:
+  properties:
+    sifive,fine-ctr-bits: false
+
 additionalProperties: false
 
 required:
Signature · 1 line
2.17.1
author
#2 lore raw

Hi Rob

Sorry, I thought I had replied to the mailing list, but it looks like I only sent it to Conor.

The control of sifive,clint2 differs from that of sifive,clint0, making them incompatible.

Quoted 56 lines · Rob Herring
Quoted 1 line · Nick Hu

Add compatible string and property for the SiFive CLINT v2.

Conor asked about being backwards compatible with v1. Please say why it isn't here.

Quoted 49 lines

---
- v2 changes:
- Don't allow sifive,clint2 by itself. Add '-{}' to the first entry
- Mark the sifive,fine-ctr-bits as the required property when the compatible includes the sifive,clint2

 .../bindings/timer/sifive,clint.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +20 -0
index 76d83aea4e2b..4b9dad11c1e9 100644
@@ -36,6 +36,10 @@ properties:
               - starfive,jh7110-clint   # StarFive JH7110
               - starfive,jh8100-clint   # StarFive JH8100
           - const: sifive,clint0        # SiFive CLINT v0 IP block
+      - items:
+          - {}
+          - const: sifive,clint2        # SiFive CLINT v2 IP block
+        description: SiFive CLINT v2 is the HRT that supports the Zicntr
       - items:
           - enum:
               - allwinner,sun20i-d1-clint
@@ -62,6 +66,22 @@ properties:
     minItems: 1
     maxItems: 4095
 
+  sifive,fine-ctr-bits:
+    maximum: 15
+    description: The width in bits of the fine counter.
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: sifive,clint2
+then:
+  required:
+    - sifive,fine-ctr-bits
+else:
+  properties:
+    sifive,fine-ctr-bits: false
+
 additionalProperties: false
 
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/sifive,clint.yaml +0 -1
 required:
--

2.17.1

Best Regards,
Nick

maintainer
#3 lore raw
Quoted 2 lines · Nick Hu

Hi Rob

Please don't top post.

Quoted 5 lines

Sorry, I thought I had replied to the mailing list, but it looks like I only sent it to Conor.

The control of sifive,clint2 differs from that of sifive,clint0, making them incompatible.

The answer belongs in the patch, not just in a reply. Assume we've forgotten everything said in the prior version because we likely have, so you don't want to get the same questions again.

Quoted 66 lines · Rob Herring
Quoted 56 lines · Nick Hu
Quoted 1 line

Add compatible string and property for the SiFive CLINT v2.

Conor asked about being backwards compatible with v1. Please say why it isn't here.

Quoted 49 lines

---
- v2 changes:
- Don't allow sifive,clint2 by itself. Add '-{}' to the first entry
- Mark the sifive,fine-ctr-bits as the required property when the compatible includes the sifive,clint2

 .../bindings/timer/sifive,clint.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +20 -0
index 76d83aea4e2b..4b9dad11c1e9 100644
@@ -36,6 +36,10 @@ properties:
               - starfive,jh7110-clint   # StarFive JH7110
               - starfive,jh8100-clint   # StarFive JH8100
           - const: sifive,clint0        # SiFive CLINT v0 IP block
+      - items:
+          - {}
+          - const: sifive,clint2        # SiFive CLINT v2 IP block
+        description: SiFive CLINT v2 is the HRT that supports the Zicntr
       - items:
           - enum:
               - allwinner,sun20i-d1-clint
@@ -62,6 +66,22 @@ properties:
     minItems: 1
     maxItems: 4095
 
+  sifive,fine-ctr-bits:
+    maximum: 15
+    description: The width in bits of the fine counter.
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: sifive,clint2
+then:
+  required:
+    - sifive,fine-ctr-bits
+else:
+  properties:
+    sifive,fine-ctr-bits: false
+
 additionalProperties: false
 
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/sifive,clint.yaml +0 -1
 required:
--

2.17.1

Best Regards,
Nick

author
#4 lore raw

Hi Rob

Quoted 10 lines · Rob Herring
Quoted 2 lines · Nick Hu

Hi Rob

Please don't top post.

Quoted 3 lines

Sorry, I thought I had replied to the mailing list, but it looks like I only sent it to Conor.

Quoted 7 lines
Quoted 2 lines

The control of sifive,clint2 differs from that of sifive,clint0, making them incompatible.

The answer belongs in the patch, not just in a reply. Assume we've forgotten everything said in the prior version because we likely have, so you don't want to get the same questions again.

Sure, I can include a description in the patch. I'll make the update in the next version.

Quoted 58 lines
Quoted 58 lines · Rob Herring
Quoted 56 lines · Nick Hu
Quoted 1 line

Add compatible string and property for the SiFive CLINT v2.

Conor asked about being backwards compatible with v1. Please say why it isn't here.

Quoted 49 lines

---
- v2 changes:
- Don't allow sifive,clint2 by itself. Add '-{}' to the first entry
- Mark the sifive,fine-ctr-bits as the required property when the compatible includes the sifive,clint2

 .../bindings/timer/sifive,clint.yaml          | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
Documentation/devicetree/bindings/timer/sifive,clint.yaml +20 -0
index 76d83aea4e2b..4b9dad11c1e9 100644
@@ -36,6 +36,10 @@ properties:
               - starfive,jh7110-clint   # StarFive JH7110
               - starfive,jh8100-clint   # StarFive JH8100
           - const: sifive,clint0        # SiFive CLINT v0 IP block
+      - items:
+          - {}
+          - const: sifive,clint2        # SiFive CLINT v2 IP block
+        description: SiFive CLINT v2 is the HRT that supports the Zicntr
       - items:
           - enum:
               - allwinner,sun20i-d1-clint
@@ -62,6 +66,22 @@ properties:
     minItems: 1
     maxItems: 4095
 
+  sifive,fine-ctr-bits:
+    maximum: 15
+    description: The width in bits of the fine counter.
+
+if:
+  properties:
+    compatible:
+      contains:
+        const: sifive,clint2
+then:
+  required:
+    - sifive,fine-ctr-bits
+else:
+  properties:
+    sifive,fine-ctr-bits: false
+
 additionalProperties: false
 
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Documentation/devicetree/bindings/timer/sifive,clint.yaml +0 -1
 required:
--

2.17.1

Best Regards,
Nick

Best Regards,
Nick