Skip to content

soc: apple: sep: take the Touch ID sensor's lines from the device tree only - #2802

Draft
RyanTheTide wants to merge 3 commits into
mainfrom
spec12/sep-m2-v2
Draft

RyanTheTide wants to merge 3 commits into
mainfrom
spec12/sep-m2-v2

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #2256 (same changes, commit trailers fixed, on the current integration/aurora).

Problem

On apple,j414s only, the Touch ID sensor shim falls back to fixed power and data-ready lines. Every other board has to describe these lines in its device tree. J414s already does too.

Change

  • sensor_shim.c: remove the J414s fallback. Power now comes from enable-gpios (or the J700 SMC rails) and data-ready from the node's interrupt, on every board. t602x-j414-j416.dtsi already describes the same two lines for J414s.
  • sensor.rs: remove the power-source value that only the fallback produced.

The J473 sep alias and the SEP node comments landed separately (#2871 and main). The J474s/J475c aliases are dropped from this PR (no owner row); they can return as their own change.

Tested: no hardware row on this head yet. Merged with main f02bd68: sensor_shim.o builds with W=1 and LLVM, no warnings; no ChipLine/SEP_POWER_CHIP_LINE/sep_drdy remains in the tree. Rust half left to CI.
Risk: two-way · M1/M2 laptops with Touch ID (sensor power/data-ready lines come from the DT only)

Still to run

  • M2 J413 row: apple_sep ... ready, "power line from the device node", /dev/sep-bio, then a Touch ID match.
  • M1 Pro J316s/J314s row: the same checks, no change expected.
  • A J414s/J416s owner row (the only family whose code path changes).
Why the SEP node ships disabled on M2

On T8112 and T602x the SEP is already running when Linux starts. When apple_sep loads, it picks the SoC profile, sets the DART window and enables sep_dart and the SEP node with an OF changeset (dt.rs). The J413 on the current fleet kernel logs "SEP DART changeset applied", "SEP node enabled", then "ready in 3117 ms: 12 endpoints". The boot loader DTB on that machine is byte-identical to the kernel's, where the node is disabled. m1n1 finds the SEP through the sep alias to add the sepfw region and the local-policy and iBoot manifests. The warm registration refuses to attach without those manifests, so the alias is what a board must provide.

Old gate and why the change is safe

The gate was added in f9fc10a ("soc: apple: restrict the fixed power-GPIO fallback to j414s") and bece4b1 ("soc: apple: sep: optional interrupt-driven fingerprint capture"). It took lines 122 and 121 of /soc/pinctrl@39b028000. The J414 to J416 DT (2b5d006) describes enable-gpios = <&pinctrl_ap 122 GPIO_ACTIVE_HIGH> and interrupts = <121 IRQ_TYPE_EDGE_RISING>, and pinctrl_ap is pinctrl@39b028000. These are the same lines, so J414s behaves the same. Every M1/M2 laptop DT (J293, J313, J314s/c, J316s/c, J413, J415, J493, J414s/c, J416s/c) describes the power line in its sensor node.

The alias only makes m1n1 reserve the SEP's own firmware region and copy two manifests. apple_sep is not autoloaded on M2 (its node is disabled, and the packaging blacklists it), so a desktop's SEP is touched only when the module is loaded on purpose. The desktops have no built-in sensor and their mesa node stays disabled. J475d and J180d (T6022) get no alias because the driver has no T6022 profile.

The sensor shim and its interrupt capture were written by Diljit Singh. The J414 to J416 sensor DT is by Chris Kearney.

…e only

The sensor shim had a board fallback: on a machine compatible with
apple,j414s whose sensor node carried no power GPIO, it took line 122 of
/soc/pinctrl@39b028000 for power, and on one with no node interrupt it
took line 121 of the same controller for data-ready. Every other board
had to describe both lines in its sensor node.

The tree now describes them on J414s too: t602x-j414-j416.dtsi gives the
J414s, J414c, J416s and J416c sensor enable-gpios = <&pinctrl_ap 122> and
interrupts = <121 IRQ_TYPE_EDGE_RISING> on pinctrl_ap, which is
pinctrl@39b028000. Those are the same two lines, so the fallback never
runs on an in-tree J414s DTB. Every M1 and M2 laptop DT (J293, J313,
J314s/c, J316s/c, J413, J415, J493, J414s/c, J416s/c) describes the power
line in its node.

Drop the board check and the fixed lines. Power comes from enable-gpios
(or the J700 SMC rails), data-ready from the node's interrupt via
spi->irq, on every board alike. Drop the chip-line power source from
sensor.rs, which only that path produced.

Fixes: f9fc10a ("soc: apple: restrict the fixed power-GPIO fallback to j414s")
Fixes: bece4b1 ("soc: apple: sep: optional interrupt-driven fingerprint capture")
Suggested-by: Diljit Singh <dj@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The SEP node is disabled in t8112.dtsi and t602x-die0.dtsi on every
board, laptops included. That is the warm-attach contract of apple_sep:
on these SoCs the SEP is already running when Linux starts, and the
driver enables the SEP node and sep_dart with a changeset at module load,
after it has picked the SoC's profile and before the DART probes. The
running M2 Air (J413) shows it: "SEP DART changeset applied", "SEP node
enabled", then "ready ... 12 endpoints". Say so at the node, so the
disabled status does not read as a missing enable.

What a board must provide is the sep alias: m1n1 finds the SEP through
it to add the sepfw region and the local-policy and iBoot manifests, and
the warm registration refuses to attach without the manifests. The M2
laptops have it; the Mac mini (J473, J474s) and the Mac Studio M2 Max
(J475c) have a SEP and a profile (T8112, T6020/T6021) but no alias, so
the driver could never attach there (key store, Magic Keyboard Touch ID).
Add it. These boards have no built-in sensor and leave the mesa node
disabled.

The M2 Ultra boards (J475d, J180d) get no alias: the driver has no
T6022 profile, so it would only reserve memory for nothing.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J473 hardware row for the sep = &sep DTS hunk, on the macOS 27.2 (26B123) stub and Fedora kernel 7.3.0-40.fc44.aurora.aarch64.

Boot SEP handoff Linux result
Existing DTB Stage 2 reports FDT: sep alias not found in devtree. Both boot manifests are absent. apple_sep refuses warm attach and aurora-sep.service fails.
One-shot with the alias Stage 2 publishes the SEP firmware reservation and both boot manifests. apple_sep binds, discovers 7 endpoints in 18 messages, and aurora-sep.service succeeds.

The one-shot kept the same kernel, Stage 2 executable, and U-Boot payload. The embedded DTB changed only by the alias. SELinux stayed Enforcing with 0 AVCs and 0 failed units on the trial.

This is the row first posted on the closed #2256 (comment). The t8112-j473.dts hunk here is byte-identical (sep = &sep; in /aliases). A DTB built from integration/aurora 85e255d with only this hunk differs from the stock J473 DTB by that one property, and the alias resolves to /soc/sep@25e400000 (apple,sep), the same as on the J413. The other files in this PR need their own laptop rows.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at 5ada49e (non-author, draft). No blocker in the code; ready once the listed rows are in and the overlap with #2871 is settled.

  • Merges cleanly on integration/aurora 6748d83. Two commits, human trailers only.
  • Shim commit (341c1fc): after the change sep_acquire_power() has three outcomes only: SMC rails (apple,smc-power-key), enable-gpios (or the unnamed first GPIO) from the node, or -ENODEV with a warning. No of_machine_is_compatible() and no fixed pinctrl path or line number is left in sensor_shim.c, and no reference to ChipLine / SEP_POWER_CHIP_LINE / sep_drdy remains under drivers/soc/apple.
  • The claim that the fallback was dead on in-tree DTBs holds: t602x-j414-j416.dtsi gives &mesa enable-gpios = <&pinctrl_ap 122 GPIO_ACTIVE_HIGH> and interrupts = <121 IRQ_TYPE_EDGE_RISING> on pinctrl_ap, the same two lines the fallback took. I also found enable-gpios in the sensor node of J293, J313, J314s/c, J316s/c, J413, J415, J493 and J414c.
  • Data-ready: sep_sensor_irq_setup_locked() now returns -ENODEV when spi->irq <= 0 and otherwise requests the node's interrupt; the teardown only frees that IRQ. The error path no longer has a descriptor to leak.
  • DT commit (5ada49e): the alias lands in t8112-j473.dts, t6020-j474s.dts and t6021-j475c.dts. J475d and J180d include t6022.dtsi and their own board files, so they do not inherit it. apple,t6021 selects the same profile as apple,t6020 in profile.rs, so J475c has one.

Small points, not blocking:

  • 5ada49e has the same patch-id as the single commit of arm64: dts: apple: t8112: alias the SEP on the Mac mini (J473) #2871 (open, not draft, with the J473 A/B row). The two merge cleanly in either order, but only one of them should carry the DT commit; I would drop it here and keep this PR to the shim change.
  • Rows still open per the body: J413 (power line from the node, /dev/sep-bio, a match), J316s (no change expected), and a J414s/J416s owner row, which is the only family whose code path actually changes (fallback to node properties).
  • The body says apple_sep is not autoloaded on M2; the J473 row in the comment shows aurora-sep.service running it at boot. Worth one sentence on which is true for shipped images, since the alias makes the difference between "refuses to attach" and "attaches" there.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent source review at 5ada49e07fae. The board fallback removal is supported by the existing sensor lines in DT. The J473 alias is a separate behavioral change: it makes the loader publish a warm SEP handoff even though the node remains disabled in the input DT. Please add an actual J473 boot showing the manifest-backed SEP attaches without a phantom biometric device, plus a J413 regression covering its existing SEP and sensor.

The J473 alias landed as #2871 and the SEP node comments as part of
main's history; take main's t8112.dtsi, t8112-j473.dts and
t602x-die0.dtsi. As the review asked, this PR keeps only the sensor shim
change: the J474s and J475c aliases are dropped here (no owner row; they
can come back with one as their own change).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide RyanTheTide changed the title soc: apple: sep: Touch ID lines from DT only; alias the SEP on the M2 desktops soc: apple: sep: take the Touch ID sensor's lines from the device tree only Dec 5, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Updated to fd2472c. I merged main and took main's t8112.dtsi, t8112-j473.dts and t602x-die0.dtsi: the J473 alias landed as #2871, and the SEP node comments are on main. As the review suggested, the PR is now only the shim change. The J474s/J475c aliases are dropped, since no owner row exists for them. Diff from main: sensor_shim.c and sensor.rs. sensor_shim.o builds with W=1 and no warnings. Still needed: J413 and M1 Pro rows (queued) and a J414s/J416s owner row.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware row at exact head fd2472c2b98c on the M1 Pro (J316s): PARTIAL (no finger match).

  • apple_sep 396400000.sep: ready in 3533 ms: 12 endpoints, sep sensor: power line from the device node, sensor: power via the sensor node's own gpios property, /dev/sep-bio present. Same lines as the base kernel, as expected for this board.
  • Not run: the Touch ID match (needs a finger) and the J413/J414s rows.

How: one combined test kernel for six PRs, not this PR alone. Kernel 7.3.0-aurora-ci = main d0684a06 + merge commits of linux#2804 95b14b2c, #3913 35141126, #2802 fd2472c2, #2403 aca4e954, #1814 775f31d2, #2398 75b30c6c (all merged clean, test commit 837c6334, cloud build https://github.com/aurora-silicon/linux/actions/runs/47474056828). Booted as a one-shot on the lab M1 Pro (J316s, T6000, 13.5 stub) with this kernel's own DTBs in a trial Stage 2 (live aura 1.0.0b19 + U-Boot, only the DTBs swapped), default cmdline. Boot health on the test kernel: 0 error-level kernel lines (base 0), 0 AVC, 0 failed units. Saved default restored after.

This branch has not been deployed

No deployments
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.

1 participant