Skip to content

M5: J704 (MacBook Pro 14-inch, M5) GPU and display - #2093

Open
term-guy wants to merge 8 commits into
aurora-silicon:mainfrom
term-guy:j704-board-upstream
Open

term-guy wants to merge 8 commits into
aurora-silicon:mainfrom
term-guy:j704-board-upstream

Conversation

@term-guy

@term-guy term-guy commented Nov 16, 2026 •

Copy link
Copy Markdown

Adds the MacBook Pro 14" M5 (J704) to the G17 driver and its device tree. The J704 shares the J813's T8142 SoC, GPU identity and 26A428 COMMON26 firmware interface, but not its power data.

  • drm/asahi: g17: M5: add the J704 board. A J704 board on the COMMON26 graph, from the J813 one with the values that differ, each taken from the J704 ADT or from the init data macOS 27.0 hands its GPU firmware: 14 perf states (13 GPU states, 338-1620 MHz) with the J704 voltages, AON rows, region C and power-policy words, idle standby time, and no clearing write at hw_data 0x1118 (the 1620 MHz entry here). hw::t8142::select() picks the board by the root compatible
    (apple,j704; everything else keeps the J813) and fails the probe if it cannot be read. aurora.m5_probe_only=1 logs the ID registers and refuses the GPU before the UAT or firmware are touched.
  • arm64: dts: apple: t8142-j704: Add the GPU. As t8142-j813-gpu.dtsi, addresses and interrupts from the J704 ADT; 14 OPPs (perf-state-count 14).
  • arm64: dts: apple: t8142-j704: Give the DCP its firmware clocks. apple,clock-ids 585/431 as on the J813; without them the firmware-27 DCP does not start.

Needs aura with the J704 perf-state fix (aurora-silicon/aura#276) to fill the GPU nodes.

Testing on J704 (macOS 27.0 / 26A428 firmware, booted through aura, this branch on integration/aurora 24b3230): the GPU initializes every boot, t1-t4 (DRM info, Vulkan compute, GLES and Vulkan rendering) pass, the dEQP runs listed in aurora-silicon/mesa#397 pass, the internal panel runs through DCP (eDP-1 3024x1890) with backlight, and Ubuntu 26.04 runs with the GPU from an NFS root (t1-t4 pass there too).

Known problem, not caused by this board data as far as I can tell: with more than four
concurrent clients running geometry/tessellation work, the firmware occasionally restarts the
GPU (it recovers; the affected render is lost). Details in omacom/linux-aurora#493.

Tested on the hardware by me.

Assisted-by: LLM (Claude:Opus 5.5)

@joshuaswarren

Copy link
Copy Markdown

[Joshua's agent] Friendly heads-up for when this board lights up under a Hyprland 0.57 desktop: the "apple,t8142-dcp" primary keeps xrgb_is_alpha = true on V_27_0 and H17G-compat firmware in integration/aurora today (apple_drv.c, with the opaque-X property skipped for V_27_0), so the plane will not offer XRGB8888. We measured what that does on the sibling M5 panel: Hyprland asks for XR24, falls back to AR24 buffers while its monitor format stays XR24, and ensureBufferPresent then shows the frame from two updates back (buffer read 34 of 34 two-back; 2987 of 2987 current once XRGB was offered with X opaque). Details: #1816 (comment). Worth checking the first desktop boot with a buffer read or a camera walk before assuming vsync is fine. Happy to help test on our M5 machines.

@joshuaswarren

Copy link
Copy Markdown

[Joshua's agent] Correcting my heads-up above. Two things I said were wrong for this board. First, the "frames two updates late" symptom is not what stock Hyprland does: it came from our own downstream aquamarine patch (hyprwm/aquamarine#496, closed), which allocates AR24 when XR24 is missing; on a stock stack a plane without XR24 fails to start on that output ("GBM: Failed to allocate a GBM buffer: format XR24 isn't supported by primary backend"). Second, the 1816 fix I linked covers firmware 27.3 only (opaque-X property id 0x4f verified against the 27.3 kernelcache table) and makes no claim for the firmware this board runs; I should not have implied it transfers. What we measured, on our M5 panel with the 27.3 firmware only: buffer on the plane held the frame from two back 34 of 34 with XR24 missing, current 2987 of 2987 once XR24 was offered with X opaque. Whether that applies to 27.0/27.2 on this board is unmeasured; treat it as one data point, not guidance.

@term-guy
term-guy force-pushed the j704-board-upstream branch from 07d3d71 to 83650c7 Compare November 17, 2026 23:56
@term-guy

Copy link
Copy Markdown
Author

Rebased on integration/aurora 59b02d5 (the conflicts were with the 27.2 / 26B123 support). Two changes besides the rebase:

  • t8142-j704: Add the GPU now also describes fw-text, the firmware TEXT the driver identifies the build by since the J813 got it: both roles' __TEXT at 0x100_00e4_4000 + 0x9c000 under macOS 27.0, from the J704 ADT (gfx-asc/gfx1-asc segment-ranges; the same span as the J813). Without it the GPU is refused ("Unsupported GPU firmware image").
  • CONFIG_J704 admits only the 26A428 build. Through ..CONFIG it would also accept 26B123, whose build switches to CONFIG_26B123, i.e. the J813 board, so a J704 on 27.2 would silently run with the J813's power values. 27.2 on the J704 needs its own board data first (not measured here).

Tested on J704 (rebased branch + #2094 + #2095 + bring-up test trees, macOS 27.0 / 26A428 firmware): the firmware is
identified, t1-t4 pass, the GLES31/VK #826 dEQP set has only the known #395/#396 failures (Mesa aurora-wip aa1a2e5e640 + aurora-silicon/mesa#434), and 8 concurrent geometry-shader clients run 4 passes without a firmware restart.

@RyanTheTide

Copy link
Copy Markdown

The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. The J704 board data, fw-text range and DCP clocks here are taken and tested under the 27.0 (26A428) stub; please bring the J704 GPU and display up on the 27.2 stub (the 26B123 T8142 graph from #2135 is on integration/aurora now).

@RyanTheTide

Copy link
Copy Markdown

Thanks for bringing up the J704 GPU and display.

One part doesn't match how we usually select behaviour. drivers/gpu/drm/asahi/hw/t8142.rs:197-204 picks the GPU power data by root compatible: apple,j704 gets the J704 table, and every other T8142 board gets the J813's. That means a new T8142 board would quietly run with another board's voltages and perf states. We select by a hardware or device-tree property rather than by machine name, and for power data we prefer to fail closed.

This PR already adds the J704 GPU node with its 14 OPPs, and the boot loader fills the GPU node from the ADT. Could the per-board values (perf states, voltages and the other words that differ) come from that node, with the probe refusing a board whose node lacks them? m5_probe_only as a bring-up diagnostic that is off by default is fine.

This goes together with the 27.2 retarget question already open here. We can run no-regression rows on our A18 Pro and M4 Pro.

@RyanTheTide

Copy link
Copy Markdown

One follow-up to the two open points above, so the 27.2 re-test can be done in a single pass. The display part looks right: t8142-j704-display.dtsi now has apple,clock-ids = <585 431> and the two firmware clocks, the same as t8142-j813-display.dtsi, and t8142-j704.dtb builds here.

When the board data comes from the GPU node and CONFIG_J704 admits the 26B123 build, this is the J704 row we would need, on the macOS 27.2 (26B123) stub:

  • modetest -M apple -c: eDP connected, with the panel's full 3024x1964 mode in the list. The description reports eDP-1 at 3024x1890. Could you post the full mode list, and say whether 1890 is the mode below the notch or the only mode offered?
  • backlight: write 3 values (minimum, middle, maximum) to /sys/class/backlight/*/brightness. actual_brightness should follow each one, and the panel should visibly change.
  • drm/asahi probes on the 26B123 firmware with the J704 board (dmesg shows the selected board and its 14 perf states). After that, vkcube runs for 60 s, and glmark2-es2-drm (or glmark2-wayland) completes with its score posted.
  • dmesg for the whole session: no DCP or RTKit crash, no GPU firmware restart, and no asahi timeout.

Please post the dmesg, the mode list and the glmark2 output. We will then run the same driver change on our A18 Pro and M4 Pro to check that nothing regresses.

@RyanTheTide

Copy link
Copy Markdown

@term-guy, a follow-up to the review above, about the rest of the J704 rather than this PR. To bring the J704 up to the J813/J815 level we need a few things that only a J704 can give us.

  1. ADT values. The aura proxy is enough: tools/shell.py, then print(u.adt["/arm-io/<node>"]). The nodes we need: dispext*/dp-switch and the HDMI route, the audio amp i2c addresses and speaker order, the camera sensor-type, spi2 + mesa (Touch ID), hpm (MagSafe), and acio0/1/3.
  2. Rows once each DT patch lands. We write the DT from your ADT values and credit you:
    • External displays: a USB-C DP monitor on each of the 3 ports (modeset + hotplug x3), an HDMI monitor modeset, and aplay -l listing the HDMI/DP card.
    • Audio: jack insert shows in evtest, headphone playback works, arecord on the 3 mics gives non-zero peaks (post the numbers, not the recording). The amps must probe with the speakers at the safe level. Please don't play anything through the speakers.
    • Camera: v4l2-ctl --list-devices, then a 30 s capture with no ISP firmware crash in dmesg.
    • Touch ID: the SEP boots, enrol + match, suspend/resume x3, match after resume. Once soc: apple: sep: select the platform profile by SoC #2311 lands, the SEP profile is chosen by the SoC, so the J704 only needs its SEP/spi2/mesa DT.
    • MagSafe + TB4: charging shows in /sys/class/typec and power_supply. A TB4 dock enumerates on each port (boltctl list, lspci -t), hotplug x3.
    • USB device mode (you already run an NFS root over NCM): once the dwc3-apple change that lets the PHY decide host-only lands, please re-run the NCM gadget and post iperf3 numbers and cat /sys/class/udc/*/current_speed, so we know the J704 keeps device mode.

dmesg plus the command output, here or in a new issue, is perfect. Thanks again.

@term-guy

Copy link
Copy Markdown
Author

Thanks, all three done.

1. Board power data from the GPU node, fail closed. Three new commits on top of the branch (no rewrite of the existing ones):

  • dt-bindings: gpu: apple,agx: Describe the T8142 boards' GPU power data
  • arm64: dts: apple: t8142: State each board's GPU power data
  • drm/asahi: g17: M5: Read the T8142 board's power data from its GPU node

(860fde0, 4450dd1, f41fdbe.) dt_binding_check (dtschema 2026.9, yamllint) is clean for apple,agx.yaml. dt-validate passes the J704 DTB's GPU node and flags a node without one of the properties as ... is a required property. The binding's word limits (16 HW, 16 region C, 64 policy pairs, 8 AON rows) are the driver's.

hw/t8142.rs no longer looks at the root compatible. The driver keeps only the SoC's part (identity, core layout, firmware builds, and one T8142 template per firmware build: T8142 for 26A428, T8142_26B123 for 26B123). Each board's power data is read from its GPU node at probe:

  • frequencies and core voltages from operating-points-v2, plus apple,sram-microvolt;
  • apple,m5-relative-power, apple,m5-aon-records;
  • apple,m5-hw-words, apple,m5-region-c-words, apple,m5-policy-words;
  • apple,idleoff-standby-timer.

Properties without an ADT source are explicit arrays in the board .dts. A node that is missing any of them, or has malformed ones, is refused with M5: GPU node has no valid <property> ... or M5: invalid GPU power data in the device tree: <reason>. Malformed means wrong counts, unaligned or out-of-range offsets, policy words over the encoder's pointers, operating points the loader left at 0, or policy words the firmware build's layout has no place for. No board falls back to another's values. The relative-frequency curve is now computed from the operating points in integer arithmetic, with the same IEEE single roundings. A compile-time assert checks it against the float version for J714, J716C and J775D. A host test checks it bit for bit for the J704 and J813 tables and 2M random rising tables.

Equivalence: the J704 DTB's GPU node matches the previous static J704 board exactly:

  • OPPs, SRAM, relative power, AON rows;
  • HW, region C and policy words, standby timer.

The template's non-power fields equal the old J813 base. So on 26A428 the J704's InitData is unchanged.

Fail closed on hardware: the same kernel on the same 27.2 install, booted with the J704 DTB minus apple,m5-policy-words:

aurora 582600000.gpu: GPU firmware: 27.2 (26B123), G17G
aurora 582600000.gpu: M5: GPU node has no valid apple,m5-policy-words (ENOENT); the board's GPU power data must come from the device tree
aurora 582600000.gpu: probe with driver aurora failed with error -2

The probe stops before the MMU and RTKit are touched. No GPU card and no renderD128 appear, and the display (card1) still runs. The other refusal paths (malformed counts or offsets) were checked by reading the code.

2. 27.2 (26B123) stub. No J704-specific code is needed for 26B123: the probe picks T8142_26B123, and the policy words carry over in the relayout (+0x60 at 0x2f28). Note on the installer: upstream main puts J704/J813/J815 on the 26.6.2 stub, and the pinned 26B123 entry lists only j714*/j716*/j775*/j873s. For this test I used an installer branch that moves j704 to the pinned 26B123 entry (minimum 27.2, mBoot-20457.41.3) and records j704 in firmware-qualification.json. I can open that as an aurora-installer PR if that is the way you want the J704 pinned.

3. J704 on 27.2. Mac17,2 J704, fresh install on the macOS 27.2 (26B123) stub. Chain: aura -> U-Boot (u-boot#55) -> GRUB -> this branch (with the Fedora DTS on top) -> Fedora KDE on the GPU.

  • modetest -M apple -c: eDP-1, 6 modes, all 3024x1890: 120 (preferred), 60, 59.94, 50, 48, 47.95 Hz. 1890 is the below-notch mode: the panel is 3024x1964 (DCP: "Already set to timingID: 2 ... 3024x1964"), 1964 - 1890 = 74 rows of notch band.
  • Backlight apple-panel-bl (max 600): brightness 1 / 300 / 600 -> actual_brightness 1 / 300 / 600 (and 0 -> 0), bl_power 0.
  • GPU on 26B123:
    aurora 582600000.gpu: GPU firmware build: 26B123 for T8142 G17G, primary then secondary
    aurora 582600000.gpu: GPU firmware: 27.2 (26B123), G17G
    aurora 582600000.gpu: M5: board power data from the device tree: 13 performance states, top 1620 MHz
    aurora 582600000.gpu: M5 secondary initdata acknowledged
    aurora 582600000.gpu: M5 primary initdata acknowledged
    [drm] Initialized aurora 1.0.0 for 582600000.gpu on minor 0
    
    That is 14 perf states with the off state (13 after it), top 1620 MHz.
  • vkcube --wsi wayland in the KDE session: 60 s, stopped by timeout, Apple M5 (G17G C0) via Borealis.
  • glmark2-es2-wayland (800x600 windowed, Mesa 26.3.0-devel, OpenGL ES 3.2, Apple M5 (G17G C0)): Score 4251. All scenes ran, exit 0.
  • dmesg after both, 19 min uptime: no DCP/RTKit crash, no firmware restart, no asahi/aurora timeout or fault.

One cosmetic thing, not from this PR: with no apple,firmware-version on the GPU node, the build loop tries 26A428 first and logs unsupported GPU firmware build ... / GPU firmware image not admitted: EINVAL before it admits 26B123. The J813 on 27.2 should see the same. I can send a small separate change that logs only when no build matches.

AI-assisted, tested by me on the hardware.

@RyanTheTide

Copy link
Copy Markdown

Thanks, this is what we hoped for: the board's GPU power data now comes from its GPU node, the root compatible is gone from hw/t8142.rs, and a node without the data is refused before the firmware is touched. The fail-closed boot without apple,m5-policy-words and the J704 27.2 run (KDE, vkcube, glmark2 4251, clean dmesg) are clear evidence.

On the installer: yes, please open the J704 26B123 pin as an aurora-installer PR so it is reviewed on its own. The quieter firmware-build log also fits best as a separate small change.

We will run the no-regression rows on our A18 Pro and M4 Pro on f41fdbe and post them here.

@RyanTheTide

Copy link
Copy Markdown

The new m5_probe_only module parameter (asahi_core.rs, read in driver.rs and hw::t8142::select()) adds a bring-up mode that identifies the GPU and then refuses it. That is lab tooling rather than driver behaviour, and it gives the module a second start path that production never takes. Please drop the parameter and the PROBE selection, and keep the ID register and core mask dump as a dev_dbg or a debugfs file if it is still useful. Until then this should stay a draft.

@RyanTheTide
RyanTheTide marked this pull request as draft November 20, 2026 23:54
@term-guy

Copy link
Copy Markdown
Author

Done in c466b17 ("drm/asahi: g17: M5: Drop the identification-only probe"), on top so it is easy to review; I can squash it into 1549699 if you prefer. The parameter, PROBE and hw::t8142::select() are gone; the 26A428 path always starts with CONFIG, and BASE now carries the fields PROBE used to supply, with the same values, so the production configs are unchanged. The ID registers and core masks are still logged by the shared get_g17_id(), as on every G17 GPU, so no extra dev_dbg is needed. Builds (drivers/gpu/drm/asahi/, Fedora config, no new warnings).

About dt-checks: the three new warnings are the existing ones on the t6021-j475c, t6022-j180d and t6022-j475d GPU nodes ("... do not match any of the regexes"). Now that the binding defines apple,idleoff-standby-timer, that property drops out of their lists, so the line changes and the check counts it as new. The rest of each list is unchanged and has nothing to do with this PR.

AI-assisted (Assisted-by: LLM).

term-guy added a commit to term-guy/aurora-installer that referenced this pull request Nov 21, 2026
… review

The J704's caution still said nobody on the team has one and that aura
and this installer have not run on it. It has been installed with this
installer on the macOS 27.2 (26B123) stub and runs Fedora KDE, but its
GPU and internal display need aurora-silicon/linux#2093, which is not yet
in the distribution kernel. Say that, in supported-models.json and in the
installer's Stage 1 caution.

Assisted-by: LLM
Signed-off-by: termg <hello@termg.com>
@RyanTheTide

Copy link
Copy Markdown

Thanks, c466b17 does what we asked: m5_probe_only, PROBE and hw::t8142::select() are gone, the 26A428 path always starts from CONFIG with BASE carrying the same values, and the ID registers and core masks still come from the shared get_g17_id(). Squashed or on top is fine with us.

The dt-checks explanation makes sense: the three warnings are the existing t6021-j475c, t6022-j180d and t6022-j475d lists, which change only because the binding now defines apple,idleoff-standby-timer.

When you're ready, please take it out of draft so CI runs on this head.

@term-guy
term-guy marked this pull request as ready for review November 21, 2026 12:10
@RyanTheTide

Copy link
Copy Markdown

The dt-checks failure on this head isn't a regression from the PR. The head has fewer schema warnings than the base (1378 lines against 1383; 8 removed). The three it counts as new are the existing t6021-j475c, t6022-j180d and t6022-j475d gpu@406400000 warnings, whose list of undocumented properties got shorter because this PR documents some of them (e.g. apple,sram-microvolt). The gate compares warning lines as text, so a shortened line reads as a new warning. Those boards' apple,avg-power-*, apple,perf-* and apple,fast-die0-* properties are undocumented on the base too.

Assisted-by: LLM (Claude:Opus 5.5)

The J704 shares the J813's T8142 SoC, GPU identity (family 0xb, variant 2,
one cluster of ten core slots) and 26A428 COMMON26 firmware interface, but
not its power data. Add a J704 board on the COMMON26 graph, built from the
J813 one with the values that differ on this machine, each taken from the
J704 ADT or the init data macOS 27.0 hands its GPU firmware:

- 14 perf states (13 GPU states, 338..1620 MHz) with the J704 voltages,
  and the relative-performance table;
- the AON rows as macOS publishes them (RT0g with index 0x28);
- region C words, power-policy words (power limits 1300/38110) and the
  idle standby time, through two new board fields that are empty for the
  other boards;
- no clearing write at hw_data 0x1118, which is the 1620 MHz entry here.

Encoded on the host, the J704 HW data differs from the captured macOS data
only in runtime pointers; region C and AON are identical.

hw::t8142::select() picks the board by the root compatible (apple,j704;
everything else keeps the J813 config) and fails the probe if the
compatible cannot be read, rather than falling back to J813 values. The
new aurora.m5_probe_only=1 parameter selects PROBE, which logs the ID
registers and core masks and refuses the GPU before the UAT or the
firmware are touched, on either firmware path.

Tested on J704 (macOS 27.0 firmware, booted through aura): with
m5_probe_only the ID registers and core mask 0x3ff are logged and the GPU
is refused; without it both roles acknowledge their InitData and
"[drm] Initialized aurora 1.0.0 for 582600000.gpu" registers renderD128.
With Mesa aurora-wip, GLES 3.2 and Vulkan run on it: the dEQP GLES2, GLES3,
GLES31 and Vulkan caselists (about 1.1 million tests, on the 15 November
base) pass with the agx fixes that are being sent separately, and Ubuntu
26.04 runs with this GPU from an NFS root.

Signed-off-by: termg <hello@termg.com>
Describe the J704 GPU like the J813's (t8142-j813-gpu.dtsi): sgx, the
gfx and gfx1 ASC mailboxes, pmgr_gpu with ps_gfx, and the uat-*, gfx-data
and gfx1-data reservations that the boot loader fills, plus fw-data and
fw-text, the firmware DATA and TEXT the driver reads and identifies the
build by (both at the macOS 27.0 addresses, as on the J813; the J704 ADT
gfx-asc/gfx1-asc segment-ranges give the same TEXT span). Addresses and
interrupts match the J704 ADT. The OPP table has 14 entries, since this
machine's ADT has perf-state-count 14 (the J813 has 13).

Signed-off-by: termg <hello@termg.com>
The firmware-27 DCP interface asks for its provider clocks by index into
the ADT /arm-io/disp0 clock-ids, and fails to start without
apple,clock-ids. Describe them as on the J813: the J704 ADT has the same
ids, 585 and 431, and entry 0x49 of its clock-frequencies (the one 585's
low byte names) is the same 712 MHz. 431 is never asked for.

Tested on J704 (macOS 27.0 firmware, booted through aura): the DCP
driver binds, "DCP booted", eDP-1 connected and enabled at 3024x1890
inheriting the boot mode, and appledrmfb takes over the console.

Signed-off-by: termg <hello@termg.com>
The T8142 GPU's power data differs between the boards that use the SoC:
the J704 (MacBook Pro 14-inch, M5) has fourteen performance states up to
1620 MHz, other voltages, relative power, AON rows and power limits than
the J813 (MacBook Air, M5). Describe it in the GPU node so that each board
states its own, and require it on apple,agx-t8142:

- apple,sram-microvolt: the SRAM voltage of each operating point (the
  operating points carry the core voltage, one cell, as the boot loader
  fills them from the ADT's sgx perf-states);
- apple,m5-relative-power: each operating point's relative performance,
  IEEE single bit patterns;
- apple,m5-aon-records: the AON rows the firmware reads;
- apple,m5-hw-words, apple,m5-region-c-words, apple,m5-policy-words:
  <offset value> pairs where the board's firmware data differs from the
  SoC's template in the driver (region C and policy may be empty);
- apple,idleoff-standby-timer: the idle standby time, us, the name the
  G15 boards' power words already use.

Signed-off-by: termg <hello@termg.com>
Give the J813 and J704 GPU nodes the power data the binding now requires,
so the driver can take it from the node rather than pick a table by the
machine compatible:

- t8142-j813-gpu.dtsi: the values the driver's J813 board has carried so
  far (perf-states-sram of the J813 ADT, the relative power and HW words
  read out of macOS 27.0's own data on a J813, the RT0g AON row, no region
  C or policy words, the template's 1250 us standby timer). The J815
  includes this file and has run the J813's board until now; it keeps
  those values. Its operating points stay filled in by the boot loader
  from its own ADT, which the driver now reads.
- t8142-j704-gpu.dtsi: the J704 board's values (its ADT and macOS 27.0's
  own InitData on a J704), as the driver's J704 board had them: SRAM
  voltages, relative power, the four AON rows, the HW words without the
  J813's clearing write at +0x1118, the five region C words, the 54 power
  policy words and the 2000 us standby timer.

Signed-off-by: termg <hello@termg.com>
hw::t8142::select() picked the GPU power data by the root compatible: the
J704 table on apple,j704, the J813's on every other T8142 board. A board
that is neither ran with the J813's performance states, voltages and power
limits, and the J704 could only run the 26A428 (macOS 27.0) firmware,
since the 26B123 (27.2) configuration carried the J813's board.

Keep only the SoC's part in the driver: the identity, core layout,
firmware builds and a T8142 board template (graph, register windows, MCC
mask, render pool, the J813's) with no performance state. The probe reads
each board's power data from its GPU node (BoardPower): the frequencies
and core voltages from its operating points, the SRAM voltages, relative
power, AON rows, HW data, region C and power policy words and the idle
standby timer from the properties the binding describes, and completes
the firmware build's template with it (Board::with_power). The
relative-frequency curve is computed from the operating points with the
same IEEE single roundings as before, in integer arithmetic; it matches
the floating-point one for the static tables (checked at compile time).

The probe fails closed: a GPU node without one of these properties, with
malformed ones (counts, alignment, a word over the policy's pointers or
over a used state's frequency, operating points the loader did not fill)
or with policy words the build's layout has no place for is refused with
"M5: GPU node has no valid <property> ..." or "M5: invalid GPU power data
in the device tree: <reason>", and no board falls back to another's
values. The board is kept for the boot (a rebind must read the same).
aurora.m5_probe_only stays as the off-by-default diagnostic.

With the board no longer tied to a build, the J704 runs both builds: on
26B123 its words are applied in the 26A428 layout and moved with the rest
of the policy block, as the J813's are (every J704 policy word lies in a
band the 26B123 layout carries).

Encoded on the host, the boards built from the J813 and J704 trees give
InitData (HW data bundle with the power policy, region C, AON) byte for
byte identical to the static J813 and J704 boards they replace on 26A428,
and to those boards on the 26B123 graph; on 26B123 the J704's policy
differs from the J813's only at its own words, relocated.

Signed-off-by: termg <hello@termg.com>
The m5_probe_only module parameter made the T8142 probe identify the GPU
and then refuse it, before the UAT or the firmware were touched. It was a
bring-up aid that gave the driver a second start path production never
takes. Remove the parameter, the PROBE configuration it selected and
hw::t8142::select(): the 26A428 path now always starts with CONFIG, which
takes the fields PROBE used to supply through BASE.

The ID registers and core masks are still logged by get_g17_id(), as on
every G17 GPU.

Signed-off-by: termg <hello@termg.com>
@term-guy
term-guy force-pushed the j704-board-upstream branch from c466b17 to 9f852f2 Compare November 22, 2026 23:33
term-guy added a commit to term-guy/aurora-installer that referenced this pull request Nov 22, 2026
List j704 in the pinned 26B123 entry as an experimental board, as the
J815 and T6050 boards are: firmware-qualification.json records its device
tree and BuildManifest identity (j704ap, chip 0x8142, board 0x22, as in
the pinned 26B123 BuildManifest), and no qualifying kernel release yet.
Its device minimum moves to 27.2 and it leaves the universal 26.6.2
entry, so a J704 on 26.6.2 through 27.1 is asked to update macOS instead
of getting the 26.6.2 stub.

Hardware result: a contributor installed the J704 on the 27.2 stub with
a development kernel carrying aurora-silicon/linux#2093, the J704 GPU and
display board support, and runs Fedora KDE on it. It moves to the
qualified boards with the distribution kernel release that ships
linux#2093.

The owner-facing caution (Stage1Caution.swift and supported-models.json)
no longer says nobody has run it: it says that a contributor installed
it on the 27.2 stub with a development kernel, that macOS 27.2 is
required, and that the published kernel does not have linux#2093 yet,
so a stock install has no GPU acceleration and may start without the
built-in display.

Signed-off-by: termg <hello@termg.com>
@term-guy

Copy link
Copy Markdown
Author

Updated (9f852f2): the commits now carry only the human Signed-off-bys, with no Assisted-by trailers, and the disclosure is the last line of the description. The trees are identical to c466b17, so the earlier J704 boots and the dt-checks notes above still apply.

Assisted-by: LLM (Claude:Opus 5.5)

integration/aurora now computes the state frequencies before Shared is
built; pass the M5 board's performance states to that call and drop the
later one.

Signed-off-by: termg <hello@termg.com>
@term-guy

Copy link
Copy Markdown
Author

Merged integration/aurora (160ca43) to clear the conflict in drivers/gpu/drm/asahi/g17/mod.rs (0b6bdb6). Integration now computes the state frequencies before Shared is built. The resolution passes the M5 board's performance states (m5_board) to that call and drops this PR's later one, so behaviour is unchanged. drivers/gpu/drm/asahi/ builds with the same 32 warnings as before. No other change.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review of 0b6bdb61cdfa4c9cd1898d7340bb1613a958cfcc against the pre-PR checklist (§1–§6).

The move from root-compatible selection to DT-driven, fail-closed T8142 board power data, the removal of m5_probe_only, the t8142-j704-display.dtsi clock additions, and the integer relative_frequency_soft implementation are all in good shape. Requesting changes for the merge conflict, a §3 safety issue in t8142-j704-gpu.dtsi, two validation gaps in m5/initdata.rs, a §6 naming nit, failing dt-checks, and exact-head §5 evidence.

Blockers

  1. Merge conflict against main (CONFLICTING / DIRTY)

    • drivers/gpu/drm/asahi/g17/fw/m5/initdata.rs conflicts with 73ceb1bc75 (#1958), which added pub(crate) host_only_render_kicks: bool to Board and every Board literal (J714, J716C, J775D, J813).
    • Please rebase onto main (keeping host_only_render_kicks: false on T8142) and drop the integration/aurora merge commit 0b6bdb61cdfa.
  2. §3 Safety — Hardcoded per-unit core voltages in arch/arm64/boot/dts/apple/t8142-j704-gpu.dtsi:85-98 defeat the fail-closed OPP guard

    • t8142-j704-gpu.dtsi:85-98 pre-fills opp00..opp13 with real frequencies and one J704 unit's silicon-binned core voltages (125000, 610000..1030000 uV), unlike arch/arm64/boot/dts/apple/t8142-j813-gpu.dtsi:53-65, which leaves all entries at <0>.
    • BoardPower::new (drivers/gpu/drm/asahi/g17/fw/m5/initdata.rs:2734-2738) explicitly relies on unpopulated OPPs staying 0 to fail closed if a boot loader did not fill operating-points-v2 from /arm-io/sgx perf-states. Pre-filling opp00..opp13 means an older loader or any boot path that does not overwrite the OPP table will silently pass validation and drive another J704's GPU at the wrong binned core voltages.
    • Fix: Set all 14 entries in t8142-j704-gpu.dtsi:85-98 to opp-hz = /bits/ 64 <0>; opp-microvolt = <0>; (matching t8142-j813-gpu.dtsi) and update the comment at line 21.
  3. §3 Bounds & voltage validation in drivers/gpu/drm/asahi/g17/fw/m5/initdata.rs

    • HW data size bound (initdata.rs:2764): BoardPower::new checks offset + 4 <= M5_HW_DATA_SIZE (0x2850), but T8142 (hw_data_insert: false, common 26A428) has HW data size COMMON26_HW_DATA_SIZE (0x2848, ABI_ALLOCATION_SIZES_26A428[ALLOC_HW_DATA]). Offsets 0x2848 and 0x284c pass validation despite falling past the end of the common-26A428 HW data block. Bound against COMMON26_HW_DATA_SIZE (or check against if self.hw_data_insert { M5_HW_DATA_SIZE } else { COMMON26_HW_DATA_SIZE } in Board::with_power).
    • SRAM vs core voltage invariant (initdata.rs:2728-2745): On both J813 and J704, perf-states-sram tracks the per-chip fused core voltage above the 770 mV SRAM floor (sram_mv = max(770, core_mv)). Because aura overwrites opp-microvolt from the machine's ADT while apple,sram-microvolt is currently static in t8142-j813-gpu.dtsi:124-125 and t8142-j704-gpu.dtsi:151-152, a unit with higher fused core voltages than the static DT values would run with sram_uv < core_uv. Please validate sram_uv >= core_uv in BoardPower::new so that case fails closed rather than under-volting SRAM (and consider a follow-up in aura to populate apple,sram-microvolt from ADT perf-states-sram, which dt_set_gpu_g17 already reads and validates).
  4. §6 Naming — drivers/gpu/drm/asahi/hw/t8142.rs:15

    • //! J704 (m1n1 proxy reads of SGX, before this driver): ... — please replace m1n1 with aura.
  5. §5 CI (dt-checks FAILURE) & exact-head hardware / regression evidence

    • dt-checks failed on 0b6bdb61cdfa (host-tests passed 463/463). As noted in the thread, apple,agx.yaml passes dt_binding_check, apple-adt-coverage.py and apple-dart-pd-check.py are clean, and total schema warnings drop from 1258 to 1253 (8 removed); the 3 "new" warnings are the pre-existing t6021-j475c.dtb, t6022-j180d.dtb, and t6022-j475d.dtb gpu@406400000 lines whose undocumented-property lists shrank once apple,idleoff-standby-timer was documented, which scripts/dtc/apple-dt-check.sh's comm -13 line diff flags. We still need dt-checks green on the final head before merge (which likely wants a small fix to scripts/dtc/apple-dt-check.sh on main to diff undocumented property names rather than full comma-joined lines).
    • Exact-head hardware evidence: The last J704 27.2 run was reported on f41fdbe5af44 (prior to 9f852f29 and the g17/mod.rs change in 0b6bdb61cdfa) and does not include the §5 regression counters (0 SELinux denials, 0 failed units, 0 new kernel errors). After rebasing onto main and applying the fixes above, please re-run on the final head SHA on J704 (confirming the zeroed gpu_opp table is filled by aura and boots cleanly) and post the §5 regression counters. Because this PR also changes how J813/J815 load GPU power data (t8142-j813-gpu.dtsi + hw/t8142.rs), please also call out/record a J813 or J815 boot verification.

Non-blocking notes

  • PR description: Still describes the old root-compatible hw::t8142::select() and aurora.m5_probe_only=1 paths that were removed in 50764a1a and 9f852f29. Worth updating to match the current implementation.
  • Stack frame size in hw/t8142.rs:200-225: BoardPower is ~2.7 KiB and is constructed by value on the stack in BoardPower::new and moved into POWER.populate(power). Worth checking that drivers/gpu/drm/asahi/hw/t8142.rs stays well clear of -Wframe-larger-than on arm64 kernel builds.
  • Board::with_power policy-band check (initdata.rs:2824-2829): relocate_by_bands(relayout.policy_bands, offset) checks byte 0 of each 4-byte policy word; safe for the current 4-byte-aligned COMMON26B123_POLICY_BANDS, though checking all 4 bytes land contiguously would protect against any future non-4-byte-aligned band boundary.
  • Commit history (optional): Squashing the early hw::t8142::select() / m5_probe_only introduction (a10a0996) with its later removals (50764a1a, 9f852f29) during the rebase onto main would keep git bisect clean.

Checklist summary (0b6bdb61cdfa)

  • §1 No model gating: Pass — root-compatible check removed; per-board power data comes from the GPU DT node and fails closed. Needs J813/J815 verification alongside J704.
  • §2 Production-ready: Pass — m5_probe_only removed; default kernel command line.
  • §3 Safety: Changes requested — zero t8142-j704-gpu.dtsi OPP placeholders, tighten COMMON26_HW_DATA_SIZE bound, and enforce sram_uv >= core_uv.
  • §4 Clean-room & attribution: Pass — human author and human Signed-off-by: only on all commits, no AI trailers in commits.
  • §5 Evidence & CI: Changes requested — dt-checks failing, merge conflict with main, and exact-head J704 + regression counters (+ J813/J815 check) needed after rebase.
  • §6 Naming: Changes requested — m1n1 reference in drivers/gpu/drm/asahi/hw/t8142.rs:15.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants