From ebe5b7e97fa7ad0e1bcd8fec5ff05475255aa6c7 Mon Sep 17 00:00:00 2001 From: Adam Harris Date: Thu, 29 Oct 2026 13:36:32 -0600 Subject: [PATCH 1/3] arm64: dts: apple: t6030: describe the SEP and the Touch ID SPI bus Add the SEP, its DART and mailbox, and spi2 with the Mesa sensor child, as the J514s ADT (system firmware 27.0) records them. The SEP and its DART sit at the same addresses as on T8122, with the same BIT(40) DMA window (vm-base 0x10000004000, vm-size 0xffff0000); the mailbox takes AIC 366-369 and the DART AIC 372. spi2 is at 0x289108000 on AIC 876. Everything stays disabled: apple_sep enables the SEP and its DART when it loads, and boards enable the mailbox, the bus and the sensor. Assisted-by: LLM Signed-off-by: Adam Harris Co-Authored-By: Claude Opus 5.5 --- arch/arm64/boot/dts/apple/t6030.dtsi | 67 ++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6030.dtsi b/arch/arm64/boot/dts/apple/t6030.dtsi index 52ad06a0668893..9ced60a8a74fae 100644 --- a/arch/arm64/boot/dts/apple/t6030.dtsi +++ b/arch/arm64/boot/dts/apple/t6030.dtsi @@ -576,6 +576,31 @@ status = "disabled"; }; + /* + * Touch ID (J514s ADT /arm-io/spi2). iBoot leaves the pads muxed + * and the controller uses its native chip select, so there is no + * pinctrl here. + */ + spi2: spi@289108000 { + compatible = "apple,t6030-spi", "apple,t8103-spi"; + reg = <0x2 0x89108000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&clk_200m>; + power-domains = <&ps_spi2>; + status = "disabled"; + + mesa: fingerprint@0 { + compatible = "apple,mesa-fingerprint"; + reg = <0>; + spi-max-frequency = <8000000>; + spi-cpha; + status = "disabled"; + }; + }; + sio_dart: iommu@289004000 { compatible = "apple,t6030-dart", "apple,t8110-dart"; reg = <0x2 0x89004000 0x0 0x4000>; @@ -675,6 +700,48 @@ /* child nodes are added in t6030-pmgr.dtsi */ }; + /* + * iBoot hands over a running SEP (ADT sepfw-load-at-boot). Keep + * Linux off its DART at boot; apple_sep enables it when the driver + * binds. The SEP only accepts IOVAs in the window iBoot programmed + * (ADT vm-base 0x10000004000, vm-size 0xffff0000), which carries + * the BIT(40) alias the DART translates. + */ + sep_dart: iommu@29cac0000 { + compatible = "apple,t6030-dart", "apple,t8110-dart"; + reg = <0x2 0x9cac0000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + #iommu-cells = <1>; + apple,dma-range = /bits/ 64 <0x10000004000 0xffff0000>; + apple,dma-offset = /bits/ 64 <0x0>; + status = "disabled"; + }; + + sep: sep@29e400000 { + compatible = "apple,sep"; + reg = <0x2 0x9e400000 0x0 0x6c000>; + mboxes = <&sep_mbox>; + mbox-names = "mbox"; + iommus = <&sep_dart 0>; + power-domains = <&ps_sep>; + status = "disabled"; + }; + + sep_mbox: mbox@29e408000 { + compatible = "apple,t6030-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x2 0x9e408000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + status = "disabled"; + }; + isp: isp@2c8000000 { compatible = "apple,t6030-isp"; iommus = <&isp_dart0 0>, <&isp_dart1 0>, <&isp_dart2 0>; From b805b5131b65159f6d005186fd604a8f2ab36c5f Mon Sep 17 00:00:00 2001 From: Adam Harris Date: Thu, 29 Oct 2026 13:36:32 -0600 Subject: [PATCH 2/3] arm64: dts: apple: t6030-j514s: enable Touch ID Enable the SEP mailbox, spi2 and the Mesa sensor (0x3352) on the 14" M3 Pro. Per the J514s ADT, the sensor is powered from NUB GPIO 33, active high. As on J613, its data-ready line (AP GPIO 200) is left out and the driver polls. The calibration comes from this Mac's own iBoot system container as apple/mesacal-j514s.bin. J516s shares the SoC, but its sensor wiring is unchecked, so it stays off. Assisted-by: LLM Signed-off-by: Adam Harris Co-Authored-By: Claude Opus 5.5 --- arch/arm64/boot/dts/apple/t6030-j514s.dts | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6030-j514s.dts b/arch/arm64/boot/dts/apple/t6030-j514s.dts index 61c929da3d6004..2adba06a356c7a 100644 --- a/arch/arm64/boot/dts/apple/t6030-j514s.dts +++ b/arch/arm64/boot/dts/apple/t6030-j514s.dts @@ -18,6 +18,10 @@ compatible = "apple,j514s", "apple,t6030", "apple,arm-platform"; model = "Apple MacBook Pro (14-inch, M3 Pro, Nov 2023)"; + aliases { + sep = &sep; + }; + chosen { asahi,t6030-dispext = "1"; }; @@ -97,3 +101,27 @@ &isp { apple,platform-id = <16>; }; + +/* apple_sep enables the SEP and its DART when it loads. */ +&sep_mbox { + status = "okay"; +}; + +/* + * Touch ID sensor (Mesa 0x3352, J514s ADT /arm-io/spi2/mesa): power on + * NUB GPIO 33, active high. As on J613, the data-ready line (AP GPIO 200) + * 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 33 GPIO_ACTIVE_HIGH>; + 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-j514s.bin"; +}; From 6373880fdee1887a01b01a1c7cecf0e0edd7e7e4 Mon Sep 17 00:00:00 2001 From: Adam Harris Date: Thu, 29 Oct 2026 13:36:33 -0600 Subject: [PATCH 3/3] soc: apple: sep: add a T6030/J514s profile The J514s SEP is pre-booted by iBoot and speaks the variant-5 key store, and its sensor is the same 0x3352 part T8122 carries, in SPI mode 1. So J514s takes the T8122 profile with its own spi2 base, including the wide DMA mask and xART guard level 1 from the first boot. Only J514s is matched; the other T6030 Mac (J516s) has not had its ADT read. Add a test that checks the J514s device tree against the ADT values and that J516s leaves the SEP and the sensor off. Tested on J514s, system firmware 27.0, with macOS on the same disk: - the SEP attaches warm and advertises 12 endpoints - the keybag is provisioned; the guard protects all 10 existing macOS session records and has refused nothing - the sensor answers 18 ms after power-on and registers its serial - enrolment and a match work, and a match still works after a reboot and after suspend - macOS Touch ID still works afterwards Assisted-by: LLM Signed-off-by: Adam Harris Co-Authored-By: Claude Opus 5.5 --- drivers/soc/apple/profile.rs | 28 +++++ drivers/soc/apple/xart_guard.rs | 1 + tools/aurora-sep/tests/test_t6030_sep.py | 132 +++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 tools/aurora-sep/tests/test_t6030_sep.py diff --git a/drivers/soc/apple/profile.rs b/drivers/soc/apple/profile.rs index 6803c1464652e0..f1e21e3f196318 100644 --- a/drivers/soc/apple/profile.rs +++ b/drivers/soc/apple/profile.rs @@ -425,6 +425,26 @@ pub(crate) const T8122: PlatformProfile = PlatformProfile { ..T8112 }; +/// MacBook Pro 14" M3 Pro (J514s). The J514s ADT (system firmware 27.0) records +/// a pre-booted SEP (`sepfw-load-at-boot`), an `iop-sep,ascwrap-v6` SEP and +/// its DART at the same addresses as T8122's, with the same BIT(40) aperture +/// (`vm-base` 0x10000004000, `vm-size` 0xffff0000). The Mesa sensor is the +/// `0x3352` part T8122 carries, on spi2 at `0x289108000`, 8 MHz, chip select +/// 0. Its power is NUB GPIO 33 and its data-ready line AP GPIO 200. +/// `/defaults` carries `cpx-encryption-mode = 2`. +/// +/// Otherwise T8122's warm-registration profile. J514s on system firmware 27.0 +/// attaches, provisions the keybag, enrols, matches, and still matches after a +/// reboot and after suspend; macOS Touch ID keeps working alongside it. +pub(crate) const T6030: PlatformProfile = PlatformProfile { + name: "T6030/J514s", + sensor: SensorProfile { + controller_base: 0x2_8910_8000, + ..T8122.sensor + }, + ..T8122 +}; + static_assert!(T8103.shmem_capacity == 0x30000); static_assert!(T6020.shmem_capacity == 0x40000); static_assert!(T8140.shmem_capacity == 0x40000); @@ -440,6 +460,9 @@ static_assert!(T8112.sensor.controller_base == T8103.sensor.controller_base); static_assert!(T8122.shmem_capacity == T8112.shmem_capacity); static_assert!(T8122.sensor.controller_base == 0x2a1108000); static_assert!(T8122.wide_dma_mask); +static_assert!(T6030.sensor.controller_base == 0x289108000); +static_assert!(T6030.sensor.expected_id == T8122.sensor.expected_id); +static_assert!(T6030.wide_dma_mask); /// Whether the machine root declares `compatible`. /// @@ -586,6 +609,11 @@ pub(crate) fn detect() -> Result<&'static PlatformProfile> { if machine_has(b"apple,t8122") && (machine_has(b"apple,j613") || machine_has(b"apple,j615")) { return Ok(&T8122); } + // Only the board whose ADT was read: J514s. The 16" M3 Pro (J516s) + // shares the SoC but its sensor wiring is unchecked. + if machine_has(b"apple,t6030") && machine_has(b"apple,j514s") { + return Ok(&T6030); + } Err(ENODEV) } diff --git a/drivers/soc/apple/xart_guard.rs b/drivers/soc/apple/xart_guard.rs index 6efb2a8609330f..a6036fa9430e03 100644 --- a/drivers/soc/apple/xart_guard.rs +++ b/drivers/soc/apple/xart_guard.rs @@ -1004,6 +1004,7 @@ mod tests { assert_eq!(level(-1, profile::T6020_SEPOS13.xart_guard), Some(1)); assert_eq!(level(-1, profile::T8112.xart_guard), Some(1)); assert_eq!(level(-1, profile::T8122.xart_guard), Some(1)); + assert_eq!(level(-1, profile::T6030.xart_guard), Some(1)); // Off on the Neo, whose Linux records predate the list. assert_eq!(level(-1, profile::T8140.xart_guard), None); assert_eq!(level(i8::MIN, 1), Some(1)); diff --git a/tools/aurora-sep/tests/test_t6030_sep.py b/tools/aurora-sep/tests/test_t6030_sep.py new file mode 100644 index 00000000000000..c6ed9e2ba4cfa2 --- /dev/null +++ b/tools/aurora-sep/tests/test_t6030_sep.py @@ -0,0 +1,132 @@ +"""T6030 (MacBook Pro 14" M3 Pro, J514s) SEP and Mesa sensor device tree and profile. + +Set DTC to this kernel's built scripts/dtc/dtc for Apple floating-point cells. +""" + +from pathlib import Path +import os +import re +import shutil +import subprocess +import tempfile +import unittest + + +ROOT = Path(__file__).resolve().parents[3] +DTS = ROOT / "arch/arm64/boot/dts/apple" +DTC = os.environ.get("DTC", "dtc") +PROFILE = (ROOT / "drivers/soc/apple/profile.rs").read_text() + +SEP_DART = "/soc/iommu@29cac0000" +SEP = "/soc/sep@29e400000" +BUS = "/soc/spi@289108000" +SENSOR = BUS + "/fingerprint@0" +PINCTRL_NUB = "/soc/pinctrl@3641f0000" +MBOX = "/soc/mbox@29e408000" +# AIC_IRQ cells: , IRQ_TYPE_LEVEL_HIGH = 4. +LEVEL_HIGH = 4 + + +@unittest.skipUnless(all(shutil.which(tool) for tool in ("cpp", DTC, "fdtget")), + "requires cpp, dtc and fdtget") +class T6030SepTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.temp = tempfile.TemporaryDirectory(prefix="aurora-t6030-sep-") + cls.addClassCleanup(cls.temp.cleanup) + cls.out = Path(cls.temp.name) + + def compile_board(self, board): + pp = subprocess.run(["cpp", "-nostdinc", "-undef", "-D__DTS__", "-x", + "assembler-with-cpp", "-I", str(ROOT / "include"), + "-I", str(DTS), str(DTS / f"t6030-{board}.dts")], + check=True, capture_output=True) + output = self.out / f"{board}.dtb" + subprocess.run([DTC, "-q", "-I", "dts", "-O", "dtb", "-o", str(output)], + input=pp.stdout, check=True, capture_output=True) + return output + + def prop(self, dtb, node, name, kind="x"): + return subprocess.run(["fdtget", "-t", kind, str(dtb), node, name], + check=True, capture_output=True, text=True).stdout.split() + + def props(self, dtb, node): + return subprocess.run(["fdtget", "-p", str(dtb), node], + check=True, capture_output=True, text=True).stdout.split() + + def cells(self, dtb, node, name): + return [int(cell, 16) for cell in self.prop(dtb, node, name)] + + def irqs(self, dtb, node): + cells = self.cells(dtb, node, "interrupts") + self.assertEqual(len(cells) % 3, 0) + triples = [cells[i:i + 3] for i in range(0, len(cells), 3)] + for kind, _, flags in triples: + self.assertEqual((kind, flags), (0, LEVEL_HIGH)) + return [irq for _, irq, _ in triples] + + def test_j514s_describes_sep_and_sensor(self): + dtb = self.compile_board("j514s") + # apple_sep enables the SEP and its DART at module load. + self.assertEqual(self.prop(dtb, SEP_DART, "status", "s"), ["disabled"]) + self.assertEqual(self.prop(dtb, SEP, "status", "s"), ["disabled"]) + self.assertEqual(self.prop(dtb, MBOX, "status", "s"), ["okay"]) + # ADT vm-base 0x10000004000, vm-size 0xffff0000, as on t8122. + self.assertEqual(self.cells(dtb, SEP_DART, "apple,dma-range"), + [0x100, 0x4000, 0, 0xffff0000]) + self.assertEqual(self.cells(dtb, SEP_DART, "apple,dma-offset"), [0, 0]) + self.assertEqual(self.prop(dtb, "/aliases", "sep", "s"), [SEP]) + + self.assertEqual(self.prop(dtb, BUS, "status", "s"), ["okay"]) + self.assertEqual(self.prop(dtb, SENSOR, "status", "s"), ["okay"]) + self.assertEqual(self.prop(dtb, SENSOR, "firmware-name", "s"), + ["apple/mesacal-j514s.bin"]) + nub = int(self.prop(dtb, PINCTRL_NUB, "phandle")[0], 16) + self.assertEqual(self.cells(dtb, SENSOR, "enable-gpios"), [nub, 33, 0]) + self.assertEqual(self.prop(dtb, SENSOR, "spi-max-frequency", "u"), ["8000000"]) + self.assertEqual(self.prop(dtb, SENSOR, "spi-cs-setup-delay-ns", "u"), ["20"]) + self.assertEqual(self.prop(dtb, SENSOR, "spi-cs-hold-delay-ns", "u"), ["20"]) + properties = self.props(dtb, SENSOR) + self.assertIn("spi-cpha", properties) + self.assertNotIn("spi-cpol", properties) + self.assertNotIn("interrupts", properties) + self.assertNotIn("cs-gpios", self.props(dtb, BUS)) + + def test_addresses_and_interrupts_match_the_adt(self): + # The J514s ADT values (system firmware 27.0), /arm-io base 0x210000000 added. + dtb = self.compile_board("j514s") + self.assertEqual(self.cells(dtb, SEP_DART, "reg"), [0x2, 0x9cac0000, 0, 0x4000]) + self.assertEqual(self.irqs(dtb, SEP_DART), [372]) + self.assertEqual(self.cells(dtb, SEP, "reg"), [0x2, 0x9e400000, 0, 0x6c000]) + self.assertEqual(self.cells(dtb, MBOX, "reg"), [0x2, 0x9e408000, 0, 0x4000]) + self.assertEqual(self.prop(dtb, MBOX, "interrupt-names", "s"), + ["send-empty", "send-not-empty", "recv-empty", "recv-not-empty"]) + self.assertEqual(self.irqs(dtb, MBOX), [366, 367, 368, 369]) + mbox = int(self.prop(dtb, MBOX, "phandle")[0], 16) + dart = int(self.prop(dtb, SEP_DART, "phandle")[0], 16) + self.assertEqual(self.cells(dtb, SEP, "mboxes"), [mbox]) + self.assertEqual(self.cells(dtb, SEP, "iommus"), [dart, 0]) + self.assertEqual(self.cells(dtb, BUS, "reg"), [0x2, 0x89108000, 0, 0x4000]) + self.assertEqual(self.irqs(dtb, BUS), [876]) + self.assertEqual(self.cells(dtb, SENSOR, "reg"), [0]) + + def test_j516s_leaves_sep_and_sensor_off(self): + dtb = self.compile_board("j516s") + self.assertNotIn("sep", self.props(dtb, "/aliases")) + self.assertEqual(self.prop(dtb, MBOX, "status", "s"), ["disabled"]) + self.assertEqual(self.prop(dtb, BUS, "status", "s"), ["disabled"]) + self.assertEqual(self.prop(dtb, SENSOR, "status", "s"), ["disabled"]) + + def test_profile_selected_only_on_j514s(self): + detect = PROFILE.split("pub(crate) fn detect()", 1)[1] + line = next(line for line in detect.splitlines() if 'b"apple,t6030"' in line) + self.assertIn('b"apple,j514s"', line) + profile = re.search(r"const T6030: PlatformProfile = PlatformProfile \{(.*?)\n\};", + PROFILE, re.S).group(1) + self.assertIn("..T8122", profile) + # The diagnostic controller base is spi2's, not T8122's. + self.assertIn("controller_base: 0x2_8910_8000", profile) + + +if __name__ == "__main__": + unittest.main()