Re: [PATCH v2 2/3] rtc: Add Cortina Systems CS7542 RTC driver
From: Fil Dunsky
Date: Mon Nov 23 2026 - 17:51:45 EST
You are right: I used the core's calendar-validation boundary for the
minimum, but range_min should describe the physical hardware calendar
and its offset handling.
I checked the lower range on Almond+ with a separate Linux 7.4-rc4 RAM
fixture calling the driver's set_time/read_time callbacks under ops_lock.
The normal RTC core rejects pre-1970 dates, so the bypass was confined to
that test module. These six cases passed:
- 0000-01-01, 00:00:00 to 00:00:01, with raw BCDYEAR=0
- 0000-02-28 to February 29
- 0099-12-31 to 0100-01-01
- 0100-02-28 to March 1
- 0400-02-28 to February 29
- 1969-12-31 to 1970-01-01
The direct callbacks succeeded for the low years while the unchanged
core validator returned EINVAL; the 1970 transition became core-valid.
The module recorded 219 checks with no failures and restored current UTC.
The RAM supervisor independently restored UTC before watchdog return,
and fresh host UTC was verified again in installed OpenWrt. No firmware
was flashed.
V4 uses RTC_TIMESTAMP_BEGIN_0000 through RTC_TIMESTAMP_END_9999. Its
Kconfig help explicitly describes the hardware's four-digit calendar;
ordinary core calendar validation is unchanged. The source tests cover
all 10000 BCD-year round trips, and the ARM built-in/module builds passed.
The hardware evidence consists of the boundary cases above plus the
previous upper-century/9999 tests, not a hardware sweep of every year.
V4 is posted here:
https://lore.kernel.org/all/20261124-b4-cs7542-rtc-v4-0-bceefd844074@xxxxxxxxx/
Thanks,
Fil