Skip to content
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/iommu/apple,dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ properties:
- enum:
- apple,t6020-dart
- apple,t8122-dart
- apple,t8132-dart
- apple,t8140-dart
- apple,t8142-dart
- const: apple,t8110-dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ properties:
- apple,t8103-asc-mailbox
- apple,t8112-asc-mailbox
- apple,t8122-asc-mailbox
- apple,t8132-asc-mailbox
- apple,t8140-asc-mailbox
- apple,t8142-asc-mailbox
- apple,t6000-asc-mailbox
Expand Down
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/spi/apple,spi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ properties:
- items:
- enum:
- apple,t6020-spi
- apple,t8132-spi
- apple,t8140-spi
- const: apple,t8103-spi
- items:
Expand Down
47 changes: 47 additions & 0 deletions Documentation/input/devices/j713-touchid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
J713 Touch ID session inputs
===========================

The T8132/J713 profile (MacBook Air 13-inch, M4) is the J715 profile with
J713's own root-key file. Read j715-touchid.rst first: the nonce session,
the single SESSION_SHARE retry after status ``0x16``, the length rule and
the calibration rules are the same, and so are the provisioning limits.

Root-key firmware
-----------------

``apple/msrk-j713.bin`` must contain this machine's own FDR MSRk data, the
complete, unmodified body supplied to SBIO SET_MSRK_DATA (opcode ``0x86``).
The observed J713 body is 10,848 bytes, the same length as J715's. The
signed IMG4 payload alone (1,726 bytes on the tested machine) is refused by
the enclave with status ``0x1c``; do not substitute it or J700's container.
J713 never reads ``apple/msrk-j715.bin``.

Device tree
-----------

The sensor is on spi2 (``0x3ad108000``), chip select 0, powered by NUB GPIO
28 (active high). It answers in SPI mode 2, so the board node sets
``spi-cpol`` and not ``spi-cpha``; the sensor ID reads back as ``0x3356``.
The data-ready line (AP GPIO 199 in the ADT) is not described, so the
driver polls. Calibration is the machine's own source-6 FSC2 data under
``apple/mesacal-j713.bin`` (130,427 bytes on the tested machine).

Validation
----------

On one J713, with this profile ported to the Omarchy M4 kit kernel 7.1.9
and the default ``xart_guard`` of 1:

- the first SESSION_SHARE returned ``0x16``, the J713 body was loaded and
the retry was accepted;
- a fingerprint was enrolled and matched, and another finger was rejected;
- after a cold boot the driver restored the enrolment from the Catacomb
files and the same finger matched again;
- the guard refused no write. The only change in the gigalocker was the
enclave rewriting a shared root record, which guard 1 permits.

The identity keybag used in that run had been created earlier by a
development build with ``xart_guard=0``. Under guard 1 that creation was
refused: after rewriting the shared root, the enclave rewrote a session
record that predates Linux. A J713 that has never had a keybag has not been
tested with the guard on. Login integration and suspend were not tested.
54 changes: 54 additions & 0 deletions Documentation/input/devices/j715-touchid.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
J715 Touch ID session inputs
===========================

The T8132/J715 profile uses nonce authentication and source-6 calibration.
It does not change the other boards' session policies, xART guards or
persistence rules. It still requires a successful sensor power cycle before
registration.

Root-key firmware
-----------------

``apple/msrk-j715.bin`` must contain this machine's own FDR MSRk data: the
complete, unmodified body supplied to SBIO SET_MSRK_DATA (opcode ``0x86``).
The qualified input is 10,848 bytes, as in the successful J715 candidate.
Do not substitute J700's signed-container file, strip or add a wrapper, pad
another input to this size, or use another machine's data.

The driver checks the length, not a private identifier or hash. It does not
parse or authenticate the FDR container; a matching length is not evidence
of validity. The enclave must accept the unmodified data. Acquisition and
container verification belong to provisioning, not the kernel driver.
No automatic extraction or alternate-file fallback is provided.

After SENSOR_NONCE, the driver first requests SESSION_SHARE normally.
Only an explicit status ``0x16`` on J715 triggers the firmware request and
upload. A successful upload permits exactly one further SESSION_SHARE
request within that session attempt. A missing file, wrong length, failed
upload, failed transfer or refused retry stops the attempt. A successful
initial share does not read the firmware file.

J700 retains ``apple/msrk-j700.bin``, the nonempty signed-container rule,
and its upload before SESSION_SHARE once per enclave lifetime. It does not
use J715's refusal recovery.

