Skip to content

SEP: rebase feat/sep-neo onto aurora-wip and enable it on the J700 - #42

Merged
RyanTheTide merged 51 commits into
aurora-wipfrom
feat/sep-neo-rebase
Oct 8, 2026
Merged

RyanTheTide merged 51 commits into
aurora-wipfrom
feat/sep-neo-rebase

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

This is feat/sep-neo (DjDeveloperr, Ryan, Chromatischer; 35 commits) rebased onto aurora-wip, plus eight commits that make it build from the stock config and run on the MacBook Neo (J700). feat/sep-neo itself is untouched, because replacing it needs a force push.

Rebase

feat/sep-neo sat 724 commits behind. Three conflicts:

  • nvme/host/apple.c: kept both aurora-wip's error labels and refcount and the series' inline-crypto profile.
  • apple,dart.yaml: kept aurora-wip's apple,dma-range, whose bytes are identical to the series' version.
  • A J414 alias.

Every SEP-only file is byte-identical to feat/sep-neo.

Added

  • Trusted keys in asahi.config, with the TPM and TEE sources off. The TEE source's init succeeds without a TEE and claims the trusted key type, so the SEP's registration returned EBUSY and the key store never came up.
  • Kconfig: depend on PM and RUST_APPLE_MAILBOX, and select the firmware-loader abstractions.
  • t8140-spi binding entry.
  • SMC phandle for the Touch ID sensor, in the binding and the driver. The driver searched for the generic apple,smc compatible, which the SMC binding forbids for T8140, so the sensor deferred forever.
  • T8140 device tree: SEP, SEP DART, SEP mailbox, SPI2, and the four power domains they need (from the J700 ADT).
  • J700 device tree: SEP enabled, sep alias, and the Touch ID node with SMC-switched rails.
  • SEP binding (apple,sep had none).

Tested on the J700

  • The SEP boots.
  • xART resolved through APFS: 170 slots, 12 live records.
  • Trusted keys register and seal/unseal.
  • The key store loads its keybag.
  • The hwrng is active.
  • The Touch ID sensor binds and is powered through the SMC phandle.
  • The three enrolled identities restore from their stored records.
  • Build, checkpatch --strict, dt_binding_check and dtbs_check are clean for the new parts.

Not working yet: Touch ID matching on the J700

The driver reports "cold-match preparation … did not complete". The J700 session steps are sensor nonce registration, the MSRk image, platform serial, INIT_COMM, registration order and the calibration header. They are not part of this series.

For the authors

  • The driver enables DT nodes and injects DART properties through of_changeset at load, and writes apple,sep-shmem-registered-iova into the live tree. Upstream would object to both. With complete static DT, as on T8140 now, those paths do nothing.

🤖 Generated with Claude Code

DjDeveloperr and others added 30 commits September 27, 2026 00:53
Add a Rust driver for the Apple SEP (Secure Enclave Processor) on Apple
silicon Macs, built as the CONFIG_APPLE_SEP module apple-sep. It attaches
to a running SEP over the AP mailbox, drives the Touch ID fingerprint
sensor, and exposes the enclave's key services to Linux.

The driver is organised by SEP endpoint:
  - sep.rs      transport, endpoint bring-up, mailbox and probe (crate root)
  - sbio.rs     Touch ID: enrol, verify and match over /dev/sep-bio
  - sks.rs      the key store: key-bag recovery and lock state
  - refkey.rs   machine ref-key sealing, signing and attestation
  - fv.rs       the device-bound FileVault key hierarchy
  - proto.rs    the SEP wire protocol

Touch ID enrol and verify are exposed through a /dev/sep-bio character
device; the enclave matches and no biometric image ever crosses to
userspace. A SEP-backed trusted key source lets keyctl seal keys to the
enclave, which needs the trusted-keys core change included here to
register a runtime trusted-key source.

