1 From 8273b9e71c1f5c1f6f74faac21de64bf42686817 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Mon, 19 Apr 2021 10:33:24 +0100
4 Subject: [PATCH] overlays: spi-rtc: Add ds3232 and ds3234
6 Extend the spi-rtc overlay to support the ds3232 and ds3234 RTCs, as
7 well as adding parameters to select difference SPI controllers and
10 N.B. The default CS is now active-low - use the "cs_high" parameter to
13 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
15 arch/arm/boot/dts/overlays/README | 12 +++-
16 .../arm/boot/dts/overlays/spi-rtc-overlay.dts | 58 ++++++++++++++++---
17 2 files changed, 61 insertions(+), 9 deletions(-)
19 --- a/arch/arm/boot/dts/overlays/README
20 +++ b/arch/arm/boot/dts/overlays/README
21 @@ -2689,7 +2689,17 @@ Params: <None>
23 Info: Adds support for a number of SPI Real Time Clock devices
24 Load: dtoverlay=spi-rtc,<param>=<val>
25 -Params: pcf2123 Select the PCF2123 device
26 +Params: ds3232 Select the DS3232 device
27 + ds3234 Select the DS3234 device
28 + pcf2123 Select the PCF2123 device
30 + spi0_0 Use spi0.0 (default)
36 + cs_high This device requires an active-high CS
40 --- a/arch/arm/boot/dts/overlays/spi-rtc-overlay.dts
41 +++ b/arch/arm/boot/dts/overlays/spi-rtc-overlay.dts
43 +// Definitions for several SPI-based Real Time Clocks
48 compatible = "brcm,bcm2835";
51 - target = <&spidev0>;
54 - status = "disabled";
55 + compatible = "maxim,ds3232";
63 + compatible = "maxim,ds3234";
70 + compatible = "nxp,rtc-pcf2123";
74 + spidev: fragment@100 {
75 + target = <&spidev0>;
77 + status = "disabled";
81 + frag101: fragment@101 {
89 - compatible = "nxp,rtc-pcf2123";
90 - spi-max-frequency = <5000000>;
94 + spi-max-frequency = <5000000>;
100 - pcf2123 = <0>, "=0=1";
101 + spi0_0 = <&spidev>, "target:0=",<&spidev0>,
102 + <&frag101>, "target:0=",<&spi0>,
104 + spi0_1 = <&spidev>, "target:0=",<&spidev1>,
105 + <&frag101>, "target:0=",<&spi0>,
107 + spi1_0 = <0>,"-100",
108 + <&frag101>, "target:0=",<&spi1>,
110 + spi1_1 = <0>,"-100",
111 + <&frag101>, "target:0=",<&spi1>,
113 + spi2_0 = <0>,"-100",
114 + <&frag101>, "target:0=",<&spi2>,
116 + spi2_1 = <0>,"-100",
117 + <&frag101>, "target:0=",<&spi2>,
119 + cs_high = <&rtc>, "spi-cs-high?";
123 + pcf2123 = <0>,"+2";