Skip to content

drm/asahi: enable the J773g PMP and G16 firmware path - #1191

Draft
techmore wants to merge 6 commits into
aurora-silicon:integration/aurorafrom
techmore:j773g/g16-pmp-20261107
Draft

techmore wants to merge 6 commits into
aurora-silicon:integration/aurorafrom
techmore:j773g/g16-pmp-20261107

Conversation

@techmore

@techmore techmore commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This six-patch series carries J773g through the retained PMP and G16 firmware interface: PMP endpoint/report readiness, the retained AGX vote, board admission, the J773g DVFS table shape, and validation of the loaded 25G83 image after normalizing boot-filled fields.

The first, second and fourth patches name the existing firmware-qualified T8132 admission rather than newly enabling J773g. The bridge patch selects J773g explicitly for the AGX table and rejects its display consumer; other T8132 behavior is retained.

Provenance

The facts used here were observed in our own witness runs, public code, original live-ADT interface behavior, and the behavior of the loaded firmware interface. No Apple source code was copied. No raw ADT/device-tree dump, per-unit firmware image, or calibration bytes are included in the series. Added and repeated voltage test values are synthetic; model-wide frequencies remain unchanged.

The notes-repo audit aurora/upstream/mesa/PROVENANCE-NOV1-20261107.md concludes that no constants, encodings, or behavior in these changes came from the November 1 G16G firmware disassembly; that work concerned the GPU control coprocessor, not the shader ISA or the public interfaces implemented here.

Results

  • pass — C compile: the four touched C objects compiled on an ARM64 Linux VM with LLVM W=1; pmp-report emitted existing kernel-doc warnings. The previous series was built commit-by-commit; this rewritten series has not been built commit-by-commit. Rust preparation on this VM failed because its bindgen has the known empty-struct alignment defect.
  • previous series — host tests: relevant PMP/G16 host suites passed before this rewrite; not rerun on the rewritten head.
  • pass — prior bring-up stack: on one J773g, a different test implementation logged bridge registration and acknowledged the retained PMP vote; firmware reached READY and a compute job completed. This does not verify the rewritten bridge.
  • checkpatch --strict: patches 1–4 and 6 have 0 errors/0 warnings; patch 5 has one generic new-file/MAINTAINERS warning. Local SPDX checking also lacked the Python ply module.
  • not tested — exact PR head: no hardware boot of this rewritten series.
  • not tested — regressions: exact-head J773g compute, J713/J715 compatibility, suspend/resume, and repeated cold/warm boots remain to be run.

Hardware test plan

Before this leaves draft: boot the exact head on J773g; verify PMP readiness and AGX vote; run a known compute job; check the kernel log for firmware/GPU faults; repeat cold and warm; and run the available J713/J715 regression coverage. This PR stays draft until those affected-hardware checks are recorded.

The commits intentionally have no Signed-off-by yet. The human submitter will add his own DCO sign-off after review, as required by Documentation/process/coding-assistants.rst.

@techmore
techmore force-pushed the j773g/g16-pmp-20261107 branch from d8686de to 66896ea Compare November 8, 2026 05:20
@techmore

techmore commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Per Documentation/process/coding-assistants.rst, this draft branch deliberately carries no Signed-off-by added by an AI agent. After reviewing the final commits, the human submitter will run agents/sean-signoff.sh himself to add his own DCO certification and push the human-signed commits before the PR leaves draft.

@techmore
techmore force-pushed the j773g/g16-pmp-20261107 branch 2 times, most recently from e539e32 to 6b4f1ee Compare November 8, 2026 09:36
@techmore

techmore commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest integration/aurora and removed the observed voltage endpoints from the commit message. Repeated J713 voltage values in the tests now use synthetic bins; existing base fixtures are unchanged. The rewritten commits remain unsigned. CI is running on the new head.