The C shims bridge kernel interfaces whose ABI is awkward to restate in
Rust (struct hwrng, the file and crypto APIs, the trusted-key framework);
no protocol logic lives in them.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
Serve SEP anti-replay records from the existing device-wide xART extent
instead of a Linux-private seeded store. Validate the entire slot grid and
both root records before SEP registration, preserve the store's
copy-on-write ordering, and require both an explicit module parameter and
a writable block mapping before any write. Keep Linux-only biometric
metadata in a separate namespaced host store.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
Unwrap a FileVault volume's key through the enclave and load the volume's
class keys into the enclave's volatile state, then drive the storage
controller's inline AES-XTS with the wrapped key so an encrypted APFS
volume is read and written with no plaintext key material on the
application processor. The volume and key-bag records come from plaintext
APFS metadata; only wrapped keys cross to the enclave.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
The match check was stricter than the enclave requires and rejected valid
results. Accept a match when the stored identity's user id matches.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
The driver opened its backing-store files with the credentials of the task
that triggered the access. A keyctl(2) call from an unprivileged process
reaches key unsealing in that process's context, which then could not read
the driver's own root-owned 0600 key-bag file, so unsealing failed with
-74. Open the stores under kernel credentials from the initial namespace
so access never depends on the calling task.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
The biometric character device was exposed before the shared anti-replay
store and the key store had come up, so an early open could race enclave
setup. Publish /dev/sep-bio only once shared-xART and the key store are
ready.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
Reference-count the enclave class keys a FileVault volume loads. Repeated
mounts of volumes that share a key bag now load the class keys once, and
the volatile keys are unloaded from the enclave only when the last volume
using them is released. Key material stays resident no longer than a
mounted volume needs it, and keys another mount still depends on are not
unloaded early.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
Remove counters and fields that nothing reads. No functional change.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
Concurrent key-store (SKS) out-of-line exchanges could interleave their
mailbox traffic and out-of-line buffer registrations and wedge the
endpoint when fingerprint matching and a FileVault mount ran at once. Hold
a mutex across each complete SKS exchange so only one is in flight at a
time.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
When the sensor node carries no power GPIO the shim fell back to a fixed
pinctrl node and line number specific to j414s. That fallback is
machine-blind: on a sibling board whose sensor sits on a different line it
would drive the wrong line. Take the fallback only on j414s; every other
machine must describe the power GPIO in its device-tree node.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
Sensor bring-up located its SPI controller by a fixed address and so only
found the bus on j414s. Look up the apple,mesa-fingerprint node wherever
the device tree describes it and enable that node and its parent
controller directly, taking the power and interrupt GPIOs from the node.
Any machine that describes the sensor in its device tree can then bring it
up. When no such node exists the driver still creates one at the caller's
fixed controller address, so j414s is unchanged.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
The match path rejected any sensor whose reported identifier was not
0x3352, the revision fitted up to M4. Newer machines ship a 0x335e part
that is identical over the wire. Accept both revisions so matching is not
refused on those machines.

Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Signed-off-by: Diljit Singh <[email protected]>
The MacBook Air (M2) and MacBook Pro 13" (M2) carry the Mesa fingerprint
sensor on spi2, chip-select 0, like every other Apple laptop. t8112 only
described spi1, spi3 and spi4, so the Apple SEP driver had no controller to
bring the sensor up on these machines.

Add the spi2 controller node, mirroring the sibling spi1/spi3 controllers
(reg base + 0x8000, AIC IRQ 750, ps_spi2 power domain), and the spi2_pins
pinmux group. The pad numbers (64-67: SDI, SDO, SCK and the hardware chip
select) were read back from the live AP pinctrl on a J415 and cross-checked
against the T8112 ADT, where spi2 sits between spi1's CS pad 49 and spi3's
CS pad 96. The node stays disabled; the SEP driver enables it when it brings
up the sensor.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Add a binding for the Mesa fingerprint sensor on the SPI2 bus of Apple
laptops, driven by the Secure Enclave through a /dev/sep-bio character
device. The sensor uses the SPI controller's native chip select; a board
describes its power line (enable-gpios), an optional data-ready line
(interrupts), and the per-device calibration firmware name.

