Skip to contentSkip to conversation

rtc: Introduce rtc-ti-k3

PATCH Applied Nishanth Menon 3 participants 5 messages Jun 23, 2022 – Jun 24, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover rtc: Introduce rtc-ti-k3

Hi Folks,

One more round..

This series adds support for TI K3 RTC as instantiated on TI's AM625 SoC.

Documentation in the current early release version of Technical Reference Manual is incomplete at the moment, but due to be updated later this year.
https://www.ti.com/lit/pdf/spruiv7

Testing log can be found here (next-20220623 + additional node for dts):
https://gist.github.com/nmenon/2949ac6227a834dc64ef463dc737c764

Changes since V3:
* Picked up Krzysztof's Reviewed-by
* Review comments from Alexandre

V3: https://lore.kernel.org/all/[email protected]/
V2: https://lore.kernel.org/all/[email protected]/
V1: https://lore.kernel.org/all/[email protected]/

Nishanth Menon (2):
dt-bindings: rtc: Add TI K3 RTC description
rtc: Introduce ti-k3-rtc

 .../devicetree/bindings/rtc/ti,k3-rtc.yaml    |  62 ++
 drivers/rtc/Kconfig                           |  11 +
 drivers/rtc/Makefile                          |   1 +
 drivers/rtc/rtc-ti-k3.c                       | 680 ++++++++++++++++++
 4 files changed, 754 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/ti,k3-rtc.yaml
 create mode 100644 drivers/rtc/rtc-ti-k3.c
Signature · 9 lines
2.31.1

Regards,
Nishanth Menon

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH v4 1/2 dt-bindings: rtc: Add TI K3 RTC description

This adds the documentation for the devicetree bindings of the Texas Instruments RTC modules on K3 family of SoCs such as AM62x SoCs or newer.

---
Changes since V3:
* pickedup Krzysztof's reviewed-by

V3: https://lore.kernel.org/all/[email protected]/
V2: https://lore.kernel.org/all/[email protected]/
V1: https://lore.kernel.org/all/[email protected]/

 .../devicetree/bindings/rtc/ti,k3-rtc.yaml    | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/ti,k3-rtc.yaml
Documentation/devicetree/bindings/rtc/ti,k3-rtc.yaml new file +62 -0
new file mode 100644
index 000000000000..d995ef04a6eb
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/ti,k3-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments K3 Real Time Clock
+
+maintainers:
+  - Nishanth Menon <[email protected]>
+
+description: |
+  This RTC appears in the AM62x family of SoCs.
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+properties:
+  compatible:
+    enum:
+      - ti,am62-rtc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: VBUS Interface clock
+      - description: 32k Clock source (external or internal).
+
+  clock-names:
+    items:
+      - const: vbus
+      - const: osc32k
+
+  power-domains:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    rtc@2b1f0000 {
+        compatible = "ti,am62-rtc";
+        reg = <0x2b1f0000 0x100>;
+        interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
+        power-domains = <&bar 0>;
+        clocks = <&foo 0>, <&foo 1>;
+        clock-names = "vbus", "osc32k";
+        wakeup-source;
+    };
Signature · 7 lines
2.31.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH v4 2/2 rtc: Introduce ti-k3-rtc

In reply to Nishanth Menon

Introduce support for Texas Instruments Real Time Clock controller on newer K3 family of SoCs such as AM62x.

The hardware module that is being supported is the "digital only" version which doesn't have capability of external wakeup sources and external power backup. However, for many practical applications, this should suffice as RTC is operational across low power sequences.

The hardware block by itself is split into two distinct domains internally to further reduce the power consumption with the actual counter block and comparators clocked off a 32k clock source (which based on SoC integration can be sourced by an external crystal) and an register interface block which is driven by the bus clock. While optimal from power perspective, it does create some complicated synchronizations and sequences that one must be wary of in the driver handling.

---
Changes since V3:
* Updates for fixing typos, removal of un-necessary prints, sharpen usage of ret

