sun60iw2: fix RTC on Orange Pi Zero 3W (use SoC RTC, drop phantom hym8563) - #10576
Conversation
…8563) The Zero 3W device tree disables the SoC's working on-die RTC and enables an external hym8563 (on s_twi2) that is not populated on the board, so every boot starts in 1970 with a probe error and a wrong clock until NTP syncs (breaking apt on fresh boots, among other things). - 0009: enable the SoC RTC (allwinner,rtc-v201, driver already =y), disable the phantom hym8563 node. - kernel config: point RTC_HCTOSYS_DEVICE and RTC_SYSTOHC_DEVICE at rtc0 - with the phantom gone the SoC RTC registers as rtc0, so the kernel both restores the system clock from it at boot and keeps it updated via the periodic NTP sync. Verified on hardware: /dev/rtc0 registers, time survives reboots, probe error gone.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe Orange Pi Zero 3W device tree now enables the SoC RTC and disables the phantom external RTC. Kernel RTC settings now use ChangesRTC source selection
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change enables the SoC RTC, disables the unpopulated external RTC, and directs system time synchronization to rtc0. No actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
the Orange Pi 4 Pro DTS has the identical pattern ( |
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
Every Zero 3W boot currently starts in 1970 with
rtc-hym8563 15-0051: could not init device, -22. Root cause: the board DTS enables an external hym8563 RTC that is notpopulated on this board (schematic has no external RTC — only the SoC VCC-RTC domain),
while the SoC's own RTC (rtc-v201 @0x7090000, driver already built in) is explicitly
disabled with a
/*Disable soc rtc*/comment — likely inherited from a reference design.Consequences of the wrong clock until NTP syncs: apt refuses repos ("Release file not
valid yet"), wrong early-boot timestamps, and no timekeeping at all for offline use.
Fix
system clock from the RTC at boot and writes NTP-corrected time back to it every ~11 min.
(With the phantom gone the SoC RTC registers as rtc0; rtc0 is also the kernel default and
remains correct for family boards where a real external RTC registers first. Note this
config is family-wide for sun60iw2 — reasoned through the 4 Pro / Cubie A7Z cases.)
Testing (Orange Pi Zero 3W hardware)
Follow-up candidate (not this PR): the same phantom node pattern may exist on other
sun60iw2 family DTs.
Summary by CodeRabbit