Skip to content

pmgr: stop reading die 0's power words for a two-die SoC's die-1 devices - #263

Merged
DjDeveloperr merged 2 commits into
aurora-silicon:mainfrom
funkzy:t6050-pmgr-die1
Nov 19, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-silicon:mainfrom
funkzy:t6050-pmgr-die1

Conversation

@funkzy

@funkzy funkzy commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What is wrong

pmgr_adt_collect_psregs() lists the PS registers of a node's clock gates and their parents, for callers that must
check or keep a device powered. It reads each gate's device id from the ADT but computes every address on die 0
(pmgr_device_get_addr(0, ...)), and pushes the parents without a die. On a two-die SoC a die-1 device's list
therefore names its die-0 twin's words: on the Mac Studio (M5 Ultra, J775D), the second die's HDMI engine dcpext4
gets dcpext0's power words, so a "powered" check of dcpext4 reads dcpext0's state.

pmgr's own power-on path already keeps the die: pmgr_set_mode_recursive() takes it from the ADT entry and passes it
to each parent. dj's 6001516 shared this collector with the display handoff, and his a9d3512 wrote it for
the SPTM-virt sleep path; c498a75 (dj's #178) gave pmgr the T6050 die stride.

What this changes

The stack keeps each entry's die and device id as the ADT has them; the address is computed on that die, and each
parent is pushed with its child's die. The function's comment says per die. A die-0 entry carries die 0, so its list
is what it was.

Who runs the changed code

Two callers on main:

  • The T6050 display handoff (kboot_display_handoff.c, t6050_ext_one()): the power check of each external
    engine. On main it runs on the T6050 boards with an internal panel (J714s, J714c, K116s, K114c, J716c) for
    dcpext0..3, all on die 0 of a one-die SoC: their lists do not change. The J775D display PR is the first caller
    with a die-1 device (dcpext4).
  • The SPTM-virt sleep path (sptm_virt_s2r.c, s2r_keep_setup(), SPTM_VIRT=1 builds only): the controller,
    DART and PHY of each USB port it keeps powered for the guest. On a one-die SoC (the J700's T8140, the J616s's T6041)
    nothing changes; on a two-die SoC a port on die 1 now keeps its own die's domains.

The result changes only for an ADT gate entry with a non-zero die, which only a two-die SoC (an Ultra: the T6002,
the T6022, the M5 Ultra) has.

Validation

  • A host check (not part of the PR) extracts struct pmgr_device and the collector with its helpers, from main and
    from this branch, and runs both over every node with clock gates in the J775D's ADT PMGR tables: all 78 nodes whose
    gates are on die 0 collect the same words; the 43 die-1 nodes now get die-1 addresses (/arm-io/dp-audio7:
    0x42806002a8, 0x4280600220, 0x42806001e8, where main gave 0x2806002a8, 0x280600220, 0x2806001e8).
  • aura's display and pmgr Python tests (16 modules, 128 cases) give the same result per case on main and on this
    branch.
  • RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1 with clang/lld: builds with main's warnings; aura.bin 3997696 bytes,
    _file_vital_end 0x11b6c8 as on main; pmgr_adt_collect_psregs 492 to 516 bytes. clang-format clean.
  • Rebased onto main at 3d517e6 (the T8142 sleep tracer, sptm_virt: T8142: macOS on all ten cores, and a trace of its sleep and wake #277, among the new commits) without a conflict; the diff is
    unchanged and pmgr.c is the same on both bases. There it builds with main's warnings, aura.bin 3997696 bytes
    and _file_vital_end 0x11b890 as on main, and the host pytest suite as CI runs it gives 750 passed, 56 skipped, as on main.

Hardware

  • J775D, with the J775D display PR on top, booting integration/aurora at 7c71d6df6563 with the M5 Ultra linux pull
    request (and a compute-timestamp change that is no longer in this set): dcpext4's power check passes on its own
    die's words and the HDMI engine is handed over; the desktop comes up with HDMI and DisplayPort.
  • J775D, main at eb66d6c plus this and the other aura pull requests below, booting integration/aurora at
    fc050503ffcd with only the linux pull requests below, one boot: the desktop runs on the GPU on HDMI and
    DisplayPort, both at 1920x1080.
  • J775D, main at 03d120d plus this and the other aura pull requests below (the same files as this branch), booting
    integration/aurora at 1f38ff8f4dc9 with the linux pull request below: on the 27.0 stub the desktop runs on the GPU
    on HDMI and DisplayPort at 1920x1080@60; on the 27.2 stub (26B123) dcpext4's power check passes on its own die's
    words, the HDMI engine is handed over and HDMI comes up at 1920x1080@60 (no DisplayPort monitor was connected
    for that boot).
  • Not booted on a one-die T6050 board or under SPTM-virt. The one-die lists are the same by construction (every
    die is 0); a boot on a J714s with an external display would confirm the handoff's checks there.

Part of the M5 Ultra platform pack

Each pull request below stands on its own; together they bring the Mac Studio (M5 Ultra, J775D) up from public
branches to the desktop.

pmgr_adt_collect_psregs() lists the PS registers of a node's clock
gates and their parents, but computed every address on die 0. On a
two-die SoC a die-1 device's list therefore named its die-0 twin's
words, so a caller checking that the device is powered read the wrong
die's state. pmgr's own power-on path already keeps the die of each
gate and passes it to the parents (pmgr_set_mode_recursive()).

Do the same here: keep each gate's die from the ADT entry, pass it on
to the parents, and compute the address on that die. A die-0 entry
carries die 0, so single-die SoCs and die-0 devices get the same list
as before.

Checked on the host against the Mac Studio's (M5 Ultra, J775D) PMGR
tables: all 78 die-0 nodes collect the same words as before; the 43
die-1 nodes now get die-1 addresses (0x42806002a8 for dp-audio7's
gate, where it read 0x2806002a8 before).

Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
@DjDeveloperr
DjDeveloperr merged commit 610ef95 into aurora-silicon:main Nov 19, 2026
15 checks passed
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.

3 participants