V3: https://lore.kernel.org/all/[email protected]/
V2: https://lore.kernel.org/all/[email protected]/
V1: https://lore.kernel.org/all/[email protected]/

 drivers/rtc/Kconfig     |  11 +
 drivers/rtc/Makefile    |   1 +
 drivers/rtc/rtc-ti-k3.c | 680 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 692 insertions(+)
 create mode 100644 drivers/rtc/rtc-ti-k3.c
drivers/rtc/Kconfig +11 -0
index a00f901b5c1d..80557d326776 100644
@@ -1929,6 +1929,17 @@ config RTC_DRV_ASPEED
 	  This driver can also be built as a module, if so, the module
 	  will be called "rtc-aspeed".
 
+config RTC_DRV_TI_K3
+	tristate "TI K3 RTC"
+	depends on ARCH_K3 || COMPILE_TEST
+	select REGMAP_MMIO
+	help
+	  If you say yes here you get support for the Texas Instruments's
+	  Real Time Clock for K3 architecture.
+
+	  This driver can also be built as a module, if so, the module
+	  will be called "rtc-ti-k3".
+
 comment "HID Sensor RTC drivers"
 
 config RTC_DRV_HID_SENSOR_TIME
drivers/rtc/Makefile +1 -0
index fb04467b652d..e449b174165b 100644
@@ -172,6 +172,7 @@ obj-$(CONFIG_RTC_DRV_SUNPLUS)	+= rtc-sunplus.o
 obj-$(CONFIG_RTC_DRV_SUNXI)	+= rtc-sunxi.o
 obj-$(CONFIG_RTC_DRV_TEGRA)	+= rtc-tegra.o
 obj-$(CONFIG_RTC_DRV_TEST)	+= rtc-test.o
+obj-$(CONFIG_RTC_DRV_TI_K3)	+= rtc-ti-k3.o
 obj-$(CONFIG_RTC_DRV_TPS6586X)	+= rtc-tps6586x.o
 obj-$(CONFIG_RTC_DRV_TPS65910)	+= rtc-tps65910.o
 obj-$(CONFIG_RTC_DRV_TWL4030)	+= rtc-twl.o
drivers/rtc/rtc-ti-k3.c new file +680 -0

680 lines not on this page · raw message

Signature · 7 lines
2.31.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tested-by on v4 2/2
#3 lore raw

Re: [PATCH V4 2/2] rtc: Introduce ti-k3-rtc

Hi,

Quoted 16 lines · Nishanth Menon

Introduce support for Texas Instruments Real Time Clock controller on newer K3 family of SoCs such as AM62x.

The hardware module that is being supported is the "digital only" version which doesn't have capability of external wakeup sources and external power backup. However, for many practical applications, this should suffice as RTC is operational across low power sequences.

The hardware block by itself is split into two distinct domains internally to further reduce the power consumption with the actual counter block and comparators clocked off a 32k clock source (which based on SoC integration can be sourced by an external crystal) and an register interface block which is driven by the bus clock. While optimal from power perspective, it does create some complicated synchronizations and sequences that one must be wary of in the driver handling.

Quoted 6 lines

---
Changes since V3:
* Updates for fixing typos, removal of un-necessary prints, sharpen usage of ret

Tested on SK-AM62 (AM625).

Regards,
Georgi

maintainer Applied
#4 lore raw
In reply to Nishanth Menon
Quoted 11 lines · Nishanth Menon

One more round..

This series adds support for TI K3 RTC as instantiated on TI's AM625 SoC.

Documentation in the current early release version of Technical Reference Manual is incomplete at the moment, but due to be updated later this year.
https://www.ti.com/lit/pdf/spruiv7

[...]

Applied, thanks!

[1/2] dt-bindings: rtc: Add TI K3 RTC description

      commit: 5e665cf1f0c52163de5517bfb9258390e63772b2
[2/2] rtc: Introduce ti-k3-rtc
      commit: b09d633575e54e98e1362bd5c36cd9571cb71d8a

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com