Calibration and validation
--------------------------

The existing sensor ``firmware-name`` property, or its existing default
``apple/mesa_calibration.bin``, supplies calibration. J715 requires its own
source-6 FSC2 data from the successful setup, not the older extracted FDR3
input. The existing calibration encoder prefixes the unchanged body with a
four-byte source word. This patch does not add a calibration fallback.

With ``CONFIG_APPLE_SEP_KUNIT_TEST=y``, the
``apple_sep_sensor_root_key`` suite tests board selection, input-length
boundaries and refusal classification. Also run ``apple_sep_profile``,
``apple_sep_dart_window`` and ``apple_sep_registration`` to cover the
existing profile and registration behavior.

The old candidate's successful enrollment and same-boot verification do not
qualify this upstream kernel. Hardware validation must establish sensor
readiness, enrollment, matching and persistence across a cold boot, with
the existing power-cycle and registration guards enabled. Login integration
is userspace work; disk unlock is outside this support.
21 changes: 21 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j713.dts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "t8132.dtsi"
#include "t8132-jxxx.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>

/ {
Expand All @@ -33,3 +34,23 @@
&fpwm1 {
status = "okay";
};

/*
* Mesa fingerprint sensor on spi2 (J713 ADT /arm-io/spi2/mesa): power on
* NUB GPIO 28, active high. It answers in mode 2 (CPOL=1, CPHA=0). The
* data-ready line (AP GPIO 199) is left out, so the driver polls until its
* trigger is confirmed. Native chip select only.
*/
&spi2 {
status = "okay";
};

&mesa {
status = "okay";
enable-gpios = <&pinctrl_nub 28 GPIO_ACTIVE_HIGH>;
spi-cpol;
spi-cs-setup-delay-ns = <20>;
spi-cs-hold-delay-ns = <20>;
/* Per-device factory data from this Mac's own iBoot system container. */
firmware-name = "apple/mesacal-j713.bin";
};
69 changes: 69 additions & 0 deletions arch/arm64/boot/dts/apple/t8132.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,50 @@
};
};

/*
* iBoot hands over a running SEP. Keep Linux off its DART at boot;
* apple_sep enables it at module initialization. The SEP only
* accepts IOVAs in this window, which carries the BIT(40) alias
* the DART translates (ADT vm-base-0 0x10000004000).
*/
sep_dart: iommu@3a8c80000 {
compatible = "apple,t8132-dart", "apple,t8110-dart";
reg = <0x3 0xa8c80000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 399 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
apple,dma-range = /bits/ 64 <0x10000004000 0xffff0000>;
apple,dma-offset = /bits/ 64 <0x0>;
status = "disabled";
};

sep: sep@3aa600000 {
compatible = "apple,sep";
reg = <0x3 0xaa600000 0x0 0x88000>;
mboxes = <&sep_mbox>;
mbox-names = "mbox";
iommus = <&sep_dart 0>;
status = "disabled";
};

/*
* The ADT lists these interrupts as 390 389 392 391. In that order
* the recv-not-empty slot holds the line that is asserted while the
* receive FIFO is empty, and starting the channel never returns.
*/
sep_mbox: mbox@3aa608000 {
compatible = "apple,t8132-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x3 0xaa608000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 389 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 390 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 391 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 392 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
};

i2c0: i2c@3ad010000 {
compatible = "apple,t8132-i2c", "apple,t8103-i2c";
reg = <0x3 0xad010000 0x0 0x4000>;
Expand Down Expand Up @@ -439,6 +483,31 @@
status = "disabled";
};

/*
* Touch ID. iBoot leaves the pads muxed and the controller uses
* its native chip select, so there is no pinctrl here. clkref
* divides to the sensor's 8 MHz exactly, and is the parent the
* J713 sensor was enrolled and matched with.
*/
spi2: spi@3ad108000 {
compatible = "apple,t8132-spi", "apple,t8103-spi";
reg = <0x3 0xad108000 0x0 0x4000>;
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 1056 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkref>;
power-domains = <&ps_spi2>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";

mesa: fingerprint@0 {
compatible = "apple,mesa-fingerprint";
reg = <0>;
spi-max-frequency = <8000000>;
status = "disabled";
};
};

serial0: serial@3ad200000 {
compatible = "apple,s5l-uart";
reg = <0x3 0xad200000 0x0 0x1000>;
Expand Down
Loading