Also document the apple,dma-range DART property, used to place the SEP
firmware mapping on the M1 boot path.

Signed-off-by: Chromatischer <[email protected]>
[dj: adapted for aurora feat/sep, clean-room]
Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Describe the SPI2 controller and the Mesa fingerprint sensor on T8103, and
enable them on the MacBook Air (M1, J313).

The controller sits at the SPI cluster base + 0x8000 (reg 0x235108000, AIC
IRQ 616, ps_spi2 power domain), mirroring the sibling SPI nodes. Its pin
group is the three signal pads (128 CLK, 129 MOSI, 130 MISO), read back from
live hardware as peripheral function 1; SPI2 has no chip-select pad and uses
the controller's native chip select. The sensor's power line is GPIO 108
(active high); the data-ready line is left out because the driver polls.

Signed-off-by: Chromatischer <[email protected]>
[dj: adapted for aurora feat/sep, clean-room]
Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Name every SoC-specific fact the driver needs — the shared-memory capacity
and first-item fourcc, the boot handshake, the OS-identity source and the
sensor transport — in one typed profile, and refuse an unsupported SoC rather
than run a handshake with the wrong geometry.

Two targets are modelled: T8103/J313 (M1) boots the SEP with the boot endpoint
handshake over a 0x30000 window whose first item is CNIP; T6020/J414s (M2 Pro)
does the warm registration over a 0x40000 window whose first item is CINP. The
shared-memory build takes the capacity and first-item spelling from the
profile; T6020's values are unchanged.

Signed-off-by: Chromatischer <[email protected]>
[dj: adapted for aurora feat/sep - dropped the storage-backend enum (single
 in-kernel owner), identity is /chosen only, kept the driver modular; clean-room]
Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
The T8103 SEP is not brought up by the warm registration message. On that
target, send TZ0 on the boot endpoint and let its acknowledgements drive the
handoff: map the firmware reserved region, submit the firmware address (IMG4)
and the shared-memory table (SET_SHMEM), and mark the registration complete on
the IMG4 acknowledgement. The warm target keeps the single registration
message; the profile selects which path runs, and only the warm target enables
the SEP and its DART with a runtime changeset - the cold-boot target's DART is
already enabled before probe and is described statically.

The firmware mapping is created once and released exactly once in remove(),
gated on the teardown flag so a boot message racing removal cannot map firmware
or hand memory to the peer after teardown.

Signed-off-by: Chromatischer <[email protected]>
[dj: ported onto aurora feat/sep - reused the existing teardown flag and warm
 attach path, profile-gated the runtime DT enable, clean-room]
Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
The Mesa calibration blob is per-device factory data, so its name is board
data, not a build constant. Read it from the sensor node's firmware-name
property, falling back to the built-in default when the property is absent so
the runtime-fabricated node keeps working.

Signed-off-by: Chromatischer <[email protected]>
[dj: kept the default fallback so the fabricated j414s node still loads; clean-room]
Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Log once when the key-store endpoint (0x12) comes up and its out-of-line
buffers are registered, and enrich the "not advertised" diagnostic to show
how far the endpoint ladder reached: the live endpoint count and which of
control/xarm/sbio/scrd are present. An incomplete xART bring-up is then
diagnosable from dmesg alone, without instrumenting the driver.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
The identity keybag CREATE_KEYBAG request carries the bag type in a word
the strict T8103 enclave reads as the type and the lenient T6020 enclave
does not. T6020 takes the variant in the first word (the proven
encoding, hardware-verified for enrol, match and reboot); T8103 rejects
that and wants the type in the third word, as macOS sends it. Carry the
three field values in the platform profile so each SoC sends what its
enclave requires, leaving the T6020 wire encoding byte-for-byte
unchanged. Drop the now-unused variant constant, create-flags helper and
first-identity handle.

