* [PATCH 0/3] Raspberry Pi 5 RTC driver
@ 2026-09-09 14:12 Sander Speetjens
2026-09-09 14:12 ` [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding Sander Speetjens
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Sander Speetjens @ 2026-09-09 14:12 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli,
Jonathan Bell, Stefan Wahren, linux-rtc, devicetree,
linux-rpi-kernel, linux-arm-kernel, sander.speetjens
The Raspberry Pi 5 has a battery-backed RTC located on the DA9091 PMIC.
Access to the RTC is provided exclusively through the VideoCore firmware
mailbox interface (not via a direct I2C/SPI register interface).
This series adds:
- a DT binding for the "raspberrypi,rpi-rtc" compatible
- the RTC driver that talks to the firmware
- the corresponding DT node for the Raspberry Pi 5 B
The driver and binding are based on (and largely taken from) the
downstream Raspberry Pi kernel. The main changes for upstream are
the addition of a formal DT binding and moving the RTC node out of
the /soc node (it is not an MMIO device).
The driver supports time read/write, alarm, and optional trickle
charging voltage configuration via device-tree.
Testing
-------
- Hardware: Raspberry Pi 5 Model B revC
- Kernel: v7.2
- dt_binding_check: passed
- Basic RTC operations (read/write time, alarm) verified
Jonathan Bell (1):
rtc: Add Raspberry Pi 5 RTC driver
Sander Speetjens (2):
dt-bindings: rtc: Add Raspberry Pi 5 RTC binding
arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B
.../bindings/rtc/raspberrypi,rtc-rpi.yaml | 48 +++
.../dts/broadcom/bcm2712-rpi-5-b-base.dtsi | 7 +
drivers/rtc/Kconfig | 11 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-rpi.c | 277 ++++++++++++++++++
5 files changed, 344 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml
create mode 100644 drivers/rtc/rtc-rpi.c
--
2.55.0
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding 2026-09-09 14:12 [PATCH 0/3] Raspberry Pi 5 RTC driver Sander Speetjens @ 2026-09-09 14:12 ` Sander Speetjens 2026-09-09 15:47 ` Krzysztof Kozlowski 2026-09-09 14:12 ` [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens 2026-09-09 14:13 ` [PATCH 3/3] arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B Sander Speetjens 2 siblings, 1 reply; 14+ messages in thread From: Sander Speetjens @ 2026-09-09 14:12 UTC (permalink / raw) To: Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel, sander.speetjens Add device tree bindings for the Raspberry Pi 5 RTC. Located in a custom DA9091 PMIC and accesed trough the firmware mailbox. Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> Assisted-by: Grok --- .../bindings/rtc/raspberrypi,rtc-rpi.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml diff --git a/Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml b/Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml new file mode 100644 index 000000000000..e9bade7f8c91 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause + +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/rtc/raspberrypi,rtc-rpi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Raspberry Pi firmware RTC + +maintainers: + - Jonathan Bell <jonathan@raspberrypi.com> + +description: | + Raspberry Pi RTC from the DA9091 accessed through the Raspberry Pi firmware + property interface. + +properties: + compatible: + const: raspberrypi,rpi-rtc + + firmware: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the Raspberry Pi firmware device. + + trickle-charge-microvolt: + description: + RTC backup battery trickle-charge voltage. A value of 0 disables + trickle charging. + anyOf: + - const: 0 + - minimum: 1300000 + maximum: 4400000 + +required: + - compatible + - firmware + +additionalProperties: false + +examples: + - | + rtc { + compatible = "raspberrypi,rpi-rtc"; + firmware = <&firmware>; + status = "okay"; + trickle-charge-microvolt = <0>; + }; -- 2.55.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding 2026-09-09 14:12 ` [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding Sander Speetjens @ 2026-09-09 15:47 ` Krzysztof Kozlowski 2026-09-09 15:54 ` Krzysztof Kozlowski 0 siblings, 1 reply; 14+ messages in thread From: Krzysztof Kozlowski @ 2026-09-09 15:47 UTC (permalink / raw) To: Sander Speetjens, Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel On 09/09/2026 16:12, Sander Speetjens wrote: > Add device tree bindings for the Raspberry Pi 5 RTC. > Located in a custom DA9091 PMIC and accesed trough the firmware mailbox. > > Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> > Assisted-by: Grok Your tag is the last one. > --- > .../bindings/rtc/raspberrypi,rtc-rpi.yaml | 48 +++++++++++++++++++ > 1 file changed, 48 insertions(+) > create mode 100644 Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml > > diff --git a/Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml b/Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml > new file mode 100644 > index 000000000000..e9bade7f8c91 > --- /dev/null > +++ b/Documentation/devicetree/bindings/rtc/raspberrypi,rtc-rpi.yaml > @@ -0,0 +1,48 @@ > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > + There is no blank line here. Please instruct your Grok to follow existing sources, not come with whatever it wants. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/rtc/raspberrypi,rtc-rpi.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Raspberry Pi firmware RTC > + > +maintainers: > + - Jonathan Bell <jonathan@raspberrypi.com> > + > +description: | > + Raspberry Pi RTC from the DA9091 accessed through the Raspberry Pi firmware > + property interface. > + > +properties: > + compatible: > + const: raspberrypi,rpi-rtc > + > + firmware: There is no such generic property. You need vendor prefix. Wasn't this already discussed for Rpi? I feel like every time contributors send downstream DTS ignoring what was discussed upstream. > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + Phandle to the Raspberry Pi firmware device. You said nothing more than property name and type. Explain what for. > + > + trickle-charge-microvolt: > + description: > + RTC backup battery trickle-charge voltage. A value of 0 disables > + trickle charging. > + anyOf: > + - const: 0 > + - minimum: 1300000 > + maximum: 4400000 > + > +required: > + - compatible > + - firmware > + Missing ref to rtc. Honestly, at this point you clearly did not take existing bindings at your starting point. > +additionalProperties: false > + > +examples: > + - | > + rtc { > + compatible = "raspberrypi,rpi-rtc"; > + firmware = <&firmware>; > + status = "okay"; Nope. Again, take existing bindings. This looks like LLM slop. A nit, subject: drop second/last, redundant "bindings". The "dt-bindings" prefix is already stating that these are bindings. See also: https://elixir.bootlin.com/linux/v7.1-rc7/source/Documentation/devicetree/bindings/submitting-patches.rst#L23 > + trickle-charge-microvolt = <0>; > + }; Best regards, Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding 2026-09-09 15:47 ` Krzysztof Kozlowski @ 2026-09-09 15:54 ` Krzysztof Kozlowski 2026-09-09 20:38 ` Sander Speetjens [not found] ` <CAAOJLPHNGgC7B=7ESCifZ1FPcR6V=Hcg-q-aaVg_9M_-d6Fh2A@mail.gmail.com> 0 siblings, 2 replies; 14+ messages in thread From: Krzysztof Kozlowski @ 2026-09-09 15:54 UTC (permalink / raw) To: Sander Speetjens, Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel On 09/09/2026 17:47, Krzysztof Kozlowski wrote: > On 09/09/2026 16:12, Sander Speetjens wrote: >> + >> + firmware: > > There is no such generic property. You need vendor prefix. Wasn't this > already discussed for Rpi? I feel like every time contributors send > downstream DTS ignoring what was discussed upstream. > > >> + $ref: /schemas/types.yaml#/definitions/phandle >> + description: >> + Phandle to the Raspberry Pi firmware device. > > You said nothing more than property name and type. Explain what for. > And more important, where is any interface to actually control the RTC? I see nothing, so your firmware is? Then this is not a separate device and you just added DTS for your driver, which is a no go (see writing bindings). Best regards, Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding 2026-09-09 15:54 ` Krzysztof Kozlowski @ 2026-09-09 20:38 ` Sander Speetjens [not found] ` <CAAOJLPHNGgC7B=7ESCifZ1FPcR6V=Hcg-q-aaVg_9M_-d6Fh2A@mail.gmail.com> 1 sibling, 0 replies; 14+ messages in thread From: Sander Speetjens @ 2026-09-09 20:38 UTC (permalink / raw) To: Krzysztof Kozlowski, Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel > And more important, where is any interface to actually control the RTC? > I see nothing, so your firmware is? Then this is not a separate device > and you just added DTS for your driver, which is a no go (see writing > bindings). The RTC is a physical, battery-backed RTC, but the Raspberry Pi firmware exposes its register interface exclusively through the firmware mailbox. I initially used a firmware phandle so that the RTC driver could obtain the existing rpi_firmware instance. Based on your comment, I think it would be more appropriate to model the RTC as a child device of rpi-firmware. The driver could then obtain the firmware interface from its parent, rather than adding a phandle solely for driver plumbing. This would also mean moving the binding to arm/bcm/raspberrypi,bcm2835-firmware.yaml. Best regards, Sander On 9/9/26 17:54, Krzysztof Kozlowski wrote: > On 09/09/2026 17:47, Krzysztof Kozlowski wrote: >> On 09/09/2026 16:12, Sander Speetjens wrote: >>> + >>> + firmware: >> There is no such generic property. You need vendor prefix. Wasn't this >> already discussed for Rpi? I feel like every time contributors send >> downstream DTS ignoring what was discussed upstream. >> >> >>> + $ref: /schemas/types.yaml#/definitions/phandle >>> + description: >>> + Phandle to the Raspberry Pi firmware device. >> You said nothing more than property name and type. Explain what for. >> > And more important, where is any interface to actually control the RTC? > I see nothing, so your firmware is? Then this is not a separate device > and you just added DTS for your driver, which is a no go (see writing > bindings). > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <CAAOJLPHNGgC7B=7ESCifZ1FPcR6V=Hcg-q-aaVg_9M_-d6Fh2A@mail.gmail.com>]
* Re: [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding [not found] ` <CAAOJLPHNGgC7B=7ESCifZ1FPcR6V=Hcg-q-aaVg_9M_-d6Fh2A@mail.gmail.com> @ 2026-09-10 7:08 ` Krzysztof Kozlowski 2026-09-10 8:10 ` Sander Speetjens 2026-09-10 16:33 ` Stefan Wahren 0 siblings, 2 replies; 14+ messages in thread From: Krzysztof Kozlowski @ 2026-09-10 7:08 UTC (permalink / raw) To: Sander Speetjens Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel On 09/09/2026 22:24, Sander Speetjens wrote: > Thanks for your response > >> And more important, where is any interface to actually control the RTC? >> I see nothing, so your firmware is? Then this is not a separate device >> and you just added DTS for your driver, which is a no go (see writing >> bindings). > > The RTC is a physical, battery-backed RTC, but the Raspberry Pi firmware > exposes its register interface exclusively through the firmware mailbox. > I initially used a firmware phandle so the RTC driver could obtain the > existing rpi_firmware instance. > > Based on your comment, I think it is more appropriate to model > the RTC as a child device of rpi-firmware, > referencing to the existing firmware clock/reset/power services, > and have the driver obtain the firmware interface from its parent > rather than adding a phandle solely for driver plumbing. > Which also means moving this to arm/bcm/raspberrypi,bcm2835-firmware.yaml > Whether device has separate node, depends on it having dedicated resources. I don't see such here, so unlikely it should have a node in the first place (see writing bindings or DTS101 where exactly this question is asked). Best regards, Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding 2026-09-10 7:08 ` Krzysztof Kozlowski @ 2026-09-10 8:10 ` Sander Speetjens 2026-09-10 16:33 ` Stefan Wahren 1 sibling, 0 replies; 14+ messages in thread From: Sander Speetjens @ 2026-09-10 8:10 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel >Whether device has separate node, depends on it having dedicated >resources. I don't see such here, so unlikely it should have a node in >the first place (see writing bindings or DTS101 where exactly this >question is asked). I think you are right there is no extra node needed (only the trickle-voltage-millivolt property) and it could move directly into the rpi_firmware node without creating an extra node. Kind regards Sander On 9/10/26 09:08, Krzysztof Kozlowski wrote: > On 09/09/2026 22:24, Sander Speetjens wrote: >> Thanks for your response >> >>> And more important, where is any interface to actually control the RTC? >>> I see nothing, so your firmware is? Then this is not a separate device >>> and you just added DTS for your driver, which is a no go (see writing >>> bindings). >> The RTC is a physical, battery-backed RTC, but the Raspberry Pi firmware >> exposes its register interface exclusively through the firmware mailbox. >> I initially used a firmware phandle so the RTC driver could obtain the >> existing rpi_firmware instance. >> >> Based on your comment, I think it is more appropriate to model >> the RTC as a child device of rpi-firmware, >> referencing to the existing firmware clock/reset/power services, >> and have the driver obtain the firmware interface from its parent >> rather than adding a phandle solely for driver plumbing. >> Which also means moving this to arm/bcm/raspberrypi,bcm2835-firmware.yaml >> > Whether device has separate node, depends on it having dedicated > resources. I don't see such here, so unlikely it should have a node in > the first place (see writing bindings or DTS101 where exactly this > question is asked). > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding 2026-09-10 7:08 ` Krzysztof Kozlowski 2026-09-10 8:10 ` Sander Speetjens @ 2026-09-10 16:33 ` Stefan Wahren 1 sibling, 0 replies; 14+ messages in thread From: Stefan Wahren @ 2026-09-10 16:33 UTC (permalink / raw) To: Krzysztof Kozlowski, Sander Speetjens Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel Am 10.09.26 um 09:08 schrieb Krzysztof Kozlowski: > On 09/09/2026 22:24, Sander Speetjens wrote: >> Thanks for your response >> >>> And more important, where is any interface to actually control the RTC? >>> I see nothing, so your firmware is? Then this is not a separate device >>> and you just added DTS for your driver, which is a no go (see writing >>> bindings). >> The RTC is a physical, battery-backed RTC, but the Raspberry Pi firmware >> exposes its register interface exclusively through the firmware mailbox. >> I initially used a firmware phandle so the RTC driver could obtain the >> existing rpi_firmware instance. FWIW Based on the official announcement [1], the Renesas DA9091 is a PMIC which has been customized for Raspberry Pi. So currently there is no datasheet available (yet). But it's very likely that the GPU firmware of the BCM2712 communicate via I2C with this PMIC. Also this IC offers additional features like RTC and power button. So this driver only handles the RTC part. Best regards [1] - https://www.raspberrypi.com/news/introducing-raspberry-pi-5/ >> >> Based on your comment, I think it is more appropriate to model >> the RTC as a child device of rpi-firmware, >> referencing to the existing firmware clock/reset/power services, >> and have the driver obtain the firmware interface from its parent >> rather than adding a phandle solely for driver plumbing. >> Which also means moving this to arm/bcm/raspberrypi,bcm2835-firmware.yaml >> > Whether device has separate node, depends on it having dedicated > resources. I don't see such here, so unlikely it should have a node in > the first place (see writing bindings or DTS101 where exactly this > question is asked). > > Best regards, > Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver 2026-09-09 14:12 [PATCH 0/3] Raspberry Pi 5 RTC driver Sander Speetjens 2026-09-09 14:12 ` [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding Sander Speetjens @ 2026-09-09 14:12 ` Sander Speetjens 2026-09-09 15:20 ` Alexandre Belloni 2026-09-09 15:22 ` Alexandre Belloni 2026-09-09 14:13 ` [PATCH 3/3] arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B Sander Speetjens 2 siblings, 2 replies; 14+ messages in thread From: Sander Speetjens @ 2026-09-09 14:12 UTC (permalink / raw) To: Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel, sander.speetjens, Dom Cobley From: Jonathan Bell <jonathan@raspberrypi.com> Upstreaming the downstream Raspberry Pi 5 RTC driver. This driver supports the custom DA9091, which is accessed through the firmware mailbox. Co-developed-by: Dom Cobley <popcornmix@gmail.com> Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> --- drivers/rtc/Kconfig | 11 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-rpi.c | 277 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 289 insertions(+) create mode 100644 drivers/rtc/rtc-rpi.c diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index 05b9233b9418..382973d46e06 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -1999,6 +1999,17 @@ config RTC_DRV_R7301 This driver can also be built as a module. If so, the module will be called rtc-r7301. +config RTC_DRV_RPI + tristate "Raspberry Pi RTC" + depends on ARCH_BRCMSTB || COMPILE_TEST + default ARCH_BRCMSTB + help + If you say yes here you get support for the RTC found on + Raspberry Pi devices. + + This driver can also be built as a module. If so, the module + will be called rtc-rpi. + config RTC_DRV_STM32 tristate "STM32 RTC" select REGMAP_MMIO diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 0347645b021f..78551bb04c5c 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -148,6 +148,7 @@ obj-$(CONFIG_RTC_DRV_RC5T583) += rtc-rc5t583.o obj-$(CONFIG_RTC_DRV_RC5T619) += rtc-rc5t619.o obj-$(CONFIG_RTC_DRV_RK808) += rtc-rk808.o obj-$(CONFIG_RTC_DRV_RP5C01) += rtc-rp5c01.o +obj-$(CONFIG_RTC_DRV_RPI) += rtc-rpi.o obj-$(CONFIG_RTC_DRV_RS5C313) += rtc-rs5c313.o obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o diff --git a/drivers/rtc/rtc-rpi.c b/drivers/rtc/rtc-rpi.c new file mode 100644 index 000000000000..e455b4116957 --- /dev/null +++ b/drivers/rtc/rtc-rpi.c @@ -0,0 +1,277 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/** + * rtc-rpi.c + * + * RTC driver using firmware mailbox + * Supports battery backed RTC and wake alarms + * + * Based on rtc-meson-vrtc by Neil Armstrong + * + * Copyright (c) 2023, Raspberry Pi Ltd. + */ + +#include <linux/module.h> +#include <linux/platform_device.h> +#include <linux/rtc.h> +#include <linux/of.h> +#include <soc/bcm2835/raspberrypi-firmware.h> + +struct rpi_rtc_data { + struct rtc_device *rtc; + struct rpi_firmware *fw; + u32 bbat_vchg_microvolts; +}; + +#define RPI_FIRMWARE_GET_RTC_REG 0x00030087 +#define RPI_FIRMWARE_SET_RTC_REG 0x00038087 + +enum { + RTC_TIME, + RTC_ALARM, + RTC_ALARM_PENDING, + RTC_ALARM_ENABLE, + RTC_BBAT_CHG_VOLTS, + RTC_BBAT_CHG_VOLTS_MIN, + RTC_BBAT_CHG_VOLTS_MAX, + RTC_BBAT_VOLTS +}; + +static int rpi_rtc_read_time(struct device *dev, struct rtc_time *tm) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_TIME}; + int err; + + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, + &data, sizeof(data)); + rtc_time64_to_tm(data[1], tm); + return err; +} + +static int rpi_rtc_set_time(struct device *dev, struct rtc_time *tm) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_TIME, rtc_tm_to_time64(tm)}; + + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, + &data, sizeof(data)); +} + +static int rpi_rtc_alarm_irq_is_enabled(struct device *dev, unsigned char *enabled) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_ALARM_ENABLE}; + s32 err = 0; + + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, + &data, sizeof(data)); + *enabled = data[1] & 0x1; + return err; +} + +static int rpi_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_ALARM_ENABLE, enabled}; + + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, + &data, sizeof(data)); +} + +static int rpi_rtc_alarm_clear_pending(struct device *dev) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_ALARM_PENDING, 1}; + + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, + &data, sizeof(data)); +} + +static int rpi_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_ALARM}; + s32 err = 0; + + err = rpi_rtc_alarm_irq_is_enabled(dev, &alarm->enabled); + if (!err) + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, + &data, sizeof(data)); + rtc_time64_to_tm(data[1], &alarm->time); + + return err; +} + +static int rpi_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_ALARM, rtc_tm_to_time64(&alarm->time)}; + int err; + + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, + &data, sizeof(data)); + + if (err == 0) + err = rpi_rtc_alarm_irq_enable(dev, alarm->enabled); + + return err; +} + +static const struct rtc_class_ops rpi_rtc_ops = { + .read_time = rpi_rtc_read_time, + .set_time = rpi_rtc_set_time, + .read_alarm = rpi_rtc_read_alarm, + .set_alarm = rpi_rtc_set_alarm, + .alarm_irq_enable = rpi_rtc_alarm_irq_enable, +}; + +static int rpi_rtc_set_charge_voltage(struct device *dev) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); + u32 data[2] = {RTC_BBAT_CHG_VOLTS, vrtc->bbat_vchg_microvolts}; + int err; + + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, + &data, sizeof(data)); + + if (err) + dev_err(dev, "failed to set trickle charge voltage to %uuV: %d\n", + vrtc->bbat_vchg_microvolts, err); + else if (vrtc->bbat_vchg_microvolts) + dev_info(dev, "trickle charging enabled at %uuV\n", + vrtc->bbat_vchg_microvolts); + + return err; +} + +static ssize_t rpi_rtc_print_uint_reg(struct device *dev, char *buf, u32 reg) +{ + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev->parent); + u32 data[2] = {reg, 0}; + int ret = 0; + + ret = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, + &data, sizeof(data)); + if (ret < 0) + return ret; + + return sprintf(buf, "%u\n", data[1]); +} + +static ssize_t charging_voltage_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_CHG_VOLTS); +} +static DEVICE_ATTR_RO(charging_voltage); + +static ssize_t charging_voltage_min_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_CHG_VOLTS_MIN); +} +static DEVICE_ATTR_RO(charging_voltage_min); + +static ssize_t charging_voltage_max_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_CHG_VOLTS_MAX); +} +static DEVICE_ATTR_RO(charging_voltage_max); + +static ssize_t battery_voltage_show(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_VOLTS); +} +static DEVICE_ATTR_RO(battery_voltage); + +static struct attribute *rpi_rtc_attrs[] = { + &dev_attr_charging_voltage.attr, + &dev_attr_charging_voltage_min.attr, + &dev_attr_charging_voltage_max.attr, + &dev_attr_battery_voltage.attr, + NULL +}; + +static const struct attribute_group rpi_rtc_sysfs_files = { + .attrs = rpi_rtc_attrs, +}; + +static int rpi_rtc_probe(struct platform_device *pdev) +{ + struct rpi_rtc_data *vrtc; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; + struct device_node *fw_node; + struct rpi_firmware *fw; + int ret; + + fw_node = of_parse_phandle(np, "firmware", 0); + if (!fw_node) { + dev_err(dev, "Missing firmware node\n"); + return -ENOENT; + } + + fw = rpi_firmware_get(fw_node); + if (!fw) + return -EPROBE_DEFER; + + vrtc = devm_kzalloc(&pdev->dev, sizeof(*vrtc), GFP_KERNEL); + if (!vrtc) + return -ENOMEM; + + vrtc->fw = fw; + + device_init_wakeup(&pdev->dev, 1); + + platform_set_drvdata(pdev, vrtc); + + vrtc->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(vrtc->rtc)) + return PTR_ERR(vrtc->rtc); + + set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, vrtc->rtc->features); + clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, vrtc->rtc->features); + + vrtc->rtc->ops = &rpi_rtc_ops; + ret = rtc_add_group(vrtc->rtc, &rpi_rtc_sysfs_files); + if (ret) + return ret; + + rpi_rtc_alarm_clear_pending(dev); + + /* + * Optionally enable trickle charging - if the property isn't + * present (or set to zero), trickle charging is disabled. + */ + of_property_read_u32(np, "trickle-charge-microvolt", + &vrtc->bbat_vchg_microvolts); + + rpi_rtc_set_charge_voltage(dev); + + return devm_rtc_register_device(vrtc->rtc); +} + +static const struct of_device_id rpi_rtc_dt_match[] = { + { .compatible = "raspberrypi,rpi-rtc"}, + {}, +}; +MODULE_DEVICE_TABLE(of, rpi_rtc_dt_match); + +static struct platform_driver rpi_rtc_driver = { + .probe = rpi_rtc_probe, + .driver = { + .name = "rpi-rtc", + .of_match_table = rpi_rtc_dt_match, + }, +}; + +module_platform_driver(rpi_rtc_driver); + +MODULE_DESCRIPTION("Raspberry Pi RTC driver"); +MODULE_LICENSE("GPL"); \ No newline at end of file -- 2.55.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver 2026-09-09 14:12 ` [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens @ 2026-09-09 15:20 ` Alexandre Belloni 2026-09-09 15:22 ` Alexandre Belloni 1 sibling, 0 replies; 14+ messages in thread From: Alexandre Belloni @ 2026-09-09 15:20 UTC (permalink / raw) To: Sander Speetjens Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel, Dom Cobley On 09/09/2026 16:12:59+0200, Sander Speetjens wrote: > From: Jonathan Bell <jonathan@raspberrypi.com> > > Upstreaming the downstream Raspberry Pi 5 RTC driver. > This driver supports the custom DA9091, which is accessed through the firmware mailbox. > > Co-developed-by: Dom Cobley <popcornmix@gmail.com> > Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> > --- > drivers/rtc/Kconfig | 11 ++ > drivers/rtc/Makefile | 1 + > drivers/rtc/rtc-rpi.c | 277 ++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 289 insertions(+) > create mode 100644 drivers/rtc/rtc-rpi.c > > diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig > index 05b9233b9418..382973d46e06 100644 > --- a/drivers/rtc/Kconfig > +++ b/drivers/rtc/Kconfig > @@ -1999,6 +1999,17 @@ config RTC_DRV_R7301 > This driver can also be built as a module. If so, the module > will be called rtc-r7301. > > +config RTC_DRV_RPI > + tristate "Raspberry Pi RTC" > + depends on ARCH_BRCMSTB || COMPILE_TEST > + default ARCH_BRCMSTB > + help > + If you say yes here you get support for the RTC found on > + Raspberry Pi devices. > + > + This driver can also be built as a module. If so, the module > + will be called rtc-rpi. > + > config RTC_DRV_STM32 > tristate "STM32 RTC" > select REGMAP_MMIO > diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile > index 0347645b021f..78551bb04c5c 100644 > --- a/drivers/rtc/Makefile > +++ b/drivers/rtc/Makefile > @@ -148,6 +148,7 @@ obj-$(CONFIG_RTC_DRV_RC5T583) += rtc-rc5t583.o > obj-$(CONFIG_RTC_DRV_RC5T619) += rtc-rc5t619.o > obj-$(CONFIG_RTC_DRV_RK808) += rtc-rk808.o > obj-$(CONFIG_RTC_DRV_RP5C01) += rtc-rp5c01.o > +obj-$(CONFIG_RTC_DRV_RPI) += rtc-rpi.o > obj-$(CONFIG_RTC_DRV_RS5C313) += rtc-rs5c313.o > obj-$(CONFIG_RTC_DRV_RS5C348) += rtc-rs5c348.o > obj-$(CONFIG_RTC_DRV_RS5C372) += rtc-rs5c372.o > diff --git a/drivers/rtc/rtc-rpi.c b/drivers/rtc/rtc-rpi.c > new file mode 100644 > index 000000000000..e455b4116957 > --- /dev/null > +++ b/drivers/rtc/rtc-rpi.c > @@ -0,0 +1,277 @@ > +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause > +/** > + * rtc-rpi.c > + * > + * RTC driver using firmware mailbox > + * Supports battery backed RTC and wake alarms > + * > + * Based on rtc-meson-vrtc by Neil Armstrong > + * > + * Copyright (c) 2023, Raspberry Pi Ltd. > + */ > + > +#include <linux/module.h> > +#include <linux/platform_device.h> > +#include <linux/rtc.h> > +#include <linux/of.h> > +#include <soc/bcm2835/raspberrypi-firmware.h> > + > +struct rpi_rtc_data { > + struct rtc_device *rtc; > + struct rpi_firmware *fw; > + u32 bbat_vchg_microvolts; > +}; > + > +#define RPI_FIRMWARE_GET_RTC_REG 0x00030087 > +#define RPI_FIRMWARE_SET_RTC_REG 0x00038087 > + > +enum { > + RTC_TIME, > + RTC_ALARM, > + RTC_ALARM_PENDING, > + RTC_ALARM_ENABLE, > + RTC_BBAT_CHG_VOLTS, > + RTC_BBAT_CHG_VOLTS_MIN, > + RTC_BBAT_CHG_VOLTS_MAX, > + RTC_BBAT_VOLTS > +}; > + > +static int rpi_rtc_read_time(struct device *dev, struct rtc_time *tm) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_TIME}; > + int err; > + > + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, > + &data, sizeof(data)); > + rtc_time64_to_tm(data[1], tm); > + return err; > +} > + > +static int rpi_rtc_set_time(struct device *dev, struct rtc_time *tm) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_TIME, rtc_tm_to_time64(tm)}; > + > + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, > + &data, sizeof(data)); > +} > + > +static int rpi_rtc_alarm_irq_is_enabled(struct device *dev, unsigned char *enabled) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_ALARM_ENABLE}; > + s32 err = 0; > + > + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, > + &data, sizeof(data)); > + *enabled = data[1] & 0x1; > + return err; > +} > + > +static int rpi_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_ALARM_ENABLE, enabled}; > + > + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, > + &data, sizeof(data)); > +} > + > +static int rpi_rtc_alarm_clear_pending(struct device *dev) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_ALARM_PENDING, 1}; > + > + return rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, > + &data, sizeof(data)); > +} > + > +static int rpi_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_ALARM}; > + s32 err = 0; > + > + err = rpi_rtc_alarm_irq_is_enabled(dev, &alarm->enabled); > + if (!err) > + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, > + &data, sizeof(data)); > + rtc_time64_to_tm(data[1], &alarm->time); > + > + return err; > +} > + > +static int rpi_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_ALARM, rtc_tm_to_time64(&alarm->time)}; > + int err; > + > + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, > + &data, sizeof(data)); > + > + if (err == 0) > + err = rpi_rtc_alarm_irq_enable(dev, alarm->enabled); > + > + return err; > +} > + > +static const struct rtc_class_ops rpi_rtc_ops = { > + .read_time = rpi_rtc_read_time, > + .set_time = rpi_rtc_set_time, > + .read_alarm = rpi_rtc_read_alarm, > + .set_alarm = rpi_rtc_set_alarm, > + .alarm_irq_enable = rpi_rtc_alarm_irq_enable, > +}; > + > +static int rpi_rtc_set_charge_voltage(struct device *dev) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev); > + u32 data[2] = {RTC_BBAT_CHG_VOLTS, vrtc->bbat_vchg_microvolts}; > + int err; > + > + err = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_SET_RTC_REG, > + &data, sizeof(data)); > + > + if (err) > + dev_err(dev, "failed to set trickle charge voltage to %uuV: %d\n", > + vrtc->bbat_vchg_microvolts, err); > + else if (vrtc->bbat_vchg_microvolts) > + dev_info(dev, "trickle charging enabled at %uuV\n", > + vrtc->bbat_vchg_microvolts); > + > + return err; > +} > + > +static ssize_t rpi_rtc_print_uint_reg(struct device *dev, char *buf, u32 reg) > +{ > + struct rpi_rtc_data *vrtc = dev_get_drvdata(dev->parent); > + u32 data[2] = {reg, 0}; > + int ret = 0; > + > + ret = rpi_firmware_property(vrtc->fw, RPI_FIRMWARE_GET_RTC_REG, > + &data, sizeof(data)); > + if (ret < 0) > + return ret; > + > + return sprintf(buf, "%u\n", data[1]); > +} > + > +static ssize_t charging_voltage_show(struct device *dev, > + struct device_attribute *attr, > + char *buf) > +{ > + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_CHG_VOLTS); > +} > +static DEVICE_ATTR_RO(charging_voltage); > + > +static ssize_t charging_voltage_min_show(struct device *dev, > + struct device_attribute *attr, > + char *buf) > +{ > + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_CHG_VOLTS_MIN); > +} > +static DEVICE_ATTR_RO(charging_voltage_min); > + > +static ssize_t charging_voltage_max_show(struct device *dev, > + struct device_attribute *attr, > + char *buf) > +{ > + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_CHG_VOLTS_MAX); > +} > +static DEVICE_ATTR_RO(charging_voltage_max); > + > +static ssize_t battery_voltage_show(struct device *dev, > + struct device_attribute *attr, > + char *buf) > +{ > + return rpi_rtc_print_uint_reg(dev, buf, RTC_BBAT_VOLTS); > +} > +static DEVICE_ATTR_RO(battery_voltage); > + > +static struct attribute *rpi_rtc_attrs[] = { > + &dev_attr_charging_voltage.attr, > + &dev_attr_charging_voltage_min.attr, > + &dev_attr_charging_voltage_max.attr, > + &dev_attr_battery_voltage.attr, > + NULL > +}; > + > +static const struct attribute_group rpi_rtc_sysfs_files = { > + .attrs = rpi_rtc_attrs, > +}; This undocumented sysfs interface has to be removed. > + > +static int rpi_rtc_probe(struct platform_device *pdev) > +{ > + struct rpi_rtc_data *vrtc; > + struct device *dev = &pdev->dev; > + struct device_node *np = dev->of_node; > + struct device_node *fw_node; > + struct rpi_firmware *fw; > + int ret; > + > + fw_node = of_parse_phandle(np, "firmware", 0); > + if (!fw_node) { > + dev_err(dev, "Missing firmware node\n"); > + return -ENOENT; > + } > + > + fw = rpi_firmware_get(fw_node); > + if (!fw) > + return -EPROBE_DEFER; > + > + vrtc = devm_kzalloc(&pdev->dev, sizeof(*vrtc), GFP_KERNEL); > + if (!vrtc) > + return -ENOMEM; > + > + vrtc->fw = fw; > + > + device_init_wakeup(&pdev->dev, 1); > + > + platform_set_drvdata(pdev, vrtc); > + > + vrtc->rtc = devm_rtc_allocate_device(&pdev->dev); > + if (IS_ERR(vrtc->rtc)) > + return PTR_ERR(vrtc->rtc); > + > + set_bit(RTC_FEATURE_ALARM_WAKEUP_ONLY, vrtc->rtc->features); > + clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, vrtc->rtc->features); > + > + vrtc->rtc->ops = &rpi_rtc_ops; > + ret = rtc_add_group(vrtc->rtc, &rpi_rtc_sysfs_files); > + if (ret) > + return ret; > + > + rpi_rtc_alarm_clear_pending(dev); > + > + /* > + * Optionally enable trickle charging - if the property isn't > + * present (or set to zero), trickle charging is disabled. > + */ > + of_property_read_u32(np, "trickle-charge-microvolt", > + &vrtc->bbat_vchg_microvolts); > + > + rpi_rtc_set_charge_voltage(dev); > + > + return devm_rtc_register_device(vrtc->rtc); > +} > + > +static const struct of_device_id rpi_rtc_dt_match[] = { > + { .compatible = "raspberrypi,rpi-rtc"}, > + {}, > +}; > +MODULE_DEVICE_TABLE(of, rpi_rtc_dt_match); > + > +static struct platform_driver rpi_rtc_driver = { > + .probe = rpi_rtc_probe, > + .driver = { > + .name = "rpi-rtc", > + .of_match_table = rpi_rtc_dt_match, > + }, > +}; > + > +module_platform_driver(rpi_rtc_driver); > + > +MODULE_DESCRIPTION("Raspberry Pi RTC driver"); > +MODULE_LICENSE("GPL"); > \ No newline at end of file > -- > 2.55.0 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver 2026-09-09 14:12 ` [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens 2026-09-09 15:20 ` Alexandre Belloni @ 2026-09-09 15:22 ` Alexandre Belloni 2026-09-09 15:44 ` Krzysztof Kozlowski 1 sibling, 1 reply; 14+ messages in thread From: Alexandre Belloni @ 2026-09-09 15:22 UTC (permalink / raw) To: Sander Speetjens Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel, Dom Cobley On 09/09/2026 16:12:59+0200, Sander Speetjens wrote: > From: Jonathan Bell <jonathan@raspberrypi.com> > > Upstreaming the downstream Raspberry Pi 5 RTC driver. > This driver supports the custom DA9091, which is accessed through the firmware mailbox. > > Co-developed-by: Dom Cobley <popcornmix@gmail.com> > Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> This is missing the SoB from Jonathan Bell -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver 2026-09-09 15:22 ` Alexandre Belloni @ 2026-09-09 15:44 ` Krzysztof Kozlowski 0 siblings, 0 replies; 14+ messages in thread From: Krzysztof Kozlowski @ 2026-09-09 15:44 UTC (permalink / raw) To: Alexandre Belloni, Sander Speetjens Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel, Dom Cobley On 09/09/2026 17:22, Alexandre Belloni wrote: > On 09/09/2026 16:12:59+0200, Sander Speetjens wrote: >> From: Jonathan Bell <jonathan@raspberrypi.com> >> >> Upstreaming the downstream Raspberry Pi 5 RTC driver. >> This driver supports the custom DA9091, which is accessed through the firmware mailbox. >> >> Co-developed-by: Dom Cobley <popcornmix@gmail.com> >> Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> > > This is missing the SoB from Jonathan Bell It's missing two SoB. Also from Dom. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B 2026-09-09 14:12 [PATCH 0/3] Raspberry Pi 5 RTC driver Sander Speetjens 2026-09-09 14:12 ` [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding Sander Speetjens 2026-09-09 14:12 ` [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens @ 2026-09-09 14:13 ` Sander Speetjens 2026-09-09 15:47 ` Krzysztof Kozlowski 2 siblings, 1 reply; 14+ messages in thread From: Sander Speetjens @ 2026-09-09 14:13 UTC (permalink / raw) To: Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel, sander.speetjens The Raspberry Pi 5 contains a RTC on a custom DA9091 PMIC that is accesed trought the firware mailbox. This so we have a battery backed RTC, so the OS does not need network to get the time. Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> --- arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi index b7a6bc34ae1a..5a82dd585f32 100644 --- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi +++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi @@ -102,6 +102,13 @@ wl_on_reg: wl-on-reg { startup-delay-us = <150000>; enable-active-high; }; + + rpi_rtc: rpi-rtc { + compatible = "raspberrypi,rpi-rtc"; + firmware = <&firmware>; + status = "okay"; + trickle-charge-microvolt = <0>; + }; }; &pinctrl { -- 2.55.0 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 3/3] arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B 2026-09-09 14:13 ` [PATCH 3/3] arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B Sander Speetjens @ 2026-09-09 15:47 ` Krzysztof Kozlowski 0 siblings, 0 replies; 14+ messages in thread From: Krzysztof Kozlowski @ 2026-09-09 15:47 UTC (permalink / raw) To: Sander Speetjens, Alexandre Belloni Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Florian Fainelli, Jonathan Bell, Stefan Wahren, linux-rtc, devicetree, linux-rpi-kernel, linux-arm-kernel On 09/09/2026 16:13, Sander Speetjens wrote: > The Raspberry Pi 5 contains a RTC on a custom DA9091 PMIC that is accesed trought the firware mailbox. > This so we have a battery backed RTC, so the OS does not need network to get the time. > > Signed-off-by: Sander Speetjens <sander.speetjens@gmail.com> > --- > arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi > index b7a6bc34ae1a..5a82dd585f32 100644 > --- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi > +++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi > @@ -102,6 +102,13 @@ wl_on_reg: wl-on-reg { > startup-delay-us = <150000>; > enable-active-high; > }; > + > + rpi_rtc: rpi-rtc { Node names should be generic. See also an explanation and list of examples (not exhaustive) in DT specification: https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#generic-names-recommendation If you cannot find a name matching your device, please check in kernel sources for similar cases or you can grow the spec (via pull request to DT spec repo). > + compatible = "raspberrypi,rpi-rtc"; > + firmware = <&firmware>; > + status = "okay"; Why? Best regards, Krzysztof ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-09-10 16:33 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 14:12 [PATCH 0/3] Raspberry Pi 5 RTC driver Sander Speetjens
2026-09-09 14:12 ` [PATCH 1/3] dt-bindings: rtc: Add Raspberry Pi 5 RTC binding Sander Speetjens
2026-09-09 15:47 ` Krzysztof Kozlowski
2026-09-09 15:54 ` Krzysztof Kozlowski
2026-09-09 20:38 ` Sander Speetjens
[not found] ` <CAAOJLPHNGgC7B=7ESCifZ1FPcR6V=Hcg-q-aaVg_9M_-d6Fh2A@mail.gmail.com>
2026-09-10 7:08 ` Krzysztof Kozlowski
2026-09-10 8:10 ` Sander Speetjens
2026-09-10 16:33 ` Stefan Wahren
2026-09-09 14:12 ` [PATCH 2/3] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens
2026-09-09 15:20 ` Alexandre Belloni
2026-09-09 15:22 ` Alexandre Belloni
2026-09-09 15:44 ` Krzysztof Kozlowski
2026-09-09 14:13 ` [PATCH 3/3] arm64: dts: broadcom: Add RTC to Raspberry Pi 5 B Sander Speetjens
2026-09-09 15:47 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox