Skip to content

nvme: apple: add T6040 (M4 Pro) ANS2 support - #387

Merged
RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/nvme-t6040
Oct 23, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/nvme-t6040

Conversation

@jgoyvaerts

Copy link
Copy Markdown
Contributor

With the 26.x firmware, the T6040 (M4 Pro) ANS2 controller is the post-M4 (T8132) controller with two differences:

  • Its "nvme" register block ends at 0x10000. The linear submission queue doorbells (0x2490c, 0x24910) and LINEAR_SQ_CTRL (0x24908) are not in it; the doorbells are at the same offsets in the NVMMU block. With the T8132 setup, the doorbell writes went past the mapping and the first admin command never reached the controller.
  • The firmware enables the linear submission queues itself, so the driver leaves LINEAR_SQ_CTRL alone.

This PR adds:

  • Binding: apple,t6041-nvme-ans2, as its own compatible (it cannot fall back to t8132), with the separate NVMMU region and three power domains.
  • Driver: an lsq_in_nvmmu hardware flag and an entry for the new compatible that sets it. The entry uses the T8132 queue setup and depth 64, plus NVME_QUIRK_NO_APST, because APST has never been run on this controller.

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

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. It has run Linux 7.3.0-m4.3 daily since 2026-10-22.

How tested: the J616s runs from this controller every day; the root filesystem is on it.

Not tested / limits:

  • Our machine binds the controller through a private write-guard wrapper. The wrapper uses exactly this hardware description. It also takes over the ANS session our loader leaves running: our loader disables the controller but keeps RTKit live, which the plain driver's adoption check (controller left enabled and ready, as U-Boot leaves it) does not accept. The plain path, a U-Boot hand-over or a cold start, has not been booted on the T6040. The upstream form of our hand-over would be arm64: apple: add basic T8132/J713 (M4 MacBook Air) support #366's apple,rtkit-handoff extended to the T6040, as a follow-up.
  • APST stays disabled.

Relation to #366 (T8132): #366 changes the same driver for the T8132 (cold_reset, the apple,rtkit-handoff live session, BROKEN_FUA). Both the driver and the binding merge cleanly with #366. Once both are in:

Dependencies: none. A T6040 device tree also needs #372.

Credits: the doorbell location and leaving the linear-SQ enable to the firmware follow Yureka Lilian's adaptation of the Apple NVMe driver to the 26.x firmware. The separate NVMMU region this builds on is from her T8132 series (Link: in the commit, https://lore.kernel.org/r/[email protected]).

Base: integration/aurora (51cda52). Built and checked there: m4_defconfig, W=1 on nvme/host/apple.o (no warnings, same as the base), checkpatch --strict clean, and dt_binding_check of apple,nvme-ans.yaml with dtschema 2026.9.

🤖 Generated with Claude Code

The T6040 (M4 Pro) ANS2 controller has a separate NVMMU region like
T8132, and three power domains. It cannot fall back to
apple,t8132-nvme-ans2: its "nvme" register block is shorter and the
linear submission queue doorbells are in the NVMMU region, so it gets
its own compatible.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
The ANS2 controller of the T6040 (M4 Pro) with the 26.x firmware is
the post-M4 controller of T8132 with two differences:

- Its "nvme" register block ends at 0x10000. The linear submission
  queue doorbells (0x2490c, 0x24910) and LINEAR_SQ_CTRL (0x24908) are
  not in it; the doorbells are at the same offsets in the NVMMU block.
  With the T8132 setup the doorbell writes went past the mapping and
  the first admin command never reached the controller.
- The firmware enables the linear submission queues itself; the driver
  leaves LINEAR_SQ_CTRL alone.

Add an lsq_in_nvmmu hardware flag for this and an apple,t6041-nvme-ans2
entry that sets it, with the T8132 queue setup and depth. APST has
never been run on this controller (the machine has always booted with
it disabled), so the entry also sets NVME_QUIRK_NO_APST.

The doorbell location and leaving the linear SQ enable to the firmware
follow Yureka Lilian's adaptation of the Apple NVMe driver to the 26.x
firmware; the separate NVMMU region this builds on is from her T8132
series.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
RyanTheTide pushed a commit that referenced this pull request Oct 23, 2026
Add the ANS2 NVMe controller with its mailbox, SART and power domains.
The controller window, the ANS coprocessor and the separate NVMMU are
from the J616s ADT; the three power domains are the ANS and the two
APCIe system states, all on from boot.

Binding: apple,t6041-nvme-ans2 from #387 ("nvme: apple: add T6040 (M4
Pro) ANS2 support"), apple,t6041-sart from the first patch of this
series.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
@RyanTheTide
RyanTheTide merged commit 9546b26 into aurora-silicon:integration/aurora Oct 23, 2026
@jgoyvaerts
jgoyvaerts deleted the m4pro/nvme-t6040 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