Repository navigation
Enable the SEP and Touch ID on T6041/J616c - #732
Conversation
98617ae to
783e972
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
The SEP part looks good. It's two small commits: the J616c SEP and Mesa DT nodes, and a T6041 platform profile in drivers/soc/apple/profile.rs that inherits T6040's, with detection following the existing machine_has pattern. The code itself is fine. What blocks it is around it:
Required fixes
- Signed-off-by (hard blocker). Neither commit (d680ca7, 783e972) has a
Signed-off-by:. Please add yours directly afterAssisted-by: LLM.git rebase --signoffdoes it. - Stacked on PR 525. The branch carries all 14 commits of #525 underneath, and that PR has blockers of its own (see the review there). Once 525 is merged, please rebase onto integration/aurora so this PR shows only these two commits.
- Firmware names.
firmware-name = "apple/mesacal-j616c.bin", "apple/msrk-j616c.bin". Please confirm the installer's firmware extraction produces both files on a J616c (not a hand copy), and add the J616c case to the extraction if it doesn't.
Evidence I'd like from the M4 Max: journalctl -b | grep -iE "sep|touch id|fprintd" from a boot with SELinux enforcing, an enrol followed by a Touch ID unlock or sudo, and a reboot showing the enrolment restored.
On our side the J616s boot with this stack applied keeps Touch ID working ("restored 1 enrolled identity" on every one of 21 boots), so the shared SEP code is unaffected.
Reuse the existing SoC and PMGR descriptions as the shared T604x base. Keep the M4 Pro DRAM class in t6040.dtsi on top of it. The J614s and J616s compiled trees keep every node and property unchanged. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Describe the Max CPU, OPP and register-window differences on the shared base. Preserve the qualified J616c node and property values. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Move identical register-window constructors into a family helper. The T6040 and T6041 initialization-data checks retain their exact values. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Select a static 25F84 profile and admit the normalized loaded image measured in three qualification boots. Remove exploratory overrides and unknown-image admission from the support path. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Accept 26.5.2 firmware on the T6041 display controllers and add headerless powerlog parsing. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
A DCP commit signals flip_done from its swap completion, after the rest
of the commit tail has run. drm_atomic_helper_commit_tail_rpm() waits
with drm_atomic_helper_wait_for_vblanks(), but appledrm never calls
drm_vblank_init(), so drm_crtc_vblank_get() fails and that wait returns
at once. A blocking commit therefore returned before flip_done, and
drm_atomic_helper_setup_commit() refuses a nonblocking commit on the
same plane until flip_done. A page flip right after drmModeSetCrtc()
failed with -EBUSY ("busy with a previous commit"), which is what
glmark2-es2-drm hit on the J616c.
Wait with drm_atomic_helper_wait_for_flip_done() instead. The rest is
the sequence of drm_atomic_helper_commit_tail_rpm(), in its order. That
helper makes no runtime PM calls: its name stands for enabling CRTCs
before committing active planes, and this keeps that.
The change is not scoped to the J616c. Neither the empty vblank wait
nor the -EBUSY check depends on the SoC, so a per-machine tail would
only leave the race on the others. On every appledrm machine:
- A blocking commit returns after the swap completes and holds its
modeset locks until then.
- A nonblocking commit's worker finishes later. The next commit was
already held back by flip_done, so the flip rate does not change.
- Nothing waits when flip_done is complete early: CRTCs that stay off,
legacy cursor updates, and the T8132 backend, which sends the event
from its flush.
- A lost event costs 10 s and an error in the commit that lost it. The
next commit's dependency wait already has the same bound, so this
adds no new hang.
Framebuffer lifetime does not depend on this wait: displaced scanout is
already retained until its swap completes.
Seen and tested on the J616c only.
Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Patching the AOP boot arguments read and rewrote the whole table with memcpy_fromio() and memcpy_toio(), which choose their access widths from alignment and length and write back every byte. Add an AopHwConfig setting for explicit access: read the table in aligned 32-bit words, rounded out to word boundaries so that neighbouring bytes are kept, write only the words that changed and read each one back. This was chosen for the J616c bring-up so that the first accesses to its AOP SRAM had a known width. It does not fix an observed fault: the bulk copy was not run on that machine. The setting is on in HW_CFG_T6040, so it is not J616c-only. t604x.dtsi gives the J614s, J616s and J616c the one apple,t6041-aop compatible, and HW_CFG_T8132 (J713) is a copy of HW_CFG_T6040. Scoping it to the T6041 would take a second compatible, which changes the T6040 device trees, or a machine check. On those machines the values written do not change. The access width does, and there are new ways to fail the probe: -EIO when a word does not read back, and -EINVAL for an empty table or one whose rounded end passes the window. Every other SoC keeps the bulk copy. Synthetic MMIO checks cover malformed tables, bounds and failed readback. Run on the J616c only. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Describe the six amplifiers and headphone jack in the J616c board DT. Stop playback when the speaker protection lease is lost on SN012776 cards fed by the AOP. Until now a lost lease only clamped the amp gains, and the stream kept running with its protection daemon gone or stuck in a stalled sense capture. The clamp stays; the stream now also goes to XRUN, so its client sees the loss. This is shared macaudio code and it is stricter than before. It applies to the J616c, the J616s and the J713. The J614s uses the same condition but binds no speaker link, so it has no lease and never gets here. Narrowing this to the J616c would give machines with the same amps and the same AOP path different protection, and would take a new match entry for it. The stop covers every playback stream of the speaker card, which on these machines carries only the speaker stream. The headphone jack is a card of its own and keeps playing. It is a stop, not a refusal: a client that prepares again plays at the clamped gain until the lease returns. It fires only when the speakers go from unlocked to locked, so not at boot, and not for the kernel's own lock across system sleep, where ASoC suspends the streams itself. A daemon that exits cleanly also loses the lease. Other amps and non-AOP SN012776 cards behave as before, and the MAX98360A path still stops only its software-gain streams. Lease loss was tested on the J616c only. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The T6041 AVD shares its "apple,t6041-avd" compatible with T6040, which holds HEVC back until the firmware lists it. Give the T6041 node a more specific compatible and a variant that holds nothing back, so HEVC is also available on firmware that publishes no codec list. A firmware that does publish one still limits the set. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Build the production initialization objects with their soft-float types and compare constants with explicit capture inputs. Keep T6040 per-chip calibration validation separate; include no captures or local defaults. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
m1n1 compares DT CPUs with its physical MPIDR enumeration. Appending the Max cores to the Pro topology put CPU 9 out of order and stopped boot before kernel entry. Define the full family topology in hardware order and remove the extra cores from T6040. Check the compiled DTB order for both SoCs. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
macOS on J616c writes 0x1c890 = 1 and 0x1c918 = 0 for its tiling passes, where the shared firmware profiles write 0x200440 and 4. Do the same in T6041's 25F84 build and leave the shared profiles unchanged. 0x1c9a8 stays at the shared 0x3c; macOS writes 0x5c here. This does not fix the 25F84 reason-0 restarts under concurrent rendering. They still occurred with these values on an earlier base, also with 0x1c9a8 = 0x5c. Ran on J616c with 25F84, with PRs 732, 749 and 920 and Mesa ca90d8c1919, serial rendering off and the firmware log on: three boots of niri, DMS and 20 Whisper runs each, with no GPU recovery. Add KUnit coverage for the policy boundary and constructor output. Link: aurora-silicon#525 (comment) Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Add the sep alias and enable the SEP mailbox; apple_sep enables the SEP and its DART when it binds. Enable spi2 and the Mesa sensor with the wiring the J616c ADT gives, which matches J616s. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The J616c ADT describes the SEP, its DART window, its power state and the Touch ID sensor with the J616s values, so use the T6040 profile under its own name. Match only apple,t6041 together with apple,j616c. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
783e972 to
6bdde0e
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
Thanks, the enrol, restore and match logs are what I was after, and good to know aurora-touchid-setup takes the names from the device tree, so the J616c needs no special case there.
On our M4 Pro the merge train boot (this PR with 525, 749, 920, 950 and 951) restored its enrolled identity as usual with SELinux enforcing, so the shared SEP code is fine. Merging!
For later, the macOS installer only writes the Touch ID files for the Neo right now, so a Fedora install on a J616c would still need that added when the J616c goes into the installer.
Why
J616c places the Secure Enclave, its mailbox, DART and power state, and the spi2 Touch ID sensor at the shared T604x addresses. Enabling them lets
apple_sepand the Mesa sensor driver bind as on the M4 Pro.What
t6041-j616c.dts: add thesepalias; enable the SEP mailbox, spi2 and the sensor.drivers/soc/apple/profile.rs: a T6041/J616c profile that aliases the T6040 profile, matched only onapple,t6041withapple,j616c. No new constants.Stacked on #525.
Testing
This ran on the stack just before its rebase onto the current base. Logs:
journalctl -b | grep -iE "sep|touch id|fprintd"from both boots, and the results, are at https://gist.github.com/astaff/d1f649ba0d29f5279762e2baa427e732.restored 2 enrolled identity/identities; enrolment survived reboot, and the same identity matched again.apple_seploaded with xART writes on (xart_writes=1)./dev/sep-bio, with a small test client for interface 5's enrol call.admit()from nixos-aurora'saurora-touchid-setup. That tool takes the names from the device tree'sfirmware-nameand the bytes from the FSC2 and MSRk records, with no per-machine list, so no J616c case looks necessary.🤖 Generated with Claude Code