Skip to content

T8142: suspend-to-RAM with J813 device and USB-C display recovery - #2135

Merged
DjDeveloperr merged 71 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-s2r-consolidated
Nov 17, 2026
Merged

DjDeveloperr merged 71 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j813-s2r-consolidated

Conversation

@sithglan

@sithglan sithglan commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Add T8142 suspend-to-RAM and the J813 CPU, display, radio, USB and SMC recovery paths needed to return to a usable desktop. The tested J813 resumes its internal panel, USB-C DisplayPort monitor, dock hubs and radios. This replaces closed #2043 with the complete original series and the J813 follow-up, including the external-display prerequisites.

The physical hardware qualification below used integration/aurora at 677be39, with head 28a6afc. The current branch also merges integration/aurora at a7dd26e, followed by compatibility fixes for the ATCPHY and cold-boot backlight host fixtures and the T8142 Centauri binding; these fixes do not change driver code or the device tree. All 19 commits from m0d16l14n1/linux:j815/t8142-s2r at 64720d1 and all 39 commits from the follow-up at 0c3e9bd replay without patch changes. Original authorship and test-only labels are preserved.

Six additional commits restore USB2 when a refused suspend restarts DWC3 beside an active DisplayPort link, apply the existing keep-USB3-PHY-awake host policy to T8142, complete the display, PHY and sleep bindings, and add J813's missing N1 factory-address targets. The USB3 change leaves normal USB autosuspend enabled; system sleep still stops the controller.

Included

  • T8142 entry/wake, AIC3, PMC/MCC, NVMe, SPMI, CPU holding pen, PMU timer/RTC sequence and PMP shutdown.
  • J813 cluster power gates, SEP high DMA window, GPIO interrupt recovery and AON audio policy.
  • Firmware 27.2 DCP A550 release, internal/external DCP stop and wake, display power/DART descriptions, GPU firmware support and sleep restart.
  • Final SMC notice after ANS and peer stops; PCIe MSI restoration; Bluetooth and Alpha Wi-Fi quiesce/acknowledgment paths.
  • USB PHY restoration and the complete T8142 DP Alt Mode path, including EIZO DPMS/relink fixes and host-fixture updates.
  • J813 wifi0/bluetooth0 aliases and PCI endpoint nodes from Diljit Singh's 223d7d72fac4, allowing the loader to supply the factory addresses.

This includes the needed unmerged work from #1941/#1942, the external-display prerequisites from #1806, and #2023/#2024/#2063. The per-SoC framework from #1963 is already in the base. Superseded experimental variants are not reapplied.

Validation

Refresh on 2026-11-17, head ce6b4e1: affected M5 C/Rust drivers build with LLVM 22 and Rust 1.98.1; all 137 Apple DTBs have zero new warnings against a7dd26e; all seven changed bindings pass. QEMU passes 400 KUnit cases with two skips. All 394 Aurora host runs pass, including 88 display host groups and the cold-boot backlight fixture with all five assertion-based negative controls. The updated ATCPHY fixture passes 38 production cases and rejects all 55 mutations; schema controls preserve the T6050 requirements and the exact T8142 compatible pair. The refreshed merged tree has not had a new physical suspend run; the hardware qualification below remains tied to 28a6afc.

Tested on a J813 with macOS 27.2 (26B123) firmware. The qualified kernel, aura and corrected device tree are installed as its normal boot stack. The full manual charger/cable matrix and Bluetooth pairing/audio remain open.

  • A complete 24-cycle physical-sleep run, with 8–300-second intervals and both displays on, either off, or both off. Each wake passed GPU readback, Bluetooth HCI, Wi-Fi-bound traffic, direct storage reads, a fresh fsynced write checksum, and actual USB2/USB3 hub control transfers.
  • Both displays and both EIZO hubs started automatically on three checked boots, without output-power or recovery commands. Five normal USB idle/autoresume rounds passed on each, without re-enumeration. Fresh data checksums survived three reboots.
  • Immediate SEP refusal, full no-commit preflight, repeated DPMS, and 8/20-second physical cycles passed on fresh boots. The USB2 production-function regression fails when its restoration is removed.
  • The machine's early-boot sleep service was tested and corrected to load SEP's declared ecdh_generic dependency before insmod. A fresh boot then initialized SEP and enabled deep sleep automatically.
  • After owner enrollment, a normal boot selected the qualified stack and enabled deep sleep automatically. The EIZO displayed through the dock; two further 8/20-second physical sleeps passed display, GPU, HCI, Wi-Fi, direct storage and actual control-transfer checks to two USB2 hubs and the dock's 10 Gb/s USB3 hub, without output-power or USB recovery commands.
  • The factory-address follow-up builds and preserves all existing compiled-DTB properties. Two further physical sleeps pass factory-address/BlueZ checks and live LE discovery, plus displays, USB, GPU, HCI, Wi-Fi and storage. A normal boot of the corrected default DTB passes those baseline checks too. The earlier HCI version check alone did not establish factory identity or pairing.
  • LLVM 22 Image/modules/DT build and all 88 display host groups pass. QEMU KUnit: 7 sleep-match passes; 117 display-fabric passes, one skip. GPU quarantine/drain and six negative controls pass.
  • Before the factory-address follow-up, all 137 Apple DTBs built with zero new warnings against the integration base; all six changed bindings passed. Whole-series checkpatch then had zero errors, 67 inherited warnings and 20 checks. The first five additions are individually clean. The imported factory-address commit has one metadata error for its absent author sign-off; its forwarding sign-off is present and code style is clean.

An earlier soak attempt woke after 43 of 60 seconds with MTP.DOCK.CHANNELS.AP0.IRQ. It was not credited as a completed RTC interval; its cause is unestablished. The full 24-cycle repeat had no early wakes. Existing stopped-PIPE, DCP service-admission and IRQ-affinity warnings remain; functional passes are not a claim of clean dmesg.

Runtime setup and limits

Deep sleep remains opt-in: CONFIG_KEXEC, the aura sleep mailbox and T8142 PCIe/Wi-Fi handoff tables, apple_sleep.deep=1, nvme_apple.sleep_untested=1, appledrm.s2r_untested=1, idle=nop and arm64.nowfxt. Physical commit is separately gated by apple_sleep.untested_commit=1; Alpha uses apple_centauri.alpha_sleep_untested=1. Load SEP with its module dependencies and wait for readiness. These tests disable XART writes, keybag provisioning, trusted keys and the FileVault API.

The overnight hardware tests used the instrumented EL2 aura stack at sithglan/aura:thomas/j813-el2-s2r-wakeprobe, 8b9c92ea8748, with AC, the debug tether and EIZO attached. The same aura code and qualified kernel are now enrolled as the machine's normal default; the subsequent normal-boot and dock sleep checks above passed. The full manual battery/cable/dock matrix remains pending. This exact combined tree is not hardware-qualified on J815.

Bluetooth pairing, ACL traffic and audio are not established by the local HCI/discovery checks. Alpha supports disconnected system suspend, not associated WoWLAN. This PR does not add hibernation.

Thanks to @m0d16l14n1 for the original T8142 series, @gig3m for the native sleep/wake traces, and the original display and sleep-framework authors retained in the commits.

cc @Acelogic @DjDeveloperr @RyanTheTide @LiamRay10

m0d16l14n1 and others added 30 commits November 16, 2026 20:39
As on T8132: the SoC's power goes in a suspend-to-RAM, so the AIC needs
the firmware-suspend save and restore.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The sleep commit zeroes the AP agent's whole voter word (T8132, and now
T8142), which holds its DCS vote as well as its floors. resume_early only
put the floors back. Cast the DCS vote again too; it's a no-op if the word
survived. Only after a real commit (pm_resume_via_firmware()).

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The slice's boot value was read at probe. A derived slice address (T8142)
would then be touched on every boot. Read it before the first write
instead, which only a sleep does, and protect it again only once it has
been read.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
T8142 gets T8140's firmware-stop values, as T8132 runs them, untraced.
Without nvme_apple.sleep_untested=1 ANS isn't registered with the sleep
controller, so a dry run never idles the root disk.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
AppleT8142MCC (macOS 27.2.1) runs mccEnableCacheMode(0) as its platform
sleep action. J815 has no skip-mcc-off-to-s2r; only T8140's J700 does.
For each plane it writes way count 0 to 0x2800 (plane stride 0x40000),
waits for the data ways (0x2804 [30:24]) and then the tag ways ([14:8])
to reach it, and writes 0x82c = 0. Its platform active action runs
mode 1, which puts the way count back the same way. aura's cold-boot
enable does that too, with 16 ways.

The kext's cacheFlush (0x82c = 1, 0x2844 = 1, poll 0x2844 bit 0 per
plane) is the sequence the T8140 path already uses at suspend_noirq. Keep
it as the write-back, and then turn the ways off as macOS does before
S2R. A timeout there loses nothing, since the flush already wrote
everything back. At resume_noirq, if the boot's way count (read at
probe) is not what plane 0 reads, put it back and wait for both counts
before allocation is enabled again. Without this, the cache would stay
off after a real wake.

T8132's measured lane/AMCC step in the sleep driver has no counterpart
in this kext. Its 0x220400580/0x220800580 blocks are outside J815's MCC
window (0x220000000 + 0x140000), so T8142 leaves it out.

Derived from the binaries, never run on an M5.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
…eep's commit

A core that the SoC restarts at its reset vector after a system sleep's
commit comes back through the boot object into secondary_holding_pen and
spins there on WFE. Its cluster can't power down with it running, and the
SoC's sleep sequencer waits on that with no timeout.

Once a sleep has committed, have such a core take the Apple deep-sleep
bits and WFI in the pen instead, as macOS's parked cores do. The flag is
read with the MMU off, set at spin_table_release_stopped() only where the
sleep driver armed it, and cleared before any CPU is started again after
the wake. T8142 arms it.

From aurora-silicon#1773 (T6050), where the cores a cluster round
restarted had to take this WFI before the first engine sequence completed.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
aurora-silicon#1963 drains a generation 4 controller's late reply after a failed
exchange, on the J714s only. The J813 and J815 (MacBook Air, M5) have the
same generation 4 nub-spmi controllers, and their deep sleep writes the
PMU on the same queue, so a stray reply there would refuse every later
command in the sleep. Take the J714s's recovery on both.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
macOS 27.2.1's sleep entry on the J815 sends the system power state
command (SSPS, S3) to both port controllers over nub-spmi-a0, as on the
J714s (26B131 trace: usid 10 and 8; the third port is the debug link).
The J813 and J815 SN201202x controllers sit on the same generation 4
SPMI, and their sleep node asks for the command (apple,sleep-ssps), so
apply the J714s's rules there as well. Only a firmware-driven sleep sends
it.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Add T8142 (J813, J815) to the sleep driver as its own apple_sleep_ops
and match data, on aurora-silicon#1963's coprocessor stops. The steps follow macOS
27.2.1 (26B131) as two traces of its sleep entry under aura's
virtualized SPTM show them: a J815 one (two cores, the whole entry to the
S2R timer) and gig3m's J813 one (ten cores, the memory controller
hooked). Where both hooked a block, they agree write for write.

- lower_io: the RAM clean, ATC0 with T8142's words, the radio's port
  stopped, then ANS's PCIe block in AppleT8142PCIe's order
  (APCIECoreRCGen4: PHY_SW before SYS_ST, the AUS5 pair inside an UP-bit
  window, the PLLs, the AXI enables, the gate loop).
- last_mile: AppleT8142PMGR::quiescePerfState (SoC to 3, DCS to 3
  through 5), the CPM gates around the AP's PMC vote, the complexes off,
  the quiesce read, then the memory side as the J813 trace has it, 4.6
  to 2.7 ms before the S2R timer: each AMCC plane's +0x28000 word cleared
  two bits at a time, the six SoC NI tables zeroed, the eight DCS
  channels' enables stepped down and their lanes strobed, the clock word
  0x380038000 <- 0x30000, and the CLLT "sleep hack" (EARLY_WAKEUP_CFG
  bits 17:16) right before the timer.
- SPTM's per-DART PS write-disable bits (/chosen/dart-ps-wr-dis-entries):
  while one is set, the PMGR drops writes to that DART's power word. The
  four macOS's SPTM clears during its entry (SEP, centauri, PMP, SIO DMA;
  the DCP's stays with the DART driver) are cleared, only where set, and
  reported after the wake. The watchdog's page 2 (+0x2c |= 0x20) before
  WD2, restored at the wake.
- wake: restoreHW, each complex on with its bit-4 wait, pwrgate
  +0x0/+0x60, the words back, ATC0, SEP, the CPM gates, WD2, ANS's block,
  and the radio's link trained again as aura trains it at boot.
- resume and pre_commit: T8132's (WD2 is at the same address).

Generic parts it needs, each a no-op on the other SoCs:
- SPMI generation 4's queue on the sleep's bus (status +0x200, FIFOs
  +0x210/+0x220, notification enable/ack +0x420/+0x620), with bounded
  drains around a PMU write.
- Register blocks a SoC doesn't have: T8142 has no pmc-dcp, clock
  muxes, PTD, cluster DCS or DVFM blocks.
- An untested SoC: deep sleep only with apple_sleep.deep=1, never the
  default; each sleep a dry run that refuses after every check unless
  apple_sleep.untested_commit=1; each step noted in PMU scratch (0x8308)
  for the boot after a reset (apple_sleep_note_sub() for a coprocessor's
  own steps).
- A radio link with no restore (apple,radio-host without trainable port
  data) refuses a real sleep while its host is bound.

The complexes' ACC word 0x40f8, which restoreHW writes, is only written
with apple_sleep.acc_wake=1: every Linux access to it has hung a J815 so
far.

The SoC data test accepts a matched SoC that is untested but gated, and
checks the SoC NI and PS write-disable tables.

Derived from the binaries, the traces and T8132's measurements; no M5
has gone through a full sleep and wake with it yet.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
J815's first real sleep past every check reset the Mac in the first
coprocessor stop pass (PMU note 0x44, boot 3c93d5a2), whose only member
is the GPU. Its domain read 0x244 at .enter (actual 4: the GPU gates
itself between frames, about 95 times a second on J815), and the stop
went straight to the RTKit idle poll and the coprocessor's and
mailbox's registers, which may not answer below full power; with
interrupts off a stalled read ends at WD2.

Bring the domain to full power first, as asahi_g17_power_raise() does,
keep the word from before for the resume, and touch nothing of the GPU
but its domain if the raise times out. Each step is noted in PMU scratch
with apple_sleep_note_sub().

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
T8142 (M5: the J813 and J815 MacBook Airs) has its own sleep controller
layout: no pmc-dcp, clock mux, PTD, cluster DCS or DVFM blocks, but the
memory side macOS steps down last (four AMCC planes, six SoC NI tables,
eight DCS channels and a clock word), the SPMI generation 4 queue, and
the complexes' ACC words. Its radio's PCIe link, which the boot loader
trains, is trained again after a wake: apple,radio-host and
apple,radio-perst name the host and the PERST# GPIO.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Add the T8142 sleep controller, the shared PCIe block whose ANS side the
wake brings back, and the port controllers' sleep power state, in a
dtsi shared by the 13- and 15-inch M5 Airs: their ADTs (27.0) differ
only in audio, product and CLPC power-limit properties. J813 includes
it; J815 can once its board file describes the display, USB and radio
nodes it refers to.

The wake sources are the J815 ADT's /arm-io/pmgr ap-wake-sources, the
same as T8132's by name. The memory-side regions are the J813 trace's
(gig3m), with the same /arm-io/mcc layout on J815.

The driver stops every sleep at a dry run unless booted with
apple_sleep.untested_commit=1, and uses deep sleep only when asked for.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
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>
… 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>
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>
The PMP firmware was idled and its RUN bit cleared, but its always-on
power domain stayed at target f. macOS lowers the AP-owned PMP domain
after the final idle and SRAM backup. PMS_SRAM then gates automatically
while retaining target f. Do the same before the final memory and CPU
sequence.

On the combined J813 test stack this permits a real physical sleep and
return, with the boot ID preserved and /sys/power/state returning 0.
Device recovery and the other local preparation changes are still under
investigation.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
After a J813 deep-sleep wake, headphone GPIO 100 can be in level-low
interrupt mode while its Linux IRQ is disabled and marked masked.
The generic mask_ack_irq() fallback skips irq_mask() in that state,
leaving the asserted input to repeatedly trigger AP GPIO parent IRQ 347.
CPU0 can stay in IRQ dispatch and starve I2C completions and resume
timers.

Provide irq_mask_ack so the pin is always masked in hardware before
acknowledging it. A clean-module hardware repeat completed parallel
device resume, with CS42L84 and AOP resume succeeding, without the
diagnostic interrupt or polling used to investigate the stall.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
…d-out core again

A platform sleep driver can ask for the parked cores' last deep WFI at EL1
(spin_table_pen_deep_el1()), with the MMU off, every exception masked and
stage 2 off, instead of at the kernel's EL.

A core powered on again after a sleep stays in spin_table_cpus_off until its
own cpu_postboot. Before, the bit was cleared before the start, so a core
whose start timed out was never pulsed again on the next online attempt.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
On J815 (boot e1d118f8) T8142 now goes past the commit, sleeps and comes
back through the boot loader's resume entry (boot object resumes 0 -> 1),
with the display and NVMe back. Before, every committed sleep ended in a WD2
reset about five seconds after the commit. The work below compared every
power word Linux leaves on with macOS's own entry (J815 26B131 trace) and
with macOS's state at its commit (J813 end state from Thomas Glanzmann's
trace), using the J815 ADT's PMGR parent tree.

Entry, what got the sleep engine past the commit:
- apple_sleep.dispext (default Y): the external DCPs are lowered with the
  display, in macOS's order (DISPEXT0, DISPEXT1, DISP). Their DARTs' PS
  write-disable bits read set on J815 and are cleared first, a running
  firmware is stopped cold, and the words come back after a refusal and at
  the wake. An external DCP whose domain is up but which the device tree
  doesn't list in apple,display-coprocessors refuses the sleep instead of
  letting the engine wait on it.
- apple_sleep.extra_off (default Y): the OS-managed words macOS has off at
  its commit that no other step lowered (SIO_CPU, left up by iBoot with no
  driver; GLOBAL_AUX_CTRL0/1; FPWM0; the PCIe OCLAs under APCIE_SYS_GP/ST;
  ATC2/3; the displays' ADMA words), children first, each only if on, and
  back at the wake once its parent is on.
- apple_sleep.pmp_off (default Y): PMP's domain stays off after its final
  stop, with its word saved and restored at the wake (Thomas's finding on
  J813, made switchable).
- The PMU's RTC alarm after the S2R timer as a switchable step
  (apple_sleep.pmu_alarm), XNU's boot-time AUTO_ENABLE words
  (apple_sleep.boot_auto), the parked cores' deep WFI before the boot
  core's last mile (apple_sleep.early_wfi), and the clkgen and memory-side
  restores at the wake (sleep-t8142-mem.h). ps_keep, mem_boot and mem_floor
  are experiments, mem_boot/mem_floor off by default.

Diagnostics: a commit digest in PMU scratch, written only to
0x8308..0x831e (from 0x831f the scratch holds data that isn't Linux's), the
dry run's full list of power words on, marked against macOS's commit
state, and one line per core start after a wake (apple_sleep.cpu_on_trace).

Still open: after the wake only the first core started in each complex
comes up; the external DCPs' firmware isn't restarted; the SMC woke this
sleep after 0.46 s. Still gated by apple_sleep.untested_commit.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
hw.s2r stops the internal DCP's firmware and powers its domains off when
the display is turned off, and restarts it warm on DPMS on. Only T8140
had the data for it. This adds what T8142 needs:

- the power words and DART streams become a per-SoC layout
  (dcp_s2r_layout), with T8140's values unchanged and T8142's derived
  from the macOS 27.2.1 device tree and PMGR (DISP_SYS at 0x290,
  retention words 0x11cc/0x11f0, no exclave streams, no pmc-dcp);
- firmware 27.0's sleep calls: set_power_state and the AP link release,
  which 27.0 still dispatches as A500, and D572 (powerUpDART). A build
  whose table has no tag for the release (27.2 and later moved it) is
  not offered the stop, and T8142 is offered it on firmware 27.0 only;
- T8142 has no DCP secure mailbox (no dcp-exclave-mailbox in the 27.0 or
  the 27.2.1 device tree of a J813), so the stop no longer requires one
  on this SoC (s2r_no_secure_port).

The stop stays off by default on T8142 (appledrm.s2r_untested=1 enables
it).

This is a screen-off (DPMS) power saving. No firmware-driven system
sleep has run on T8142, and a SoC behind appledrm.s2r_untested does not
take the stop's system sleep path.

Tested on a J813 (MacBook Air 13" M5, firmware 27.0) on this series,
with and without appledrm.s2r_untested=1: DPMS off stops the firmware,
DPMS on restarts it ("RTKit: Initializing") and the panel comes back at
its brightness, 6 of 6 cycles. System power with the screen off (SMC
PSTR, on battery, 12 and 15 samples): 2.72 W without the stop, 1.81 W
with it.

The driver part is from m0d16l14n1's J815 sleep work
(m0d16l14n1#1, 192a56c), without its hibernation and deep
sleep pieces; the secure mailbox change and the J813 test are new.

Assisted-by: Claude Opus 5.5
Assisted-by: Claude Fable 5.2
Signed-off-by: Kyle Arrington <kyle@arrington.co>
dcpext0 and dcpext1 of the T8142 (MacBook Air M5: one per USB-C display,
J704: HDMI) run the internal DCP's firmware 27 image; iBoot leaves them
running idle and the boot loader hands them over. Give them the T6050
external profile's shape: adopt the live session, one DPTX port, EDID
from the sink metadata. A processor that fails to probe or bind joins as
an unusable pipe and the internal panel goes on.

Not booted.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
(cherry picked from commit 0663908)
…PTX_ENDPOINT

On a J813 the external processors booted, then timed out waiting for the
DPTX port ("DPTX transport ready but port 0 service not announced",
-110), and every connect found no port service. The T8142 dcpext had the
T6050 external profile, which opens firmware 27's DPTX_ENDPOINT_V2 (0x2c)
and no DPTX controller.

macOS 27.2 on a J815 (IORegistry under iop-dcpext0/1-nub, RTBuddy
EndpointN = 0x1f + N) binds, per external processor:
- AppleDCPDPTXController (dcpav-controller-epic, dcpdp-controller-epic,
  units 0 and 1) on 0x24, DPTX_CONTROLLER_ENDPOINT;
- AppleDCPDPTXRemotePort (dcpdptx-port-epic, units 0 and 1) on 0x2a,
  DPTX_ENDPOINT; 0x2c has no service;
- dcpdptx-hdcp-interface on 0x2b.
dmitzsaz's J704 tree opens the same: the controller first, the ports on
DPTX_ENDPOINT with firmware 27, two ports.

Add two hardware data fields, dptx_endpoint and dptx_controller, and set
them for the T8142 dcpext with two DPTX ports (Type-C still uses port 0).
The controller endpoint speaks the same wire as the port, so it now
takes the OPEN handshake on firmware 27 too; for the H17P externals,
the only ones that opened it before, nothing changes.

Not booted yet.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
(cherry picked from commit 002bae8)
Adopt the working external display DT and use the firmware 27.2 link release before RTKit idle. Give each external processor its own power layout and include both in the sleep controller. Both warm restarts pass a dry run; real sleep still resets, with all external power states now matching macOS.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J813 external display processors complete the warm RTKit handshake
after deep sleep, but lose CPU_CONTROL.RUN within 20 ms. The next suspend
queues an AP-link release that the stopped processor cannot answer.

Set PS_MIN to 4 before raising the external CPU domain and enabling its
automatic power management. This matches the measured J813 macOS wake
sequence and the existing T8140 external DCP path.

On J813, both processors now retain RUN after wake and answer the next
suspend's link-release request. The second full sleep still needs further
debugging; this fixes the display processor retention failure.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
T8142 has no GAPF slice for the DCP DART. Its SPTM (27.2.1) keeps a bit
per DART in a shared PS write-disable register instead
(/chosen/dart-ps-wr-dis-entries): set, the fabric rejects writes to the
power word of the coprocessor CPU behind the DART. The driver clears
that bit where it clears GAPF bit 4 on T8140, for a DCP firmware stop,
and sets it again after. Only this DART's bit of the register is
changed.

A GAPF slice is handled as before. Nothing of the shared register's
boot value is written back, only this DART's bit.

From m0d16l14n1's J815 sleep work (m0d16l14n1#1, 192a56c),
taken out on its own for the DPMS firmware stop.

Assisted-by: Claude Opus 5.5
Assisted-by: Claude Fable 5.2
Signed-off-by: Kyle Arrington <kyle@arrington.co>
T8142's display power node has the power gate and power state words
only: its PMC keeps no count of the powered coprocessors, so there is no
pmc-dcp word.

From m0d16l14n1's J815 sleep work (m0d16l14n1#1, 192a56c).

Assisted-by: Claude Opus 5.5
Assisted-by: Claude Fable 5.2
Signed-off-by: Kyle Arrington <kyle@arrington.co>
The power gate and power state words a DCP firmware stop writes, and the
DCP DART's PS write-disable bit that protects DISP_CPU's power word
(ADT dart-dcp clock-protection-wr-dis-id 0x1f: pmgr reg[1] + 0x3fdc,
bit 6).

Assisted-by: Claude Fable 5.2
Signed-off-by: Kyle Arrington <kyle@arrington.co>
On a macOS 27.2 (26B123) stub, the J813 refuses its DCP's
apple,firmware-compat of 27.2.0. It then drives the DCP with the H17P
interface, and the 27.2 DCP firmware crashes on the first call
("ap_link: rpc_callee_gated: link_rpc_lookup callback not found:
'A427'").

The firmware 27.2 method table (iomfb_v27_methods("27.2.0")) drives the
J813's 27.2 DCP: with it the DCP boots, the panel comes up at 2560x1600
and sway presents on it.

Admit 27.2.0 on T8142 as firmware 27, so that probe picks that table.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe the status word and source mask that the sleep driver owns on
the Gen4 SPMI controller. T8142 needs the corresponding peripheral
interrupt enabled as well as the RTC alarm programmed to wake the AP.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Programming the RTC compare is insufficient when the Gen4 SPMI
peripheral source remains masked. J813 reached PMU stage 0x68 on its
second sleep; RTC_CTL showed FIRED, but the fresh aura entry marker
never changed. Enabling peripheral source 2 manually allowed a second
physical resume, with NUB.SPMI0.SW3 reported and the boot ID preserved.

After successfully programming the next alarm, acknowledge only the DT-
owned stale sources and enable their route. Restore their previous
enable state during wake, preserving other sources. This avoids using an
old latched alarm as the next wake event.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Keep the J716c descriptor-manager, GPU, and SMC resume paths alongside the T8142-specific display sleep admission.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr merged commit fc9c78f into aurora-silicon:integration/aurora Nov 17, 2026
8 checks passed
@gig3m

gig3m commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Post-merge result on my J813 (macOS 27.2 / 26B123 stub), kernel 408e27268fd6 (this PR's merged head) with your EL2 aura 8b9c92ea. On top: #1732's Touch ID node, #2019, #2142's rear USB4 commits, the J813 palm change and a local XRGB8888 plane patch.

The lid wakes it. I switched lid close to deep (apple_sleep.untested_commit=1) and set apple_sleep.t8142_wake_s=600 as a safety net. Then I closed and opened the lid twice during normal use:

  • Both were real sleeps: boot object resumes 0 -> 1, then 1 -> 2.
  • Both woke on the lid opening, after 89 s and 112 s. The alarm didn't fire.
  • wake source: MTP.DOCK.CHANNELS.AP0.IRQ both times. That's the source of the early wake in your soak notes, so on the J813 it looks like the lid (MTP) wake rather than a stray IRQ.

After each wake:

  • all 10 CPUs online;
  • Wi-Fi gateway ping 3/3;
  • Bluetooth Powered: yes;
  • the DCP stopped before the sleep (power_down_M3: disabling M3) and restarted after (RTKit: Initializing);
  • the panel came back on: Hyprland reports dpmsStatus: 1 and the backlight is at its brightness. On ce6b4e14 the session's DPMS stayed off after a wake until input.
  • Touch ID matched after the wake, with arm64/sep: describe J813 Touch ID and admit its T8142 profile #1732's sensor node.

The only kernel errors after the sleeps were the USB Ethernet adapter's -19 writes while it suspends.

An overnight run with t8142_wake_s=3600 is going now, lid closed. I'll add the result.

🤖 Generated with Claude Code

@gig3m

gig3m commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Overnight result from my J813, same kernel as my last comment (408e27268fd6 with your EL2 aura 8b9c92ea, plus #1732, #2019, #2142, the palm change and the XRGB plane patch). On battery, lid closed, apple_sleep.untested_commit=1, apple_sleep.t8142_wake_s=3600.

  • The lid closed at 21:25 and the machine slept until I opened it at 06:18, 8.9 h later.
  • The alarm woke it 8 times, every 3600 s on the dot (boot object resumes 63 -> 64 through 70 -> 71, wake source: NUB.SPMI0.SW3). Each time logind put it back to sleep about 29 s later, because the lid was still closed.
  • The lid opening woke it out of the ninth sleep (lid open ... at +2914603 ms in sleep: wakeup), and the panel came on without any input.
  • Battery: 35.42 → 33.53 Wh by the fuel gauge (65% → 61%), so 1.89 Wh over 8.9 h. That's about 0.21 W on average, wakes included. The gauge loses about 0.15 Wh per hour asleep, but it jumps by up to ±0.4 Wh around a wake, so I wouldn't read more into one hour than that. An earlier single 1-hour sleep read about 0.06 W.
  • After the lid wake:
    • all 10 CPUs online;
    • Wi-Fi reconnected 4 s after the wake;
    • Bluetooth Powered: yes.
  • The only kernel errors across the night were the IRQ affinity -38 warnings at each wake.

For comparison, before this series the same machine used 0.66 W and 1.46 W over a night in s2idle.

Since then I've run #2192 and #2193 on the same stack. The results are on #2193.

🤖 Generated with Claude Code

sithglan added a commit to sithglan/aurora-linux that referenced this pull request Nov 18, 2026
Integration now carries the J813's macOS 27.2 InitData (b70bc80,
through aurora-silicon#2135): RootProfile::J873G18G26B123 and the 26B123 common-interface
layouts. This branch has aurora-silicon#1173's M5 profiles J714G17S26B123 and
J714G17S26C5035 in the same matches. The resolution keeps both: every
match covers all seven profiles, aurora-silicon#1173's m5_layout() early returns stay,
and the 26B123 common-interface arms are integration's. No original
commit is rewritten.

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.

5 participants