Verified on j414s (T6020): the identity keybag still provisions.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
Add an in-kernel path that opens the iBoot system container directly and
serves the STORE_SIZE gigalocker window at a configured sector, so the
driver reaches the shared anti-replay store on its own.

It is additive and fail-closed: the xart_start_sector module parameter
selects the raw extent, the logical store is always exactly STORE_SIZE so a
larger backing device serves only its extent, and a wrong window still fails
the existing root-record check rather than feeding SEP an unrelated store.

Verified on j414s: with xart_start_sector at the gigalocker's first sector
the store opens with the expected slot count, record count and revision, and
the key store comes up.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
Drop the last manual step from the in-kernel raw-extent owner: instead of a
hand-supplied start sector, the driver finds the gigalocker itself. It reads
the iBoot system container sequentially and searches, at block-aligned
offsets, for a root record's signature (a 1 or 2 key kind with an all-zero
UUID, the shape of Key::root).

A root signature alone does not pin the base. A window shifted a few slots
off the true origin still keeps both root records inside its 6 MiB extent, so
it passes the two-root test yet silently drops the live records that fall
outside the shift -- and, with writes on, would repair (write) at that wrong
origin. The driver therefore probes every candidate base a hit implies
read-only: through a writable handle, because the block layer only grants a
read-only handle to a read-only device and the container is writable, but
with repair disarmed so nothing is written at an unconfirmed origin. It then
pins the base that recovers the most live records. Only the true origin
captures the whole record set, and container noise never forges a CRC-valid
record, so max live records -- ties broken to fewer malformed, then the
higher base -- is exact. Only the pinned base is re-opened writable, so
repair runs at the confirmed origin alone.

open_based gains open_based_ext, which decouples the block-handle writability
from whether repair is armed, so discovery of the writable container never
mutates it. With automatic location in place, xart_start_sector becomes an
explicit override (default 0 = automatic) and the driver has no external
dependency for reaching the store.

Boot-verified on j414s (T6020): the scan pins the true base 0x4d4000, reads
all 10 live records with 0 malformed and 0 repaired (no errant write), and
the key store (EP 0x12) reaches 12 endpoints.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
The SEP endpoint ladder climbs 7 -> 11 (sbio, scrd) -> 12 (the key store,
EP 0x12). tick_exchange declared the persistent-state exchange done as soon
as the endpoint count passed a hardcoded pre-exchange baseline (7), but the
SEP advertises the key store a beat after it falls briefly quiet following
scrd. On some boots the driver therefore reached run_bringup at 11
endpoints, found EP 0x12 absent, and stranded the boot with no key store --
enable_sks fails with no retry, so keybag and ref-key operations (and thus
Touch ID) are unavailable for the whole boot.

Wait through quiescence until the key store itself is advertised, bounded by
the same EXCHANGE_TIMEOUT_MS. A boot that already has it exits immediately,
so healthy boots are unaffected; the hardcoded endpoint count, which is not
portable across SoCs, is dropped in favour of the endpoint that actually
matters.

Boot-verified on j414s (T6020): the key store (EP 0x12) came up at 12
endpoints on 5 of 5 reboots, up from roughly 2 in 3 before the change.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
The capture loop polled the sensor's status over SPI every 2 ms to spot a
ready frame. Add an opt-in data-ready interrupt (capture_irq=1; default 0
keeps polling) that wakes the loop the instant the sensor asserts its
data-ready line. The SPI status read still gates every frame, so a missed or
spurious interrupt costs at most one poll interval and the poll path is
untouched when the option is off.

The interrupt is configured once, while the sensor is patched and idle -- the
only safe moment, since reconfiguring the line mid-capture is what drops the
sensor's firmware patch -- and then left alone for the driver's life. On
j414s it is the pin adjacent to the power line (GPIO 121 -> IRQ 144); other
boards describe it as the SPI node's interrupt. It is edge-triggered on both
edges: the line idles low, so a level trigger would storm.

Boot-verified on j414s (T6020): with capture_irq=1 the data-ready IRQ 144 is
configured, fingerprint verify captures and matches through the interrupt,
the IRQ fires a handful of times per touch (not a level storm), and the
sensor keeps its firmware patch (no STATE_NEEDS_PATCH).

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
An enrol capture the enclave rejects (partial or unusable contact) silently
looped for another frame with no feedback, so the person had no idea their
touch had not counted. Set the hold-still guidance on that path so the
enrol poll reports it and userspace can prompt for a firmer press, matching
the guidance already surfaced from the armed and reading sensor states.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
Land the interrupt path as the default from hardware validation: it is no
longer behind the capture_irq parameter (removed), and it is set up whenever
the sensor exposes a data-ready line, with SPI polling kept only as the
fallback for a machine that does not describe one.

Two fixes the enrolment stress test surfaced:
- Trigger on the rising edge only. The line idles low, so a level trigger
  storms and both-edges also fires on the deassert -- a spurious wake that,
  mid-enrolment (the finger lifts and repositions between the eight stages),
  spun the capture loop.
- Bound the capture wait by wall-clock time, not a fixed attempt count. A
  stray edge returns the wait early, so an attempt budget would be spent in
  milliseconds and time the capture out before a frame lands; the time bound
  degrades, at worst, to the poll path's duration.

The wait now blocks on the data-ready line for up to ENROL_IRQ_WAIT_MS
(250 ms) rather than re-reading SPI status every 2 ms, waking the instant a
frame is ready.

Boot-verified on j414s (T6020): fprintd verify and a full eight-stage enrol
both capture and match through the interrupt, with no STATE_NEEDS_PATCH and
no level storm.

Signed-off-by: Diljit Singh <[email protected]>
Assisted-by: GPT-5.6 Sol
Assisted-by: Opus 5
Assisted-by: Claude Opus 4.8
Port the Neo warm SEP profile and 0x3356 sensor identity from linux-aurora 450f581. Fold in the later hardware finding from 18165cf: this J700 accepted the T6020-style keybag encoding and refused the strict form. Keep the wider DMA capability described in the profile so older boards retain their masks.

Co-Authored-By: Claude Opus 5 <[email protected]>
(cherry picked from commit eec15fc)
Port linux-aurora 29adacc with DT-described pcLD rail selectors and symmetric power sequencing. Normalize macsmc write replies so a successful response size is not mistaken for an error; retain a GPIO path for older boards.

Co-Authored-By: Claude Opus 5 <[email protected]>
(cherry picked from commit 889bb3a)
Port linux-aurora 11d4dff. The Neo SEP DART aperture starts above 4 GiB, so select a 42-bit DMA mask for that profile before allocating shared memory. Keep the established M1/M2 DMA masks unchanged for regression testing.

Co-Authored-By: Claude Opus 5 <[email protected]>
(cherry picked from commit b65f17c)
Port linux-aurora 41017b6: the measured J700 application-endpoint burst arrives around 43 seconds after boot. Allow up to 90 seconds, returning as soon as the key store is advertised.

Co-Authored-By: Claude Opus 5 <[email protected]>
(cherry picked from commit f3a5cf1)
DjDeveloperr and others added 14 commits September 27, 2026 00:55
The raw-owner locator scores CRC-valid record signatures in a fixed 6 MiB window rather than resolving the current .gl APFS file extent. If both root records have moved past slot zero, multiple shifted windows can pass the root test; a higher-base tie can extend into unrelated APFS blocks. An explicit start sector does not prove ownership.

Fail closed on xart_writes=1 before SEP attach, including the explicit-sector path; leave read-only inspection available. Disable the write-enabled loader recommendation. This is a safety interlock, not a macOS-parity repair: the APFS mapping and record update protocol still need hardware validation.

(cherry picked from commit fe3e8cf)
Replace the ambiguous root-record signature locator with a narrow, checksum-validated APFS checkpoint and .gl file-extent lookup. Open the shared container read-only and make an explicit sector an assertion rather than an override. Keep writes refused while the macOS ownership and update protocol are verified.

(cherry picked from commit 9c0186e)
Carry only the SEP-related part of 95731b2, including the SEP device-tree alias, calibration tooling, and fingerprint protocol changes. Exclude Thunderbolt and display modifications from this branch.

Source-Commit: 95731b2
Carry the verified J414s contact-guidance and three-slot changes from the combined worktree. The live SEP count, not a stale host index, gates new enrollment.
Treat an explicit SMC-powered sensor as an SMC consumer, rather than silently falling back to unrelated GPIO power. Keep the supplier bound, retry when it is late, and attempt to turn off every rail after a write failure.
APPLE_SEP depends on TRUSTED_KEYS, which defconfig leaves off, so a
kernel configured with "defconfig asahi.config" silently drops the SEP
driver even though the fragment asks for it (kconfig discards the
unmet CONFIG_APPLE_SEP=m).  Kernels that had the driver so far set
TRUSTED_KEYS by hand.

Enable the trusted keys core in the fragment.  The SEP registers itself
as a trust source at probe time through register_trusted_key_source(),
so the core is built in and the driver stays a module.

Turn off the TPM and TEE trust sources that defconfig enables with it.
Apple silicon Macs have neither, but the TEE source's init succeeds
regardless (it only registers a TEE bus driver), claims the trusted key
type at boot, and the SEP's registration then fails with -EBUSY: no
trusted keys, and no key-store bring-up behind them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
The driver uses the Rust Apple mailbox bindings and the firmware loader
abstractions but declares neither, so it only builds when another
driver (today APPLE_AOP) happens to pull them in.  It also relies on
runtime PM without depending on PM.

Depend on PM and RUST_APPLE_MAILBOX and select
RUST_FW_LOADER_ABSTRACTIONS.  RUST_APPLE_MAILBOX has to be a
dependency rather than a select: selecting it pulls in APPLE_MAILBOX,
which NVME_APPLE depends on, and with NVME_APPLE selecting
BLK_INLINE_ENCRYPTION for FileVault that closes a recursive dependency
through CRYPTO and HW_RANDOM.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
The SPI controllers on the Apple A18 Pro (T8140) are compatible with
the T8103 ones.  Follow the T6020 entry and use "apple,t8103-spi" as
the fallback rather than the generic "apple,spi".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
…s the rails

Boards whose Touch ID sensor rails are switched by the System
Management Controller describe the SMC key and rail words, but not
which SMC.  The driver looked one up by the generic "apple,smc"
compatible, which the SMC binding reserves for T8103, T8112 and T6000;
newer SoCs such as T8140 fall back to "apple,t8103-smc" instead, so the
lookup can never succeed there.

Add an apple,smc phandle, require it together with the power key and
rail words, and add an example for the MacBook Neo (J700).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
sep_acquire_smc_power() searched the whole tree for the generic
"apple,smc" compatible.  SoCs after T8112 do not carry that compatible
(see apple,smc.yaml), so on the MacBook Neo the search failed and the
sensor deferred its probe forever without saying why.

Take the SMC from the sensor node's apple,smc phandle instead, and
report a missing phandle as a device-tree error rather than deferring.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
Describe the Secure Enclave Processor of the Apple A18 Pro (T8140), the
DART and ASC mailbox it uses, the SPI2 controller that carries the
Touch ID sensor on boards that have one, and the power domains they
sit in (sep, sep_aon, spi_p, spi2).

