Skip to content

J813: T8142 S2R on #2043: PMU post-timer, DCP 27.2, test changes (the commit still resets) - #3

Merged
m0d16l14n1 merged 8 commits into
m0d16l14n1:j815/t8142-s2rfrom
sithglan:thomas/j813-s2r-on-2043
Nov 16, 2026
Merged

m0d16l14n1 merged 8 commits into
m0d16l14n1:j815/t8142-s2rfrom
sithglan:thomas/j813-s2r-on-2043

Conversation

@sithglan

@sithglan sithglan commented Nov 16, 2026 •

Copy link
Copy Markdown

I tested aurora-silicon#2043 on a J813 (macOS 27.2 stub, Linux at EL2). Two results so far:

  • Dry runs pass every check with the changes below.
  • A real commit still resets. It reaches the S2R timer and the PMU's post-timer commands, but the SoC never goes down: WD2 resets it about 5–10 s later. No attempt has slept and woken yet.

Commits, on aurora-silicon#2043 (99e4997). TEST ONLY marks what is for bring-up only:

  • TEST ONLY drm/asahi: t8142: J813: sleep_restart. The GPU refused every deep sleep ("no firmware restart on this chip"): T8142 has sleep_restart: false, and the commit-time GPU stop is only selected for T6050 (apple_sleep_v27_late()). This makes the J813 behave like T8140: the commit stops the firmware and a real wake restarts it warm. It has not been through a real wake yet.

  • drm/apple: iomfb: firmware 27.2: the AP link's release is A550. Without it the DCP never stops on 27.2. Also sent as drm/apple: iomfb: firmware 27.2: the AP link's release is A550 aurora-silicon/linux#2063.

  • soc: apple: sleep: T8142: the PMU's RTC alarm after the S2R timer, as macOS sends it, plus the fix that puts the byte count into the opcode. macOS 27.2 on the J813 sends these 0.11–0.25 ms after the timer, from the boot core:

    1. read 0x2000 (0x41);
    2. write the 4-byte compare at 0x2008;
    3. 0x200e <- 0;
    4. 0x2000 <- 0x41.

    That's T6050's post-timer step at the same addresses (apple,pmu-alarm-rearm 0x43 0x41). The T8142 ops had no post_timer. The test parameter apple_sleep.t8142_wake_s (default 30) sets the compare to now + 30 s, so the alarm also serves as a wake source. The J813 has no RTC device under Linux, so nothing else can wake it by timer.

  • TEST ONLY PMU notes:

    • 0x67 right before the commit write;
    • 0x70 first in apple_sleep_return();
    • 0x68 / 0x6e around the post-timer step, with nothing after the PMU's go when it succeeds;
    • 0x6f for a final WFI that keeps returning (ISR_EL1).
  • TEST ONLY t8142_perf, off by default: t8142_perf_down() writes pmgr reg[2] + 0x24000 / + 0x25000. macOS's AP never reads or writes those words in a sleep: the whole traced run, boot to wake, has none.

  • TEST ONLY: each core turns off its EL2/EL02 timers and the PMU FIQ modes before its last WFI.

Also needed, not in this branch

What the commits do (PMU notes after each reset)

  • Before the post-timer step: the last note was 0x67, the timer written.
  • After it: 0x68 with the alarm read OK and no 0x6e, so the PMU took all four commands. It still resets.
  • aura's wake path never runs. A test mark in aura's smp_s2r_return_to_os() stayed empty, so the SoC never goes down. No attempt woke and failed to resume.
  • Not the debug link. I dropped DebugUSB: AON 0xc0 went from 0x1f0400ff to 0x1404024f, and it still resets. WIP: T8142 (M5 Air: J813, J815) suspend-to-RAM: first real sleep and wake on J815 aurora-silicon/linux#2043 doesn't drive the debug port on SPMI gen 4.
  • Not a woken WFI. The boot core's last WFI doesn't keep returning (no 0x6f).

Open: the SEP

  • At macOS's commit, the SEP's power word reads 0x1000270f: DEV_DISABLE set, actual 0. Under Linux it reads 0x1f0020ff.
  • About 55 ms before the commit, macOS sends the SEP its SLEEP (0x20c0800). The answer 0x10800 comes 22 ms later.
  • The J813 DT has no SEP node. With one added, the SEP driver binds, but the SEP never answers its attach, though the ADT says sepfw-booted 1. On the J815 the attach works (the T8142 SEP profile commit).
  • So the J813's SEP stays up and is the main suspect. Which boot path does the J815 use?

Measured wake (aurora-silicon#2043 says "macOS's wake is not traced")

Boot core, ms from the reset:

  • clusters 0x380780000 and +4 <- 0xf at 1.3 and 2.0;
  • pwrgate +0x0 and +0x60 <- 0x80000000;
  • SEP 0xc00 <- 0x1000230f;
  • to target with AUTO_ENABLE, in this order: 0x118, 0x120, 0x138, 0x170, 0x178, 0x180, 0x348, 0x358, 0x368, 0x390, 0x398, 0x430, 0x438, 0x448, 0x458, 0x468, 0x470, 0x478, 0x480, 0x488, 0x5a0, then AON 0x88, 0x98, 0xa0, 0xa8;
  • AON 0xd8 and 0xc8 <- 0x3f0;
  • about 30 unused domains lowered;
  • 379 clkgen writes (0x380038100..), which t8142_wake() doesn't have;
  • pwrgate 0x3807240a0 / a8;
  • AMCC planes, mcc-b and mcc-ch re-init;
  • WD2 stopped at 14.988 ms.

Traces: https://tg.st/u/j813-s2r-traces-20261116.tar.xz. They contain all ten cores' entry and the go-mode sleep and wake; README inside. The stop-mode run with the SEP mailbox hooked (s05) is not in this bundle. The branch builds as arm64 with LLVM, no new warnings.

…ops, wake restarts)

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
27.2 moved the unnamed A500 (the AP link's release, which only a firmware sleep sends) to A550,
with the IOMFB calls around it: t8142dcp 26B123 compares 'A550' and 'A550' | 1 at 0x1df68c in
the dispatch whose 26A428 copy at 0x1de0dc compares 'A500' and 'A501'. Without the entry
dcp_s2r_capable() is false on 27.2 and the DCP never stops for a sleep.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
…e return; T8142 perf_down off

PMU notes 0x67 (the commit write is next) and 0x70 (back in apple_sleep_return). t8142_perf_down()
only with apple_sleep.t8142_perf=1: macOS's AP never reads or writes PMGR reg[2] + 0x24000 /
+0x25000 during a sleep (J813 27.2 traces, boot to wake).

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
… macOS sends it

macOS 27.2 on the J813 sends the PMU four commands 0.11 to 0.25 ms after the S2R timer (traced
under aura's virtualized SPTM, run g01): RTC_CTL read (0x41), the 4-byte compare at 0x2008,
0x200e <- 0, RTC_CTL <- 0x41 -- T6050's post-timer step at the same addresses. The T8142 ops had
no post_timer: the timer started (PMU note 0x67) and WD2 reset the SoC. TEST: the compare is
now + apple_sleep.t8142_wake_s (default 30), which doubles as a wake source.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
t6050_sleep_pmu_xfer_post() takes the opcode with the byte count in its low bits, as
t6050_sleep_pmu_xfer() builds it (macOS sends 0x33 for the 4-byte compare). The post-timer step
passed the bare opcode, so the alarm read before the commit failed and nothing was sent after
the timer (J813: PMU note detail 0xc3, -ENODATA).

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
…efore the last WFI; note a WFI that keeps returning

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
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.

2 participants