Skip to content

soc: apple: sep: T6000 (M1 Pro) support, plus SPI CS timing and attach fixes - #26

Merged
DjDeveloperr merged 6 commits into
aurora-silicon:feat/sepfrom
brentkearney:t6000-sep
Sep 28, 2026
Merged

DjDeveloperr merged 6 commits into
aurora-silicon:feat/sepfrom
brentkearney:t6000-sep

Conversation

@brentkearney

@brentkearney brentkearney commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Brings up the SEP driver on the M1 Pro (T6000, MacBook Pro 16" J316s), plus two general fixes found along the way. Discussed on omacom/linux-aurora#7.

Tested on J316s on top of feat/sep 3594d18, with stock m1n1 1.6.1 and xart_writes=0: SEPOS cold-boots, the APFS lookup resolves the .gl extent at 0x4d4000, the Sepos13 key store initialises (capability word 2, IPC header version 2), all 12 endpoints come up, and /dev/sep-bio is published. Enrolment is untested.

General fixes

  • sep: wait for endpoint discovery, not the first message. On the cold-boot path the TZ0/IMG4 acks counted as the first response, so a 200 ms quiet gap after IMG4 ended the attach with zero endpoints. J316s begins discovery ~367 ms after the IMG4 ack; @iconidentify saw ~370 ms on j293.
  • sep: dt: fix a refcount double-put in node_at_address().

T6000 enablement

  • sep: add a T6000 platform profile. Boot, T8103 geometry and keybag create values, KeyStore::Sepos13 { cpx_encryption_mode: 2 } (from the J316s ADT /defaults), SPI mode 2 as on T6020. persistent_enrol is off until reboot-tested.
  • dts: t600x spi2 + Mesa sensor, and t6000-j316s enablement. Interrupt, power and data-ready lines are from Apple's J316s ADT; the pads were read back from hardware. The SPI2 clock parent (clkref) is inferred.

Other

  • sep: log endpoint discovery and a silent empty attach. Diagnostics; easy to drop.

Open: /chosen/apfs-preboot-uuid is absent under stock m1n1, so IdentitySource::Chosen has no OS UUID on J316s.

@chriskearney

chriskearney commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Independent confirmation from two more M1 machines: a MacBook Pro 13" (j293) and a MacBook Air (j313), both t8103. We hit three of these separately and fixed them the same way:

  • CS timing on every SPI controller (item 1): on j293 the internal keyboard was dead at the LUKS prompt until set_cs_timing was limited to the Mesa sensor's controller. Same root cause as on J316s.
  • Attach settling before discovery (item 2): on j293 the SEP's endpoint adverts arrived about 370 ms after the IMG4 ack. The first-response window had already closed, so attach settled with no endpoints until the driver waited for discovery.
  • Sensor power line as enable-gpios (item 3): with the sensor described in DT (our j293/j313 nodes), the power GPIO was never picked up until the lookup used the enable con-id.

With these in place, both machines cold-boot SEP/OS to all 12 endpoints and publish /dev/sep-bio.

@brentkearney

Copy link
Copy Markdown
Contributor Author

Rebased onto the current feat/sep (b5eae37, which includes #36). No conflicts, same 9 commits.

This PR mixes general fixes with T6000 enablement. Happy to split it into smaller PRs if that's easier to review. Each commit applies cleanly to feat/sep on its own:

PR Commits Why separate
A. spi: CS timing only on the Mesa bus 4f16efa Highest impact: kills the internal keyboard on every M1 Pro/Max, and @iconidentify hit it on j293
B. sep: wait for endpoint discovery 1a312be (+ diagnostics 18624bc, optional) Affects every cold-boot machine: j293 shows the same ~370 ms delay
C. sep: enable-gpios lookup b133d34 Any DT-described sensor: j313, and j293 from #36
D. sep: dt.rs refcount double-put 5e21d0c Small, self-contained
E. T6000 (M1 Pro) enablement ae5d76d, 0c73c8a, cc0df50 Builds alone, but needs A–C to work on hardware
F. tools: load-driver read-only 4e0ec62 A policy change you may want to discuss separately

If you'd like that, I'd keep this PR for E and open A–D and F separately. Otherwise it's fine to merge as is.

of_find_node_with_property() puts the reference on its 'from' node when
it advances. node_at_address() also wrapped every candidate in a DtNode,
whose Drop calls of_node_put(), so each non-matching node was put twice.

This path runs whenever no apple,mesa-fingerprint node exists, such as
on t6000, and walks every reg-bearing node in the tree.

Keep candidates in ManuallyDrop and hand out an owned DtNode only on
a match.

Assisted-by: Claude Opus 5.5
Signed-off-by: Brent Kearney <[email protected]>
profile::detect() matched only apple,t8103, apple,t6020 and apple,t8140,
so on an M1 Pro the driver stopped with ENODEV before touching the
hardware.

The M1 family cold-boots its SEP, so T6000 takes the T8103 boot
handshake, shared-memory geometry, identity-keybag create values and
Sepos13 key store. The J316s ADT's /defaults carries
cpx-encryption-mode = 2, the same as J293, J313 and J414s.

The sensor is on SPI2 at 0x39b108000, the T6020 address. The J313, J316s
and J414s platform device trees describe the Mesa sensor identically
(same reg blob, 8 MHz, sensor-id 0x3352), so the profile takes T6020's
hardware-verified SPI mode 2.

Enrolment persistence is not yet reboot-tested on J316s, so
persistent_enrol stays off; j414s_persistent_enrol=1 opts in.

Tested on J316s with stock m1n1 1.6.1 and xart_writes=0: SEPOS
cold-boots and advertises all 12 endpoints, and /dev/sep-bio is
published.

Assisted-by: Claude Opus 5.5
Signed-off-by: Brent Kearney <[email protected]>
Describe the SPI2 controller at 0x39b108000 and its Mesa fingerprint
sensor child, both disabled. The interrupt (AIC 1108) comes from the J316s
platform device tree (/arm-io/spi2, 0x454), which also gives SPI1 and
SPI3 as 1107 and 1109, matching the existing nodes.

The pin group was read back from J316s hardware. iBoot leaves pads 48-50
at function 1 with the same register values as spi3's signal pads 52-54,
while pad 51 is unconfigured, the same as the unused pads 45-47. The
platform device tree gives SPI2's chip select as "null", so the bus uses
the controller's native chip select, as on t8103 and t8112.

The clock parent is not in the platform device tree. On t8103 and t602x
SPI2 shares its neighbour's parent, so this takes spi3's clkref.

Assisted-by: Claude Opus 5.5
Signed-off-by: Brent Kearney <[email protected]>
Add the sep alias and enable the SEP node. m1n1's dt_set_sep() keys off
the alias to add the sepfw region and the local-policy and iBoot
manifests the driver needs to cold-boot SEPOS, as on t8103-j313.

Enable SPI2 and the Mesa sensor. From the J316s platform device tree
(/arm-io/spi2/mesa): the power line is gpio0 pin 196 (function-mesa_pwr,
active high) and the data-ready interrupt is pin 195. The same reading of
the J414s tree gives 122 and 121, the lines the driver hardcodes for
that board.

Assisted-by: Claude Opus 5.5
Signed-off-by: Brent Kearney <[email protected]>
When the SEP advertised no endpoints, tick_attach() moved to READY
without a word, so the boot looked stalled after the IMG4 acknowledgement
with nothing to say why. Discovery and messages on unhandled endpoints
were not logged either, which left no way to see what SEPOS sent.

Log each discovery message, each message on an endpoint the driver does
not handle, the endpoint count when attach settles, and an error when it
settles with none.

Assisted-by: Claude Opus 5.5
Signed-off-by: Brent Kearney <[email protected]>
tick_attach() held the FIRST_RESPONSE_MS window open only while no
message at all had arrived. On the cold-boot path the TZ0 and IMG4
acknowledgements are messages, so the first 200 ms quiet gap after IMG4
ended the attach with no endpoints known, and the driver stopped before
the xART exchange.

On J316s discovery begins ~367 ms after the IMG4 acknowledgement:

  36.836322 boot: IMG4 acknowledged
  37.176155 attach settled with no endpoints
  37.203042 discover: endpoint 0x14 ...

Keep waiting, up to FIRST_RESPONSE_MS of quiet, until at least one
endpoint has been advertised.

Assisted-by: Claude Opus 5.5
Signed-off-by: Brent Kearney <[email protected]>
@brentkearney

Copy link
Copy Markdown
Contributor Author

Rebased onto feat/sep 3594d18 and retested on J316s: 12 endpoints and /dev/sep-bio, with the new APFS xART lookup (same base, 0x4d4000) and the Sepos13 key store on T6000.

Thanks for merging the SPI fix. Now 6 commits, down from 9:

  • Dropped: the SPI CS timing fix (merged as 1d0fbf3), the enable-gpios lookup (superseded by 9b7d20d), and the load-driver change (superseded by the APFS xART rework).
  • T6000 profile: updated for the new structure, with KeyStore::Sepos13 { cpx_encryption_mode: 2 } and T8103's create values, and persistent_enrol: false until reboot-tested.

The split offer above still stands for what's left, but at 6 commits it may not be worth it.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

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.

3 participants