Register ranges, interrupts, the SEP DART aperture and the power-domain
offsets come from the J700 Apple Device Tree.  The power domains are
the entries the PMGR generator emits from the ADT; their ADT parents
ps_sio and ps_afisocni0 have no PMGR state register in that output and
are not described.  sep and sep_aon are always on: iBoot starts the SEP
and it must never lose power under Linux.

The SEP node stays disabled here; boards enable it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
Enable the SEP on the MacBook Neo, add the "sep" alias the bootloader
uses to hand over SEP properties, and describe the Touch ID ("Mesa")
sensor on SPI2.  Its rails are switched by the SMC through the pcLD
key, so the node names the SMC by phandle together with the key and
the rail words; its interrupt is AP GPIO 135, rising edge.  All values
are from the J700 Apple Device Tree.

The calibration file is per-device factory data and is not shipped;
firmware-name only fixes where the driver looks for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
The SEP node ("apple,sep") is used by the T8103, T8112, T602x and T8140
device trees and matched by the SEP driver, but has no binding, so
dtbs_check rejects it.

Describe it: the register window, the ASC mailbox, the DART the SEP
reaches shared memory through, its power domain, and the properties
the bootloader adds (the SEP firmware carveout and the two boot
manifests the SEP needs to open the machine's secure storage).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
Two notes in this series described another operating system's
implementation instead of what was observed on the hardware: the keybag
encoding comment named where the other implementation places the bag
type, and the xART safety notes cited an inspection of its kernel code
and asked for records to be checked against it. Describe the enclave's
behaviour directly, drop the inspection paragraph, and state the
remaining checks as hardware tests.

No functional change.

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

Copy link
Copy Markdown
Contributor Author

Pushed 84a93e3 (comments/notes only): the keybag comment in profile.rs and tools/aurora-sep/XART-SAFETY.md now describe observed enclave behaviour instead of another operating system's implementation, and the notes no longer cite an inspection of its kernel code. sep.o builds with no warnings. Earlier commits in this branch still carry the old wording in their history (patches 02/03 add, later commits remove, similar comments), so this PR should be squash-merged so none of it reaches aurora-wip.

T8015 does not allocate NVMMU transaction control blocks. Complete its
ordinary DMA unmapping before returning, and access crypto state only on
controllers with LSQ NVMMU support.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The fingerprint binding uses enable-gpios. Request that named GPIO first
while retaining the legacy unnamed property and board-specific fallback.
Propagate acquisition errors and defer an unavailable GPIO supplier.
Refuse binding when no usable power control can be obtained.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
An unconditional mode-2 assignment overrides the mode-1 J313 device
tree. Retain the board mode unless a diagnostic override is supplied,
and reject override values outside the SPI mode range.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The last file release can free the biometric character device after
unregister drops its mutex. Wake detached waiters before releasing that
mutex so unregister cannot access the wait queue after destruction. The
open-count decision still leaves exactly one path responsible for
freeing the device.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Reject new entry points and protocol sends during shutdown, wake and
abort blocked transactions, and join capture work before powering down
or unregistering the sensor. Use a device lifetime mutex and a protected
sensor registry so independent SPI unbind also waits for exported sensor
operations before releasing their resources.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Assign a generation to each queued capture and retain worker ownership
across cancellation and close. Refuse a replacement operation until the
worker has retired, and check the queued generation before accepting
progress, guidance or a terminal result. This prevents an old verify
result from being bound to a new request nonce and serializes enrol and
verify work against the shared sensor and buffers.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Move the public biometric interface into include/uapi/linux and use
conventional ioctl macro spelling without changing its fixed-width
layouts or ioctl values. Make the libfprint patch consume the exported
header instead of maintaining a duplicated ABI definition, and document
header installation for its build.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit c9a55ef into aurora-wip Oct 8, 2026
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 deleted the feat/sep-neo-rebase branch October 8, 2026 10:22
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]>
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