From: Owen O'Hehir <oo.hehir@gmail.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Emil Renner Berthing <kernel@esmil.dk>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Philipp Zabel <p.zabel@pengutronix.de>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-riscv@lists.infradead.org,
Hal Feng <hal.feng@starfivetech.com>,
"ziv.xu" <ziv.xu@starfivetech.com>,
Conor Dooley <conor@kernel.org>
Subject: [PATCH 0/3] rtc: Add StarFive JH7110 RTC support
Date: Fri, 6 Nov 2026 17:55:57 +0000 [thread overview]
Message-ID: <20261106175600.3877614-1-oo.hehir@gmail.com> (raw)
The JH7110 has an RTC in its always-on domain that mainline does not
support. This series adds a binding, a driver and the SoC DT node.
The driver is based on the StarFive vendor driver (rtc-starfive.c,
commit ebac2b5 in the StarFive 6.12 tree), reworked for mainline:
- hardware calibration and the default time set in probe are dropped
- wakeup uses the generic wake IRQ helpers instead of the irq_desc hack
- set_time waits for the counter to load the new time
- read_time re-reads if the time rolls over between TIME and DATE
- the offset rounds to the nearest step and follows the sysfs sign
convention (positive = slower)
- the 32.768 kHz counter clock is described in the binding and enabled
Thanks to ziv.xu and Hal Feng at StarFive for the original driver.
Tested on a VisionFive 2 v1.3B with next-20261105 and v7.3.1: setting
and reading the time across the 2000-2099 range (out-of-range years
refused), leap day and century rollover, the alarm interrupt with
cancel, the offset, the rate over 60 s, and setting the system clock at
boot. Not tested: suspend wakeup, drift over hours, and keeping time
across a power-off, as the board has no RTC battery connector.
Known behaviour: the RTC loses about the length of a reboot across a
warm reboot; the counter appears to stop during reset. After the
StarFive vendor kernel the first boot found an invalid time. I would
appreciate an opinion on whether this is expected of the hardware or
something the driver should handle.
The binding lists the RTC maintainer, as no one at StarFive has taken
it on; I'm happy to change it if someone from StarFive wants to.
Owen O'Hehir (2):
dt-bindings: rtc: Add StarFive JH7110 RTC
riscv: dts: starfive: jh7110: Add the RTC node
ziv.xu (1):
rtc: Add StarFive JH7110 RTC driver
.../bindings/rtc/starfive,jh7110-rtc.yaml | 85 +++++
arch/riscv/boot/dts/starfive/jh7110.dtsi | 14 +
drivers/rtc/Kconfig | 11 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-jh7110.c | 324 ++++++++++++++++++
5 files changed, 435 insertions(+)
create mode 100644 Documentation/devicetree/bindings/rtc/starfive,jh7110-rtc.yaml
create mode 100644 drivers/rtc/rtc-jh7110.c
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
--
2.43.0
next reply other threads:[~2026-11-06 17:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 17:55 Owen O'Hehir [this message]
2026-11-06 17:55 ` [PATCH 1/3] dt-bindings: rtc: Add StarFive JH7110 RTC Owen O'Hehir
2026-11-06 18:16 ` Conor Dooley
2026-11-06 17:55 ` [PATCH 2/3] rtc: Add StarFive JH7110 RTC driver Owen O'Hehir
2026-11-06 17:56 ` [PATCH 3/3] riscv: dts: starfive: jh7110: Add the RTC node Owen O'Hehir
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=20261106175600.3877614-1-oo.hehir@gmail.com \
--to=oo.hehir@gmail.com \
--cc=alex@ghiti.fr \
--cc=alexandre.belloni@bootlin.com \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hal.feng@starfivetech.com \
--cc=kernel@esmil.dk \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-rtc@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=ziv.xu@starfivetech.com \
/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
all inboxes | Powered by JetHome®