@techmore
techmore force-pushed the j773g/g16-pmp-20261107 branch 2 times, most recently from bcd5763 to bb1286d Compare November 8, 2026 10:30

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Rebase onto the current integration/aurora. It conflicts in:

    • drivers/gpu/drm/asahi/hw/t6041.rs, with 579bcc3 ("drm/asahi: run the 25G83 build on the 40-core M4 Max"). That commit splits the file into a shared BASE and two firmware builds, and each of their FirmwareBuilds needs boot_fields: &[].
    • drivers/soc/apple/pmp-display.c and include/linux/soc/apple/pmp-display.h, with 6fde3b9 ("soc: apple: pmp-display: let the J713 DCP release its DISP vote").
  2. The kunit failure on this head is not caused by this diff. It is error[E0615] at drivers/gpu/drm/asahi/g17/buffer.rs:482 (ids.used where QosIds::used is a method), which comes from the old base. Re-run CI after the rebase.

  3. The description says the rewritten series has not been booted. Please add the J773g result for the rebased head that your test plan lists: PMP readiness, the AGX vote, firmware READY and a compute job.

@techmore
techmore force-pushed the j773g/g16-pmp-20261107 branch from bb1286d to 370ad38 Compare November 10, 2026 13:57
@techmore

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora 63be486; the head is now 370ad38.

  1. Conflicts:

    • hw/t6041.rs vs 579bcc3: I kept the shared BASE and both firmware builds. ed38f0d has since replaced boot_fields with boot_filled, already &[] on every T6041 build, so no further change was needed.
    • pmp-display.c / .h vs 6fde3b9: the DISP release stays J713-only. The J773g AGX path passes release=false and never binds a DISP consumer.
    • Two more surfaced in the rebase:
      • Commit 5 vs 833be9c (J604): the DVFS layouts are now chosen by board row count. J713 and J604 keep their 10-row output unchanged; J773g gets an 11-row layout.
      • Commit 6 vs ed38f0d: I dropped the series' own zeroing in favour of boot_filled (0x224, 4) and (0x5c917, 8). The digest is unchanged (9154c7f8…e85a). The image identity also matches build 2 of the signed 25G83 armfw_g16g.im4p.
  2. CI is green on 370ad38 (kunit, host-tests, rust-build, source); the E0615 is gone with the new base. W=1 adds no new warnings in drivers/soc/apple, drivers/pmdomain/apple or drivers/gpu/drm/asahi, checked per commit.

  3. The J773g boot of this head is running now. I'll post PMP readiness, the AGX vote, firmware READY and a compute job when I have them; the PR stays a draft until then.

@techmore

Copy link
Copy Markdown
Contributor Author

J773g result for the rebased head 370ad389, as asked: PMP readiness, the AGX vote, firmware READY and a compute job all pass, with no faults.

What was booted. 370ad389 plus 13 TEST ONLY commits that are not part of this PR, on one J773g (Mac16,10, system firmware 26.6.2), GCC 15.2, cold entry, m1n1 stage 2 with our J773g DTB. Twelve are the bring-up commits our J773g tree needs to reach userspace and be observed: AQC113 RX, main DCP manual bind, coprocessor and display master, T8122 DPTX PHY, DCP ADT profile, HDMI alias, framebuffer/DART/PIODMA handoff, ADT USB2 host field, and a binding-only PMP report layout. The thirteenth limits the T8132 platform handoff and the pmgr-pwrstate status check to the Airs again (next section). None of them changes this PR's code in this config; the one shared header only gains !CONFIG_APPLE_PMP stubs. The kernel command line has pd_ignore_unused clk_ignore_unused, as in all our J773g runs. Unused power domains and clocks were therefore not switched off at late init, so this boot does not exercise that cleanup.

Boot e47fcc31-81d9-4f32-963b-5198fdbd329d, Linux 7.3.0-m4atlrx+ #2 SMP PREEMPT_DYNAMIC Tue Nov 10 14:42:57 EST 2026 aarch64.

Check Result Kernel log
PMP readiness ready apple_pmp 380500000.pmp: PMP firmware and endpoint ready; J773g PMP vote bridge ready; retained existing PMP owner
AGX vote accepted apple_pmp 380500000.pmp: Retained AGX enable accepted: request=0020f50100000000 reply=0021000000000000
25G83 firmware identity accepted aurora-g16 302600000.gpu: GPU firmware build: Apple GFX 25G83 (normalized loaded image, J773g); M4: firmware identity accepted
DVFS 11 rows, S0-S10 M4 ADT DVFS: 16 source states -> 11 firmware rows (J773g layout), top 1578 MHz; S0 main=0 MHz auxiliary=0 MHz core=125 mV SRAM=780 mV ... S10 main=1578 MHz auxiliary=1578 MHz core=1045 mV SRAM=1045 mV
Firmware READY yes M4 firmware accepted owned initdata root0xfffffc2000000000, NOP and policy; READY; G16: firmware at READY, starting the backend
DRM registered [drm] Initialized aurora 1.0.0 for 302600000.gpu on minor 1
Mesa compute job PASS G16JOB: device='Apple M4 (G16G B0)' vendor=0x10005 device=0x8132 api=1.4.363; G16JOB: PASS value=28 submissions=1 dispatches=1; G16JOB: clean exit
Faults none no DART, power-domain or RTKit fault lines before or after the job

The DVFS rows and voltages match what our older J773g tree reports on the same unit.

Why the handoff was limited to the Airs. The cause is our DTB. It is not this PR, and #1171 (31c3ec3, already in the base) behaves as designed. The DTB we boot was built before #1171. It wires pcie0, the apcie DARTs, ATC2 USB and the DPTX PHY to PMGR domains that have no status. Since 31c3ec3 ("soc: apple: t8132: apply the M4 PMGR policy on the qualified firmware"), a non-Air tree has to state the status of the domains it wires, and a domain without one takes the J713 policy's. For apcie_gp, apcie_sys_gp and apcie_phy_sw that is disabled, so with our DTB PCIe never comes up, and the Ethernet and our netconsole go with it. Upstream's t8132-j773g.dts is not affected. Simulating the policy on it leaves no enabled device on a disabled domain, apart from the USB4 tunnel ports, which are the same on every T8132 board. We'll make our DTB state those domains the way t6040-j616s.dts does. Then we'll rerun this head without the thirteenth commit, so the PMP/G16 path also runs with #1171's handoff active on J773g, and post that result here.

Not covered yet: that rerun; exact 370ad389 without the TEST ONLY layer (it can't reach Linux on J773g without the bring-up commits); J713/J715 regression; suspend/resume; repeated cold and warm boots.

The existing telemetry predicate already selects firmware-qualified T8132,
including J773g, for endpoint 7. Name that condition for reuse by the
PMP and GPU paths; this is a refactoring, not a change in admission.
The misleading J713-only comments are corrected.

A prior J773g bring-up stack required endpoint 7 to complete PMP probe;
the current base already enables it on qualified T8132 machines.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Use the shared retained T8132 predicate for the report readiness path.
The prior test already selected the T8132 report for a compatible T8132
supplier on the qualified firmware path. The new predicate additionally
requires the machine compatible apple,t8132; it does not newly enable
J773g. Update the host fixtures to provide the same helper.

A prior J773g bring-up stack sent and received an AGX request with its
PMP report present. This refactoring has not been isolated on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The existing bridge treats every firmware-qualified T8132 machine as
J713 and requires a DISP record. Select J773g by its machine compatible
and require its AGX record instead, so the GPU can use the retained PMP
vote bridge without a DISP record. Reject display consumers on J773g;
other T8132 boards retain their existing behavior.

The fixed table shape and exact supplier checks remain in place, and an
accepted AGX vote is retained until reboot. The exported functions keep
their apple_pmp_j713_gpu_*() names to avoid Rust driver churn.

A prior J773g bring-up stack logged bridge registration and acknowledged
AGX requests on ten boots. That was a different implementation; this
change has not been booted on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Use the shared retained T8132 predicate at the G16 board check. The old
apple_pmp_j713_board() already selected firmware-qualified T8132 machines,
including J773g, so this is a rename with no admission change. The later
handoff, firmware identity, DMA and hardware identity checks remain.

A prior J773g bring-up stack admitted the handoff and reached firmware
READY with subsequent changes; this rename was not isolated on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The G16 driver builds its firmware DVFS table from the sixteen
performance states of the original ADT, using a list of qualified
ten-row index layouts: J713's (four single states, then six
equal-voltage pairs) and J604's. The M4 Mac mini (J773g) has the J604
shape: five single states, five equal-voltage pairs and a single top
state at 1578 MHz. That is eleven distinct rows, and the J604 layout
drops the fifth low state to fit in ten.

Keep every state on J773g. Add an eleven-row J773g layout and give each
layout its row count. The board pins the row count it is qualified
for, ten on J713 and J604 and eleven on J773g, and only layouts with
that count are tried, so the J604 and J773g layouts of the same shape
cannot be confused. The table holds up to eleven rows with a count,
Main 0xfc0 carries that count instead of a constant 10, and the
encoder's ceiling is the last row.

Nothing changes on J713 or J604: their layouts and order are kept, the
host tests' measured J713 ADT gives the same ten rows, the J604-shaped
case still selects the J604 layout on a ten-row board, and the
qualified initdata goldens still match at ceilings 1, 4 and 9. The
host tests use synthetic voltage bins rather than a measured chip's,
and substitute them into those goldens before comparing; every other
byte is compared unchanged.

The runtime ceiling policy is unchanged: it publishes at most S9, and
the hardware performance state is still refused above 9. On J773g the
top row (S10, 1578 MHz) is in the tables but never requested; using it
needs evidence of its own. The reported maximum frequency is the top
row's.

Tested on a J773g, on an earlier integration/aurora (19f71a1), with
a voltage-grouping selection that gives the same rows as the J773g
layout: the live ADT gave eleven rows, main/auxiliary 0/0, 338/338,
618/618, 796/796, 928/928, 1056/952, 1170/1053, 1278/1152, 1338/1204,
1470/1326 and 1578/1578 MHz. Voltage bins differ per chip; the table is
selected from its ADT. The firmware accepted these tables, reached
READY and completed a compute job. This layout-based version has not
been booted on hardware.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The M4 Mac mini (J773g) loads the 25G83 G16 firmware with the TEXT and
DATA sizes and entropy record offsets of the qualified image, but its
normalized TEXT changes from boot to boot. Comparing loaded images from
several boots, besides the GKTS and ECAP entropy bytes, iBoot rewrites
the 8 bytes of a record tagged DILS at 0x5c90f and the 32-bit header word
at 0x224 on every boot. Nothing else differs.

Add the J773g image with those two boot-filled ranges, the header word
(0x224, 4 bytes) and the DILS record's bytes (0x5c917, 8 bytes), which
fwid zeroes with the entropy bytes before hashing. The DILS tag and
length stay in the digest, so a record elsewhere does not match. The
existing T8132 builds name no boot-filled ranges, so their digests and
identification are unchanged. An unknown T8132 image is now reported
normalized with these two ranges, as fwid does for the first build of
its TEXT size that names any.

Measured on one J773g: the normalized SHA-256 9154c7f8...e85a matched on
fifteen boots under Aurora and on three offline TEXT dumps. That
measurement zeroed the same bytes, via an earlier per-build field list
that fwid's boot-filled ranges have since generalized.

Not yet compared with build 2 of the signed 25G83 armfw_g16g.im4p. The
normalized digest differs from both J713 images, and only that
comparison shows whether the difference is confined to what iBoot fills
in, that is, whether the firmware code is the qualified one.

Assisted-by: LLM checkpatch
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
@techmore
techmore force-pushed the j773g/g16-pmp-20261107 branch from 370ad38 to 1c60450 Compare November 12, 2026 16:58
@techmore

Copy link
Copy Markdown
Contributor Author

Rebased onto current integration/aurora (3a7a3f9); no functional change. The only conflict was in PmpDriver::suppress_bind_attrs() (drivers/soc/apple/pmp.rs): integration/aurora replaced its call with apple_pmp_keep_bound(), so the rebased commit keeps that call and only changes the comment above it from J713 to T8132, as before.

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