Repository navigation
Conversation
|
Reworked: the first push carried unrelated S2MPG15 hunks from my working tree (that's where the W=1 failures in sec-acpm.c and sec-common.c and the undocumented-compatible warning came from). The branch is now the RTC change only, 58 lines across the four files, rebased on b495db6. Both touched drivers and rtc-s5m build with W=1 against defconfig + omamobile.config, checkpatch --strict is clean, and the phone test stands. |
f48b09b to
456170e
Compare
|
Thanks for this, and for cleaning the branch up so quickly. The RTC change Two things before I merge:
A small one while you're in there: commit 1's message quotes By the way, the range check you dropped is a good idea in its own right. Thanks again. This is a tidy, well-sourced change. |
The S2MPG14's RTC block sits at ACPM access type 0x02 and has the same register layout as the S2MPG10's (CTRL at 0x00 through OSC_CTRL at 0x1b, two nonces to 0x2b, five scratch registers to 0x30), per Google's GPL rtc-s2mpg14.h. Describe it as an uncached "rtc" regmap over the ACPM bus, let the PMIC regmap read STATUS2 (the alarm flag, bit 2 as on S2MPG12), and add the s2mpg14-rtc cell. No interrupt line is described yet, so the cell carries no alarm resource. The regmap reads up to OSC_CTRL and writes only what rtc-s5m writes: CTRL, UPDATE, the time and alarm 0. SMPL, WTSR, CAP_SEL and OSC_CTRL (the power-loss and watchdog-reset protections and the oscillator tuning) and the nonces stay read-only. Link: https://android.googlesource.com/kernel/google-modules/soc/gs/+/refs/heads/android-gs-tegu-6.1-android16/include/linux/mfd/samsung/rtc-s2mpg14.h Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The S2MPG14 (Pixel 9a main PMIC) keeps its RTC in the S2MPG10 layout, reached through the "rtc" regmap the sec-acpm driver now provides, so it takes the S2MPG10 register table. Its alarm flag is STATUS2 bit 2 in the PMIC regmap, as on the S2MPG12. Without a PMIC interrupt line the device comes up with the alarm feature cleared, as a time-only clock. On the Pixel 9a the RTC registers as rtc0 and the system clock is set from it at boot: s5m-rtc s2mpg14-rtc: registered as rtc0 s5m-rtc s2mpg14-rtc: setting system clock to 2026-10-26T13:28:26 UTC Tested on the Pixel 9a: rtc0 registers at boot, hwclock reads and sets the time, systemd-timesyncd writes the synchronized time back, and the time survives reboots and a power-key reset. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
456170e to
6a99933
Compare
|
Done, rebased onto omamobile (9afbb1a):
checkpatch --strict is clean on both, and sec-acpm.o, sec-common.o and rtc-s5m.o build with W=1. The boot of this head on the 9a is still to come. The palmtop is waiting for a power-key restart after an overnight test. When it's back I'll post |
|
Booted on the palmtop (Pixel 9a). This is our integration kernel with exactly the RTC and interrupt code of this PR's head and #55's (the review diff applied on top), built as phone-smoke passes every required check. Its one non-required line is a failed |
|
Thanks, that's both points done. The split tables are exactly what I asked for: reads up to OSC_CTRL, writes only CTRL, UPDATE, the time and alarm 0, which I checked against what rtc-s5m actually writes ( So the only thing left is the boot of this head on the 9a, whenever the palmtop is back: |
The Pixel 9a's main PMIC, the S2MPG14, keeps its RTC in the S2MPG10 register layout behind ACPM access type 0x02. Two commits:
mfd: sec: s2mpg14: Add the RTC regmap and cell: an uncached "rtc" regmap over the ACPM bus (0x00-0x2b), STATUS2 readable in the PMIC regmap for the alarm flag, and thes2mpg14-rtccell. No interrupt line is described yet, so no alarm resource.rtc: s5m: Add S2MPG14: takes the S2MPG10 register table, STATUS2 bit 2 for the pending alarm as on the S2MPG12, and comes up time-only until the PMIC interrupt lands.Tested on the Pixel 9a on top of today's
omamobile:rtc0registers at boot and sets the system clock (s5m-rtc s2mpg14-rtc: registered as rtc0,setting system clock to 2026-10-26T13:28:26 UTC),hwclockreads and sets it, systemd-timesyncd writes the synchronized time back, and the time holds across reboots and a power-key reset.tools/kernel-pr-check b495db69c: sign-offs, prefixes and policy pass; checkpatch --strict reports no errors and one pre-existing warning (the undocumentedsamsung,s2mpg15-pmicstring in the context ofsec-acpm.c, not introduced here).Source for the register layout: Google's GPL
rtc-s2mpg14.h(linked in the first commit).