Skip to contentSkip to conversation

dt-bindings: rtc: pcf2127: update bindings

PATCH Superseded Alexandre Belloni 2 participants 7 messages Dec 19, 2020 – Jan 27, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Alexandre Belloni

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: rtc: pcf2127: update bindings

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

---
 .../devicetree/bindings/rtc/nxp,pcf2127.yaml  | 54 +++++++++++++++++++
 .../devicetree/bindings/rtc/trivial-rtc.yaml  |  6 ---
 2 files changed, 54 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml
Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml new file +54 -0
new file mode 100644
index 000000000000..daa479b395a6
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/nxp,pcf2127.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP PCF2127, PXF2129 and PCA2129 Real Time Clocks
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+maintainers:
+  - Alexandre Belloni <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - nxp,pcf2127
+      - nxp,pcf2129
+      - nxp,pca2129
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  start-year: true
+
+  reset-source: true
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@51 {
+            compatible = "nxp,pcf2127";
+            reg = <0x51>;
+            pinctrl-0 = <&rtc_nint_pins>;
+            interrupts-extended = <&gpio1 16 IRQ_TYPE_LEVEL_HIGH>;
+            reset-source;
+        };
+    };
+
+...
Documentation/devicetree/bindings/rtc/trivial-rtc.yaml +0 -6
index c7d14de214c4..17816b734a51 100644
@@ -48,12 +48,6 @@ properties:
       - microcrystal,rv3029
       # Real Time Clock
       - microcrystal,rv8523
-      # Real-time clock
-      - nxp,pcf2127
-      # Real-time clock
-      - nxp,pcf2129
-      # Real-time clock
-      - nxp,pca2129
       # Real-time Clock Module
       - pericom,pt7c4338
       # I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
Signature · 1 line
2.29.2
#1 lore raw
Quoted 2 lines · Alexandre Belloni

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source property to a 2129 node. But the commit message is a bit misleading.

Rasmus

author maintainer
#2 lore raw
Quoted 9 lines · Rasmus Villemoes
Quoted 2 lines · Alexandre Belloni

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source property to a 2129 node. But the commit message is a bit misleading.

Ah sure, I forgot about that., the simplest way is then to not mov pcf/pca2129 out of trivial

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
author maintainer
#3 lore raw
In reply to Rasmus Villemoes
Quoted 9 lines · Rasmus Villemoes
Quoted 2 lines · Alexandre Belloni

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source property to a 2129 node. But the commit message is a bit misleading.

Actually no, the INT pin can be used as a reset, the pcf/pca2129 can be used as a watchdog and so it may need the reset-source property.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw
Quoted 5 lines · Alexandre Belloni
Quoted 4 lines · Rasmus Villemoes
Quoted 2 lines · Alexandre Belloni

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

Quoted 8 lines
Quoted 5 lines

No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source property to a 2129 node. But the commit message is a bit misleading.

Actually no, the INT pin can be used as a reset, the pcf/pca2129 can be used as a watchdog and so it may need the reset-source property.

Unless I'm missing something, that would require some rather creative extra circuitry: The interrupt pin is kept low until the appropriate bit in the rtc is cleared, so if that is routed directly to a reset pin on the SOC, the SOC would be kept in reset indefinitely.

Rasmus

author maintainer
#5 lore raw
Quoted 12 lines · Rasmus Villemoes
Quoted 11 lines · Alexandre Belloni
Quoted 9 lines · Rasmus Villemoes
Quoted 2 lines · Alexandre Belloni

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source property to a 2129 node. But the commit message is a bit misleading.

Quoted 8 lines
Quoted 2 lines

Actually no, the INT pin can be used as a reset, the pcf/pca2129 can be used as a watchdog and so it may need the reset-source property.

Unless I'm missing something, that would require some rather creative extra circuitry: The interrupt pin is kept low until the appropriate bit in the rtc is cleared, so if that is routed directly to a reset pin on the SOC, the SOC would be kept in reset indefinitely.

You mean inverting the level of INT? I don't think this is creative or complicated...
And anyway, INT# is active low, like RST# so if the SoC has an RST# input, this should just work.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw
Quoted 16 lines · Alexandre Belloni
Quoted 15 lines · Rasmus Villemoes
Quoted 13 lines · Alexandre Belloni
Quoted 9 lines · Rasmus Villemoes
Quoted 2 lines · Alexandre Belloni

pcf2127, pcf2129 and pca2129 support start-year and reset-source.

No, the 2129 variant doesn't even have a reset output pin. Not sure if there's any way to reflect that, and it probably doesn't matter, since nobody's going to add the reset-source property to a 2129 node. But the commit message is a bit misleading.

Actually no, the INT pin can be used as a reset, the pcf/pca2129 can be used as a watchdog and so it may need the reset-source property.

Quoted 8 lines
Quoted 5 lines

Unless I'm missing something, that would require some rather creative extra circuitry: The interrupt pin is kept low until the appropriate bit in the rtc is cleared, so if that is routed directly to a reset pin on the SOC, the SOC would be kept in reset indefinitely.

You mean inverting the level of INT? I don't think this is creative or complicated...

No, that is not what I meant nor what I wrote.

Quoted 2 lines

And anyway, INT# is active low, like RST# so if the SoC has an RST# input, this should just work.

AFAIK (and that may certainly be wrong), most SOCs require a _pulse_ on their reset input; asserting and keeping the reset pin low would just keep the cpu in reset, never allowing it to leave that state and then talk to the RTC to clear the bit that would clear the interrupt.

That's also how the 2127 RST# behaves: it generates a pulse (of width 244us or 15ms). The INT# and RST# pins cannot be used interchangeably.

Rasmus