From: Sander Speetjens <sander.speetjens@gmail.com>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Jonathan Bell <jonathan@raspberrypi.com>,
linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, pbrobinson@gmail.com,
Dom Cobley <popcornmix@gmail.com>
Subject: Re: [PATCH v8 2/2] rtc: Add Raspberry Pi 5 RTC driver
Date: Wed, 30 Sep 2026 19:29:07 +0200 [thread overview]
Message-ID: <2872a37d-4f24-4429-aba5-34f020740821@gmail.com> (raw)
In-Reply-To: <7441de5b-e9a6-4080-b312-d6c7123fdcde@gmx.net>
Hi Stefan,
>> + // Check if our model is a Raspberry Pi 5, as the RTC is only
>> present on that model.
>> + if (!of_machine_is_compatible("brcm,bcm2712"))
>> + return;
> I don't like the comment, because it doesn't check for Raspberry Pi 5,
> the code checks for a BCM2712 SoC which could also be on a CM5 or a
> Raspberry Pi 500+
I changed it to BCM2712, but isn't RPi 5 the generation/platform name
and RPi 5b the specific board?
>> +#define RPI_FIRMWARE_GET_RTC_REG 0x00030087
>> +#define RPI_FIRMWARE_SET_RTC_REG 0x00038087
> Was there a specific reason to not include these defines to
> include/soc/bcm2835/raspberry-pi-firmware.h as all the others firmware
> tags?
No specific reason, this is how Raspberry Pi originally did it, I moved
them to raspberrypi-firmware.h
>> +
>> +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
>> +};
> Hm, an enum suggests that we simply can add / remove items, but that's
> not the case. The Raspberry Pi firmware defines the values.
Should I also move those to raspberrypi-firmware.h or is this not what
you imply?
> In case rpi_rtc_set_limits() fails, both limit would be initialized
> with 0 and this always fail. Maybe we should dev_warn to
> rpi_rtc_set_limits()?
I added a warning for failing to set the min and max values.
> Just to be sure, both calls are optional and not critical for the
> drivers function?
> Why does rpi_rtc_set_charge_voltage have a return value at all?
I removed the return value
>> +MODULE_ALIAS("platform:raspberrypi-rtc");
> Is this really necessary for module autoloading?
I'm not sure, it was used in the previous versions when using the
platform device register on the register_clk driver before it had a
custom dt node.
Kind regards,
Sander Speetjens
next prev parent reply other threads:[~2026-09-30 17:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 9:52 [PATCH v8 0/2] Raspberry Pi 5 RTC driver Sander Speetjens
2026-09-30 9:52 ` [PATCH v8 1/2] dt-bindings: rtc: Add property for Raspberry Pi 5 RTC Sander Speetjens
2026-09-30 9:52 ` [PATCH v8 2/2] rtc: Add Raspberry Pi 5 RTC driver Sander Speetjens
2026-09-30 16:50 ` Stefan Wahren
2026-09-30 17:29 ` Sander Speetjens [this message]
2026-09-30 18:44 ` Stefan Wahren
2026-09-30 19:07 ` Sander Speetjens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2872a37d-4f24-4429-aba5-34f020740821@gmail.com \
--to=sander.speetjens@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=jonathan@raspberrypi.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-rtc@vger.kernel.org \
--cc=pbrobinson@gmail.com \
--cc=popcornmix@gmail.com \
--cc=robh@kernel.org \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox