Repository navigation
soc: apple: sep: T6000 (M1 Pro) support, plus SPI CS timing and attach fixes - #26
Conversation
|
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:
With these in place, both machines cold-boot SEP/OS to all 12 endpoints and publish |
6f09beb to
1a312be
Compare
|
Rebased onto the current 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
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]>
1a312be to
02e8f6b
Compare
|
Rebased onto Thanks for merging the SPI fix. Now 6 commits, down from 9:
The split offer above still stands for what's left, but at 6 commits it may not be worth it. |
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/sep3594d18, with stock m1n1 1.6.1 andxart_writes=0: SEPOS cold-boots, the APFS lookup resolves the.glextent at0x4d4000, the Sepos13 key store initialises (capability word 2, IPC header version 2), all 12 endpoints come up, and/dev/sep-biois published. Enrolment is untested.General fixes
node_at_address().T6000 enablement
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_enrolis off until reboot-tested.clkref) is inferred.Other
Open:
/chosen/apfs-preboot-uuidis absent under stock m1n1, soIdentitySource::Chosenhas no OS UUID on J316s.