Skip to content

soc: apple: sep: T8112 (MacBook Air M2) profile + J415 Mesa sensor — Touch ID enrol/verify/reboot-verify on J415 - #152

Merged
RyanTheTide merged 2 commits into
aurora-silicon:feat/sepfrom
ftechhelp:t8112-touchid
Oct 8, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:feat/sepfrom
ftechhelp:t8112-touchid

Conversation

@ftechhelp

Copy link
Copy Markdown
Contributor

Adds T8112 (MacBook Air M2) to the SEP driver. Tested end to end on a J415 (MacBook Air 15", M2, 2023): enrol passes, verify passes, verify passes again after a reboot, and Touch ID works for sudo and the Omarchy lock screen.

As far as I can tell from the omacom/linux-aurora#7 thread, nobody had a T8112 profile yet (@GonzFC offered a J413 for this on Sep 29). These are the J415 results.

Commits

  1. soc: apple: sep: add a T8112 (MacBook Air M2) platform profile: a warm-registration profile with 0x40000/CINP shared memory, the Variant5 key store and the T6020 keybag encoding.
  2. arm64: dts: apple: t8112-j415: enable the SEP and the Mesa fingerprint sensor:
    • t8112.dtsi: mesa: fingerprint@0 under spi2, and sep_dart disabled at boot (as on t602x)
    • t8112-j415.dts: the sep alias and the sensor wiring

Values (from the J415 ADT, read from the stub's Preboot DeviceTree.j415ap.im4p)

spi2 0x235108000, IRQ 750, pads 64–66 func 1, native CS (iBoot leaves them muxed)
Mesa power AP GPIO 178, active high (function-mesa_pwr); a driven-high output at handoff
Mesa data-ready AP GPIO 177, flags 3 (not wired in this PR; the driver polls)
SPI 8 MHz, CS 0, mode 1 (spi-cpha)
SEP 0x25e400000/0x6c000, 0x25e050000/0x60000, no power gates
SEP DART vm-base 0x4000, vm-size 0xffff0000 (below 4 GiB, so no wide DMA mask)
/defaults cpx-encryption-mode = 2

These match the J413 values @iconidentify posted, so J413 should only need the board-file part.

Why Variant5 and not the 13.5 dialect

On the first write boot, J415 accepted the 13.5 GET_CAPABILITIES (capability word 2, IPC header v2) and SET_ENV init. It then refused the strict CREATE_KEYBAG (T8103 encoding 2/0x400000/-1) with mailbox status −1 and an empty reply, the same thing the J700 profile comment describes. The refusal is marked retryable and nothing was written. With KeyStore::Variant5 and the 5/0/-1 encoding, the keybag provisioned and loaded on the next boot, the ref-key was created, and the loader's trusted-key seal/unseal round trip passed.

Test log (J415, sepOS from system firmware mBoot-18000.161.10, OS firmware 13.5 stub)

Read-only (xart_writes=0), 3 cold boots, identical results:

  • SEP platform profile: T8112/J415
  • DART changeset applied
  • warm attach: 7 → 12 endpoints (0x12 key store, sbio, scrd, sse, skdl…)
  • hwrng registered
  • xART APFS-resolved, 170 slots, 11 live records, 0 malformed
  • opening /dev/sep-bio: sensor bound in mode 1 with hardware CS timing and power from the node; sbio: native 13.5 communication initialization accepted

The raw iBootSystemContainer was byte-identical (sha256) before and after all three boots.

Writes on:

sks: identity keybag provisioned
sks: ref-key create mailbox status 0, response 344 bytes
trusted-keys: sealed 32-byte key into 113-byte enclave blob
trusted-keys: unsealed 113-byte enclave blob to 32-byte key
enrol: opt-in completed user catacomb state Some(7)
enrol: post-user master catacomb state Some(7)
  • fprintd: enroll-completed, then verify-match, then verify-match after a reboot
  • catacombs 300 / 120 / 11460 bytes
  • xART still 11 live records, all CRC-valid

Build and boot setup used

  • Kernel: AsahiLinux asahi-7.1.13-3 with the stock linux-asahi config plus APPLE_SEP=m and TRUSTED_KEYS=y, and the soc: apple: add Apple SEP driver omacom/linux-aurora#7 series. Built with gcc 16.1.1, rustc 1.93.1 and bindgen 0.73.2.
  • m1n1 v1.6.1 with aurora-silicon/m1n1 e057cd2596 (no SEP RNG on M2+) and c6498e6e1a (apfs-preboot-uuid), plus a patch making dt_set_sep() non-fatal (separate PR to aurora-silicon/m1n1).
  • On this machine the DT nodes were applied as an overlay with spi2 and the sensor disabled, and the driver enabled them at load. The board file here enables them at boot, like j414c; that exact path wasn't booted on J415.

Notes

  • tools/aurora-sep/load-driver passes xart_writes=1 provision_keybag=1 on the modprobe command line. The Rust module parameters are SetOnce, so with options also in /etc/modprobe.d/ (for example the installer's --read-only file) the second set fails: `1' invalid for parameter `xart_writes', and the module doesn't load. It bit me on the first write boot.
  • The SPI mode isn't independently confirmed by a logged sensor ID, but enrol and match work in mode 1.
  • Not tested: suspend/resume with a capture pending, the data-ready IRQ, and J413.

🤖 Generated with Claude Code

ftechhelp and others added 2 commits October 1, 2026 19:06
T8112 is a warm-registration platform: iBoot hands over a running SEP
and a powered Mesa sensor (J415: AP GPIO 178 is a driven-high output at
handoff). The values come from the J415 ADT (/arm-io/spi2/mesa and
/arm-io/sep): spi2 at the T8103 address, power on AP GPIO 178,
data-ready on 177, 8 MHz, chip select 0, a SEP DART aperture of
0x4000 + 0xffff0000 (below 4 GiB, so no wide DMA mask) and
/defaults cpx-encryption-mode = 2. They match the J413 values posted in
the omacom/linux-aurora#7 thread.

The shared memory follows the other warm platforms (0x40000, CINP). The
key store speaks Variant5: J415 accepted the 13.5 GET_CAPABILITIES and
SET_ENV init but refused the strict CREATE_KEYBAG (mailbox status -1,
empty reply), as J700 did, and provisioned with the T6020 encoding.

Tested on J415 (MacBook Air 15", M2) with the patched m1n1 (no SEP RNG
query on M2, apfs-preboot-uuid forwarded):
- read-only (xart_writes=0): warm attach, all 12 endpoints including
  key store 0x12, sbio, scrd and hwrng, on 3 cold boots; the iBoot
  system container image was byte-identical afterwards
- writes on: identity keybag and ref-key provisioned, trusted-key
  seal/unseal round trip passed, fprintd enrol completed (user and
  master catacombs at state 7), verify-match in the same boot and again
  after a reboot

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t sensor

Add the Mesa sensor under spi2 in t8112.dtsi, and keep the SEP DART off
at boot. iBoot hands over a running SEP, and apple_sep sets the DMA range
and enables the DART itself, as on t602x. Probing it at boot leaves it
configured without the range, and the driver then refuses to attach.

Wire the sensor on J415 from its ADT: power on AP GPIO 178, active high,
8 MHz, chip select 0, SPI mode 1. The data-ready line (GPIO 177) is left
out, so the driver polls. The sep alias lets m1n1 hand over the
local-policy and iBoot manifests that the warm registration needs.

Tested on J415 with the same nodes applied as an overlay to the running
device tree (sensor bound in mode 1 with hardware CS timing, enrol and
verify passed); these board-file nodes enable spi2 and the sensor at
boot, as j414c does, instead of on module load.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
chriskearney added a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
Kernel 7.1.12.aurora2-11.20 from custom/sep 77542ad: aurora-wip
through 3bb0a61 (Neo AVD, PCIe and radios, inert on other Macs),
Touch ID on the MacBook Air M2 15" (aurora-silicon/linux#152), a retry
from a fresh sensor registration after a failed first patch, battery
time estimates that read ENODATA (#53) and the Omarchy boot logo.
libfprint, aurora-touchid and m1n1-aurora 1.6.1.aurora3 are unchanged.

Boot-tested in maclab (m1air, job j1002-001901-82b2): Wi-Fi, PCIe,
AVD, Touch ID attach, ENODATA on a full battery; omarchy-m-test shows
no regressions against 11.19.

Signed-off-by: Chris Kearney <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
@chriskearney

Copy link
Copy Markdown
Contributor

Thanks @ftechhelp, the J415 results are great. Both commits are now in #69 (head 2a4f488f7df6), the consolidated SEP PR, with your authorship. They also ship in the aurora-sep 11.20 test release, so M2 Air 15" testers on omacom/linux-aurora#7 get Touch ID from the one-liner. Its m1n1 already carries the warm-registration guard and preboot-UUID forwarding that you tested with. Your aurora-silicon/m1n1#9 is in our next m1n1 build, which still needs a supervised boot before it ships.

chriskearney pushed a commit to chriskearney/aurora-linux that referenced this pull request Oct 2, 2026
…t sensor

Mirror t8112-j415, using ftechhelp's J415 block from
commit 2a4f488 ("arm64: dts: apple: t8112-j415: enable the SEP
and the Mesa fingerprint sensor"), aurora-silicon/linux#152. Add the
sep alias so m1n1 hands over the local-policy and iBoot manifests the
warm registration needs. Enable spi2 and the Mesa sensor: power on AP
GPIO 178, active high, with 20 ns chip-select setup and hold.
t8112.dtsi already supplies 8 MHz, chip select 0 and SPI mode 1. As
on J415, the data-ready line (GPIO 177) is left out, so the driver
polls. The calibration file is apple/mesacal-j413.bin.

The J413 platform device tree describes the sensor as J415's does:
power 178, data-ready 177, 8 MHz, chip select 0. That matches what
drivers/soc/apple/profile.rs records for T8112. As on J415, the SEP
node and its DART stay disabled in the device tree. iBoot hands over a
running SEP, and apple_sep enables both at module load after setting
the DART's DMA range.

The compiled j413 tree differs from before only by the sep alias, the
spi2 and mesa status, and the mesa properties above. Its spi2, mesa and
SEP nodes, with every node those reference, match t8112-j415 apart
from firmware-name.

Untested: no J413 has booted this.

Signed-off-by: Chris Kearney <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FwdG63dRaMrRbYrUBkSa1i
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
soc: apple: sep: T8112 (MacBook Air M2) profile + J415 Mesa sensor — Touch ID enrol/verify/reboot-verify on J415

Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes.

Contributor credit; Signed-off-by outstanding:
- 2c0b8da: Vincent Fontaine <[email protected]>
- 4b62516: Vincent Fontaine <[email protected]>
- 74f6fe4: Dj <[email protected]>
- 98b25c2: Chris Kearney <[email protected]>
- 472f693: Dj <[email protected]>
- 3594d18: DjDeveloperr <[email protected]>
- 09afcd7: DjDeveloperr <[email protected]>
- 9b7d20d: DjDeveloperr <[email protected]>
- 434c25f: Chris Kearney <[email protected]>
- ae1623d: Chris Kearney <[email protected]>
- c91dc90: Chris Kearney <[email protected]>
- 53dd438: Chris Kearney <[email protected]>
- d23d912: Chris Kearney <[email protected]>
- 8e64175: DjDeveloperr <[email protected]>
- b5eae37: Dj <[email protected]>
- 0930367: Chris Kearney <[email protected]>
- d3f7a79: DjDeveloperr <[email protected]>
- 36bd668: DjDeveloperr <[email protected]>
- cdacd96: DjDeveloperr <[email protected]>
- 7ec99a1: DjDeveloperr <[email protected]>
- 9dc394c: DjDeveloperr <[email protected]>
- d1cf00e: Ryan Murray <[email protected]>
- 996593d: Ryan Murray <[email protected]>
- a471eb3: Ryan Murray <[email protected]>
- 70f4f6d: Ryan Murray <[email protected]>
Ryan integrates these contributions under DCO (b); no author signature is forged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide added a commit that referenced this pull request Oct 8, 2026
Retain the shared key-store profiles, persistence fields, suspend capture
handling and module declarations when adding J700 nonce authentication.
Choose the existing communication initialization word for each protocol
and keep the qualified older-platform sensor-registration path alongside
the authenticated J700 path.

The composition uses the public SEP work in pull requests #42, #69,
#152 and #202 and their reviewed repairs. Contributor credit includes
Chris Kearney, DjDeveloperr, Vincent Fontaine and Ryan Murray. Ryan
integrates the existing contributions under DCO (b); original commits
and author sign-offs are unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit 120e030 into aurora-silicon:feat/sep Oct 8, 2026
DjDeveloperr pushed a commit that referenced this pull request Oct 16, 2026
Retain the shared key-store profiles, persistence fields, suspend capture
handling and module declarations when adding J700 nonce authentication.
Choose the existing communication initialization word for each protocol
and keep the qualified older-platform sensor-registration path alongside
the authenticated J700 path.

The composition uses the public SEP work in pull requests #42, #69,
#152 and #202 and their reviewed repairs. Contributor credit includes
Chris Kearney, DjDeveloperr, Vincent Fontaine and Ryan Murray. Ryan
integrates the existing contributions under DCO (b); original commits
and author sign-offs are unchanged.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@koxu1996

Copy link
Copy Markdown
Contributor

J413 (MacBook Air 13" M2): Touch ID works — enrol, verify, PAM, and after reboot

Following up on #152, which validated the T8112 profile on J415 and left J413 untested. Here is a J413 data point.

Machine and stack

  • MacBook Air 13" M2 (2022), Mac14,2, board J413AP, SoC T8112; macOS 26.5.2 on the same disk (Asahi stub volume)
  • NixOS on nixos-apple-silicon's Asahi kernel config, with the source swapped for feat/sep at 120e030e (Asahi 7.1.9); APPLE_SEP=m, SPI_APPLE=m, HW_RANDOM, TRUSTED_KEYS, OF_OVERLAY
  • m1n1 2.0.0 with sep: preserve iBoot warm registration and forward preboot UUID from ADT m1n1#3 rebased on top (no SEP RNG query on M2+, apfs-preboot-uuid forwarded)
  • libfprint 1.94.100 with the aurora driver; fprintd stock
  • Loader/readiness services adapted from nixos-aurora (not verbatim)

Sensor and DT

Mesa on spi2, sensor id 0x3352, patch version 22. Checked against this Mac's own Apple device tree from macOS, every value the J413 DT hard-codes matches: SEP mailbox 0x25e400000/0x6c000, SEP DART 0x25d2c0000, warm handoff (sepfw-booted=1), spi2 @ 0x235108000 native CS0, 8 MHz, 20 ns CS setup/hold, power GPIO 178 active-high, data-ready GPIO 177 (polled). SPI mode 1 is correct for J413: from disassembling AppleSPIMC, only bit 0 of the "clock phase" byte is used, as CPHA, with CPOL 0.

Results

Read-only boot (xart_writes=0):

  • SEP endpoints up to 0x12 (key store), DART changeset applied, hwrng registered
  • apple-mesa spi1.0: sep sensor: bound, 8000000 Hz, mode 1 (CPOL=0 CPHA=1)
  • Calibration extracted from the iBootSystemContainer, byte-identical to the blob macOS uses (sha256 1ddb22a7…79b1ff, 64052 B)
  • xART: 170 slots, 12 live records, max revision 3231, 0 malformed, 0 duplicate, 0 repaired

With xart_writes=1 provision_keybag=1:

  • sks: identity keybag provisioned, ref-key created, trusted key sealed and unsealed through the SEP
  • fprintd-enroll: 10 stages passed, then completed (enrol: opt-in completed user catacomb state Some(7))
  • fprintd-verify: verify-match; sudo through pam_fprintd accepts the finger
  • After a reboot: restore master/owner/user catacomb … Restored, identity count 1, and fprintd-verify matches again

The OS UUID is pinned with apple_sep.os_uuid_hi/lo (set to the apfs-preboot-uuid m1n1 forwards), and the driver logs using explicit OS UUID ….

Issues hit along the way

  1. trusted-keys: registration failed (EBUSY) with the stock Asahi config. That config has CONFIG_TRUSTED_KEYS_TPM=y and CONFIG_TRUSTED_KEYS_TEE=y. init_trusted() binds a built-in source at boot, so when apple_sep loads later, register_trusted_key_source() returns -EBUSY and the keybag seal/unseal cannot work. Workaround: trusted.source=applesep on the kernel command line, after which the log shows source 'applesep' registered and everything above works. Worth documenting, or handling in Kconfig/defconfig guidance, since anyone on the default Asahi config will hit it.
  2. Readiness timing (possibly our adaptation of the nixos-aurora loader): on some boots the loader logs trusted keys are ready; no biometric device is present just before /dev/sep-bio appears, so the readiness unit is skipped. fprintd still brings the sensor up on first open, so it is cosmetic for us.
  3. Minor: the log says SEP platform profile: T8112/J415 on this J413. If the profile is per-SoC this is just naming, but worth confirming.

Not tested yet

  • Suspend/resume with a capture in flight
  • The GPIO 177 data-ready IRQ (still polled, as in the upstream DT)

Thanks for the driver — the J413 profile works as-is.

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.

4 participants