Repository navigation
Conversation
The M4 (T8132) SEP DART and SEP mailbox are the same parts as on T8122. Add apple,t8132-dart, with the apple,t8110-dart fallback, and apple,t8132-asc-mailbox, with the apple,asc-mailbox-v4 fallback. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Audrey Tang <au@civic.ai>
Describe the M4 SEP the way t8122.dtsi does: the SEP and its DART disabled, the DART carrying the SEP's own IOVA window from the J715 ADT (dart-sep vm-base-0 0x10000004000, vm-size-0 0xffff0000) with no offset, and the ASC mailbox inside the SEP wrapper at +0x8000. The ADT lists the mailbox interrupts as 390 389 392 391. In that order the recv-not-empty slot holds the line that is asserted while the receive FIFO is empty; the ASC v4 mailbox has no IRQ acknowledge, so starting the channel polls an empty FIFO in hard IRQ context and the machine freezes. Use 389 390 391 392, the order the T8122 SEP mailbox and the other T8132 ASC mailboxes use. No board adds the sep alias yet. With the alias, m1n1 hands the SEP its firmware region and manifests, but current m1n1 keeps a pointer from fdt_get_alias() across inserting memory-region, and on T8132 its SEP ROM random request leaves the running sepOS no longer reading its mailbox. Both are fixed in Kb2uka/Omarchy-M4-Native#168; the alias can follow once the bootloader carries them. Tested on a 15-inch M4 MacBook Air (J715) with equivalent nodes in the Omarchy M4 kit tree: the mailbox starts without freezing and the SEP answers. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Audrey Tang <au@civic.ai>
The 15-inch M4 MacBook Air (J715) hands over a running SEP (ADT sepfw-booted), like the M3 Air, so this is T8122's warm registration, shared-memory geometry, variant-5 key store and xART guard default. Its SEP DART window is the ADT's own, 0x100_0000_4000 + 0xffff0000, given as a range with no offset. This matches what t8132.dtsi carries, and unlike the BIT(40) offset window it also reaches the SEP on kernels whose DART driver does not apply apple,dma-offset. The Mesa sensor is on spi2 at 0x3ad108000; its identity is unchecked, so capture stays unqualified. Only J715 selects the profile. Tested on a J715 (macOS 27.0.1) with an earlier port of this driver on the Omarchy M4 kit kernel (7.1.9), the DART window set the same way and the m1n1 fixes from Kb2uka/Omarchy-M4-Native#168: the SEP attaches with 12 endpoints, the identity keybag is provisioned, a P-256 key held by the SEP signs through OpenSSH, and the same key signs after a reboot with the driver loaded at boot. With the 0..4 GiB offset window on that kernel the SEP never answered. Not tested: this tree on hardware, the xART guard on J715 (the tested Mac provisioned before the guard existed), and Touch ID. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Audrey Tang <au@civic.ai>
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
load_sensor_root_key returned without sensor_step_failed when the container length was rejected, so an empty msrk-j700.bin lost the SENSOR_ROOT_KEY step failure it reported before the profile rework. Report it again for every rejected length. Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The 13-inch M4 MacBook Air (J713) describes the same SEP and sensor wiring as J715 in its ADT: sepfw-booted, the same dart-sep window, and a Mesa sensor on spi2 at 0x3ad108000. Its sensor session uses the same nonce authentication, and SESSION_SHARE answers 0x16 until the machine's own FDR MSRk body is loaded. Add T8132_J713, the J715 profile with SensorRootKey::J713. It names apple/msrk-j713.bin and follows J715's 10,848-byte rule and its single retry after status 0x16. The sensor description records what J713 reads back: ID 0x3356 in mode 2. Select it only on apple,j713. Tested on one J713 with this profile ported to the Omarchy M4 kit kernel 7.1.9 and the default xart_guard of 1. The first SESSION_SHARE returned 0x16, msrk-j713 was loaded and the retry was accepted. One finger was enrolled and matched, and another finger was rejected. After a cold boot the enrolment was restored from the Catacomb files and matched again. The guard refused no write. The identity keybag was created before this run by a development build with the guard off; j713-touchid.rst explains why. KUnit ran on the same J713 at insmod, with this tree's apple_sep suites built into that port and kunit.enable=1: all 11 suites passed, 124 cases including the three J713 ones, with no failures or skips. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: MuBai-He <51275418+MuBai-He@users.noreply.github.com>
The M4 (T8132) SPI controllers are the T8103 block. Its spi2 carries the Touch ID sensor on the 13-inch MacBook Air (J713). Assisted-by: Claude:claude-opus-5-5 Signed-off-by: MuBai-He <51275418+MuBai-He@users.noreply.github.com>
Describe spi2 and its Mesa fingerprint sensor in t8132.dtsi, both disabled, as t8122.dtsi does. Enable them on J713 with the values from its ADT (/arm-io/spi2/mesa): power on NUB GPIO 28, active high, and 20 ns chip-select setup and hold. The sensor answers in mode 2, so the board sets spi-cpol. The data-ready line (AP GPIO 199) is left out, so the driver polls. The calibration file is named per board, as on J613. The controller runs from clkref, which divides to 8 MHz exactly. The hardware run used these properties, applied as an overlay on the Omarchy M4 kit's device tree, with clkref, AIC interrupt 1056 and ps_spi2. The kit kernel's spi-apple lacks hardware chip-select timing, so that run bound a copy of this tree's driver under a private compatible. The SEP nodes stay disabled and the sep alias is not set, as on J715. dtc 1.7.2 builds t8132-j713.dtb and t8132-j715.dtb without warnings. dt_binding_check was not run. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: MuBai-He <51275418+MuBai-He@users.noreply.github.com>
MuBai-He
requested review from
chriskearney,
maralcbr and
scottjones
as code owners
October 27, 2026 20:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the 13-inch M4 MacBook Air (J713) next to #200's J715:
T8132_J713, the J715 profile with J713's own FDR MSRk file,apple/msrk-j713.bin. It uses J715's rules: a 10,848-byte body, loaded only after SESSION_SHARE status0x16, and one retry. It is selected only onapple,j713. The sensor description says what J713 reads back: ID0x3356, mode 2. Adds three KUnit cases.apple,t8132-spi.spi-cpol, 20 ns chip-select timing andapple/mesacal-j713.bin.Documentation/input/devices/j713-touchid.rst.No
sbio.rschange was needed. On J713, a capture taken straight after calibration gets IMAGE_ASSESSMENT0x16. The sensor must be registered again first: power cycle, identity, CLEAR_STATE, serial and nonce, session, patch and params, without the root key or calibration. The existing flow already does that before every enrolment and match.How J713 differs from J715
0x1c.0x3356and mode 2 are descriptive; the driver does not branch on them. J715 keeps the values it inherits from T8122, because nothing here was measured on J715.Evidence
MacBook Air 13-inch M4 (J713). The gigalocker held 9 session records that Linux did not create. Test setup:
drivers/soc/apple:profile.rsis the same file plus one local helper.kernel::firmwaremaps to a local shim.sepalias.Results:
T8132/J713, 12 endpoints. The first SESSION_SHARE returned0x16. The driver loadedmsrk-j713.binand the retry was accepted.apple_sepsuites passed: 124 cases, including the three new J713 cases, with 0 failures and 0 skips. The kit kernel hasCONFIG_KUNIT=m, so the module was built with its suites enabled andkunitwas loaded withenable=1.t8132-j713.dtbandt8132-j715.dtbwith no warnings. The decompiled spi2 and sensor nodes match the live overlay property for property. The one difference is the controller compatible: the kit'sspi-applelacks hardware chip-select timing, so the run bound a copy of this tree's driver under a private compatible.Found while testing (existing code, not changed here)
When
APPLE_SEP_KUNIT_TESTis enabled,apple_sep_xart_guardcallsGuard::check()on its test guards. Each refusal in a test also callscrate::diag::xart_guard_refused(), which counts it in the driver's global refusal counter. After the suites run at insmod,diag/xart_guard_refusalsreads 13 anddiag/matchingreadsblocked. Meanwhilediag/touchidisready, matching works, and no enclave write was refused. All 13 refusal messages fall between the suite'sKTAP version 1line andok 1 apple_sep_xart_guard.A readiness check that trusts
diag/matchingwould turn Touch ID off on a kernel built with the tests. One possible fix is to skip the diag call underkernel::kunit::in_kunit_test(). That belongs in its own change, so it is not included here.Not tested
xart_guard=0. Under guard 2, the enclave's rewrite of the kind-2 shared root was refused. Under guard 1 it then rewrote a session record that predates Linux, which was also refused. integration/aurora has since added a first-setup window (1f45121, 5447fa2), which this branch does not include. A fresh J713 setup with the guard on has not been run.t8132-j713.dtb. The hardware run used the kit DTB plus an overlay.rustfmtanddt_binding_check, which were not available.detect()branch.Merge Danger
Door: two-way
Blast Radius: J713 only. The profile is selected only on
apple,j713, and J715 and the other profiles are unchanged. Int8132.dtsi, spi2 and the sensor are disabled; onlyt8132-j713.dtsenables them. On a J713 withoutapple_sep,spi-applebinds spi2 and the sensor node has no driver, as on J613. As on J715, the SEP nodes stay disabled and thesepalias is not set.Private data: none in the patches.
msrk-j713.binandmesacal-j713.binare per-machine files supplied at provisioning.Assisted-by: Claude:claude-opus-5-5