Skip to content

SM8750: persist RTC offset in SDAM#3033

Open
andrebraga wants to merge 1 commit into
ROCKNIX:nextfrom
andrebraga:pr/sm8750-rtc-persist-offset
Open

SM8750: persist RTC offset in SDAM#3033
andrebraga wants to merge 1 commit into
ROCKNIX:nextfrom
andrebraga:pr/sm8750-rtc-persist-offset

Conversation

@andrebraga

@andrebraga andrebraga commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • What is the goal of this PR?

pmk8550 RTC is a monotonic counter; rtc-pm8xxx stores wall-clock as an offset to it. Android maintains that offset in userspace with time_daemon and a record under /persist.

Mainline driver for pmk8550 supports either UEFI backing (with uefivars) or SDAM nonvolatile memory. 0x72(4 bytes) is a free slot in the scratch window (0x40-0x7f), sitting right below the 6 byte span that the mainline DTSI points out belongs to alarm-log (ADSP). Scrubbed all Android DT's for occupancy of other offsets&ranges and other than the aforementioned comment, only PON turned up.

This is the direction mainline is taking, and Qualcomm reps are visibly involved; see thread in https://lkml.org/lkml/2025/2/19/956

Testing

Verified on Odin 3 to survive cold power-off


AI Usage

While ROCKNIX doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? PARTIALLY

aanze added a commit to aanze/distribution that referenced this pull request Jul 16, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 16, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrebraga
andrebraga force-pushed the pr/sm8750-rtc-persist-offset branch 2 times, most recently from 4654181 to db114b1 Compare July 17, 2026 10:58
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrebraga
andrebraga force-pushed the pr/sm8750-rtc-persist-offset branch 3 times, most recently from 36422ee to 4174b24 Compare July 17, 2026 17:27
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aanze added a commit to aanze/distribution that referenced this pull request Jul 17, 2026
Upstream PR ROCKNIX#3033 persists the RTC wall-clock offset in pmk8550 SDAM_2
at 0x70-0x73; our panic breadcrumb spanned 0x50..0xb7 and would corrupt
the persisted clock whenever it fires. 32 bytes still fits the hung
device name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@andrebraga

andrebraga commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Going to close this because a much better approach was found (single source of truth shared with Android)

Bit of a rabbit hole with considerable carry, I'm prototyping another approach but this is honestly KISS and good enough.

@andrebraga andrebraga closed this Jul 18, 2026
@andrebraga andrebraga reopened this Jul 19, 2026
@andrebraga
andrebraga force-pushed the pr/sm8750-rtc-persist-offset branch from b0a82a4 to 69d81b3 Compare July 19, 2026 18:25
RTC regs are TZ-locked; rtc-pm8xxx stores wall-clock as an offset.
Android maintains that offset in userspace (time_daemon, persisted
to /persist), which ROCKNIX does not inherit, so the clock resets
to epoch every boot.

Back it with an nvmem cell in the always-on PMK8550 SDAM. 0x72 is
a free slot just below the ADSP-owned alarm-log at 0x76-0x7b,
verified on Odin 3 to survive cold power-off.
@andrebraga
andrebraga force-pushed the pr/sm8750-rtc-persist-offset branch from 69d81b3 to 2604fc6 Compare July 19, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant