Skip to content

soc: apple: pmp, pmdomain: pmp-report: add T6040 (M4 Pro) - #374

Merged
RyanTheTide merged 4 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/pmp-t6041
Oct 23, 2026
Merged

RyanTheTide merged 4 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/pmp-t6041

Conversation

@jgoyvaerts

Copy link
Copy Markdown
Contributor

T6040 (M4 Pro) support for the PMP driver and its report region.

  • Bindings: apple,t6041-pmp-v2 (fallback apple,t6000-pmp-v2) with five optional boot-argument properties, and apple,t6041-pmp-v2-report. The report entries become apple,t6041-pmp-v2-report-entry followed by the existing apple,t6000-pmp-v2-report-entry, so the entry compatible turns into a oneOf.

  • pmp-report: the T6041 offsets (requests at entry 480, acks at 488, fast-die effort at 600 with three lanes: E, P0 and P1).

    • The PMP counts as running while any bit of PMP-STATUS is set, as macOS tests it.
    • Nothing is written to a stopped PMP: requests are kept in memory and all written once it runs, as macOS replays already-on devices.
    • The display-gated start of a halted PMP is not used, because the T6040 PMP driver starts the PMP itself.
  • pmp:

    • check the version-5 uuid header at 0x204 before trusting the boot argument offset;
    • set the nine boot arguments macOS sets (BDID, DVID, DCAP, DCHD, PMC_, PMCX, CVAR, PMCV, PMCB);
    • 42-bit DMA mask.

    Also, for every SoC: a firmware property larger than the firmware's value buffer is now answered as missing, with a warning, instead of failing the message and leaving the firmware without a reply.

Already handled by integration, so dropped from our version: the opcode 0x36 → 0x37 confirmation, and bounds-checked byte access to the boot argument block (it lies at 0x86330 in a 0xe0000 SRAM and holds unaligned arguments).

Naming: the SoC blocks use apple,t6041-*, after the T6041 (M4 Max) die the M4 Pro is cut from. Apple's device tree on an M4 Pro names the SoC arm-io,t6041, and Yureka Lilian's acked t604x bindings (#372) already use t6041 for the blocks.

Hardware tested on: Apple MacBook Pro (16-inch, M4 Pro, 2024), J616s / T6040, macOS 26.x firmware, booted by our own loader with our private T6040 device tree.

How tested: Our daily kernel starts the PMP at every boot with this logic ("PMP started", then "PMP running (status 0x1), requests 0x3c00"). The CLPC and the fast-die thermal limit use the report.

Not tested / limits: This is a port onto integration's reworked PMP driver, and it was compile-checked only. In particular, integration's whole-block byte rewrite of the boot arguments has not run on a T6040; our daily tree writes only the patched arguments. The KUnit suites were built but not run.

Conflicts: small, with #366 (T8132), which adds an entry in the same places: the apple,pmp.yaml compatible enum and the pmp-report offset table and match list. The other side is a one-line fix, whichever lands first.

Base: integration/aurora (44d5afc). Built and checked there: aurora's defconfig, W=1 on pmp.o and pmp-report.o at every commit, checkpatch --strict, and dt_binding_check with dtschema 2026.9. Hardware testing was done on our daily tree, which is based on aurora-wip (Linux 7.1.12).

🤖 Generated with Claude Code

https://claude.ai/code/session_01K4TC3f2CpzFxhnEziL9wcg

Add the PMP of the T6040 (M4 Pro) and the properties its boot
arguments are set from: the DRAM channel mask and chip variant the
bootloader copies, and the SoC-level PMC values from the Apple device
tree. Each is optional; the firmware's default is 0.

The compatible uses t6041: the T6040 is cut from the T6041 die, and
both the Apple device tree and Yureka Lilian's t604x bindings name its
blocks t6041.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
The report aperture of the T6040 (M4 Pro) has its own entry offsets
and three fast-die lanes (E, P0 and P1), so it gets its own
compatible. Its entries fall back to the common
apple,t6000-pmp-v2-report-entry, which the driver already matches.

The compatibles use t6041: the T6040 is cut from the T6041 die, and
both the Apple device tree and Yureka Lilian's t604x bindings name its
blocks t6041.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
The T6040 (M4 Pro) report aperture holds PMP-STATUS at entry 1,
SOC-DEV-PS-REQ at entry 480, SOC-DEV-PS-ACK at entry 488 and the
fast-die effort at entry 600, with three lanes (E, P0 and P1). Reads
are 16 bytes per entry from the base of the region, writes 8 bytes per
entry from base + 0x10000.

Two behaviours differ from the other SoCs and are selected per SoC:

- The PMP runs while any bit of the 64-bit PMP-STATUS word is set, not
  only bit 0; macOS tests the whole word.
- Nothing is written to a stopped PMP: its PMP-STATUS and every report
  entry read 0 until it runs. Power state requests are kept in memory,
  and once the PMP reports running every request made so far is
  written at once, as macOS replays each PMP-notified device that is
  already on. A delayed work polls PMP-STATUS every 100 ms for 30 s,
  then every second.

The T6040 PMP driver starts the PMP itself when it probes, so this
report does not use the display-gated start of a halted PMP. The other
SoCs are unchanged.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
The T6040 (M4 Pro) PMP firmware starts like the earlier ones (RTKit
endpoint 0x20, CPU_RUN at ASC + 0x44 bit 4), with these differences:

- A "uuid" header (version 5) at 0x204 precedes the boot argument
  offset at 0x22c. Check it before trusting that offset on the T6040.
- macOS sets nine boot arguments. Besides BDID, DVID and DCAP, set
  DCHD, PMC_, PMCX and CVAR from optional properties, and PMCV and
  PMCB from bits 0 and 3 of apple,pmc-pmgr. An absent property leaves
  the firmware's default of 0, which is also what macOS writes for an
  absent source.
- Its DART window starts at 1 TiB, so the device gets a 42-bit DMA
  mask as on the T8140.

The boot argument block lies at 0x86330 in an SRAM of 0xe0000 bytes
and holds unaligned arguments. That needs no change here: the block is
bounds-checked against the whole mapped resource and copied with byte
accesses only. The firmware's opcode 0x36 is already confirmed with
0x37.

A firmware property larger than the firmware's value buffer is now
answered as missing, with a warning, instead of failing the message,
which leaves the firmware without a reply.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
@RyanTheTide
RyanTheTide merged commit 94141d3 into aurora-silicon:integration/aurora Oct 23, 2026
@jgoyvaerts
jgoyvaerts deleted the m4pro/pmp-t6041 branch October 24, 2026 16:14
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