From 70035185bd9c876357669f569811017f84724b0d Mon Sep 17 00:00:00 2001 From: Dj <43033058+DjDeveloperr@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:18:01 -0500 Subject: [PATCH 1/2] arm64/sep: describe J813 Touch ID and admit its T8142 profile Carry the J813 owner's SEP/mailbox/SPI/Mesa/DART block and board-specific calibration filenames. Add the SEP alias and expose AP GPIO200/NUB GPIO36 while preserving the audio pins. Admit J813 only alongside the existing J815 T8142 selector; retain other board and SoC admission boundaries. Based on @gig3m's supplied patch and owner report in linux#1532 comment 6837017905. Add KUnit selector cases for both accepted boards and unknown, missing or mismatched SoC/board identities. Local command creation failed with EAGAIN; these new cases require the hosted Rust/QEMU checks. This changes effective board admission: existing xart_writes=1 and provision_keybag=1 defaults remain, with profile-inherited guard level1. It is not read-only by default. Keep this follow-up draft pending SEP/XART policy review, CI and a decision on the separate aurora-xart model-reporting gap. No defaults, guard definitions, APFS checks or user state are changed. The reported single-finger/read-only-then-write/reboot/macOS checks do not qualify IRQ-only capture, multifinger, lockout or deep sleep. No hardware, XART write, enrolment, provisioning or loader action was executed here. Assisted-by: LLM --- arch/arm64/boot/dts/apple/t8142-j813.dts | 97 ++++++++++++++++++++++++ drivers/soc/apple/profile.rs | 27 ++++++- 2 files changed, 122 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8142-j813.dts b/arch/arm64/boot/dts/apple/t8142-j813.dts index 5b0c6299ae5b7..5889b852793a0 100644 --- a/arch/arm64/boot/dts/apple/t8142-j813.dts +++ b/arch/arm64/boot/dts/apple/t8142-j813.dts @@ -131,6 +131,12 @@ aliases { wifi0 = &n1_alpha; bluetooth0 = &n1_beta; + /* + * The loader finds the SEP through this alias: it reserves SEPFW + * and copies the boot's local-policy and iBoot manifests onto + * the node. + */ + sep = &sep; }; }; @@ -171,3 +177,94 @@ }; /* Unexposed chassis port instances remain described and disabled. */ + +/* + * Secure Enclave and the Touch ID sensor. All values are from the J813 ADT + * (macOS 27.0) and are the same as J815's: + * - sep: iop-sep,ascwrap-v6 at 0x30a600000 (0x88000), sepfw-booted, so + * apple_sep warm-attaches; ASC mailbox at +0x8000, AIC 445-448. + * - dart-sep: t8110 at 0x308b80000, irq 455; vm-base-0 0x10000004000, + * vm-size-0 0xffff0000. + * - spi2 at 0x3a5108000, irq 1241; PMGR device SPI2 at +0x440, parent SPI_P. + * - mesa: "biosensor,mesa", sensor-id 0x3356, 8 MHz, CS0; power + * function-mesa_pwr = NUB GPIO pin 36; data-ready interrupt on AP GPIO + * pin 200. + * The SEP and its DART stay disabled here: apple_sep enables them at module + * init (drivers/soc/apple/dt.rs). + */ +&pmgr { + ps_spi2: power-controller@440 { + compatible = "apple,t8142-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x440 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + power-domains = <&ps_spi_p>; + label = "spi2"; + }; +}; + +&{/soc} { + sep: sep@30a600000 { + compatible = "apple,sep"; + reg = <0x3 0x0a600000 0x0 0x88000>; + mboxes = <&sep_mbox>; + mbox-names = "mbox"; + iommus = <&sep_dart 0>; + status = "disabled"; + }; + + sep_mbox: mbox@30a608000 { + compatible = "apple,t8142-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x3 0x0a608000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + status = "okay"; + }; + + spi2: spi@3a5108000 { + compatible = "apple,t8142-spi", "apple,t8103-spi"; + reg = <0x3 0xa5108000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = ; + clocks = <&clkref>; + power-domains = <&ps_spi2>; + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + mesa: fingerprint@0 { + compatible = "apple,mesa-fingerprint"; + reg = <0>; + spi-max-frequency = <8000000>; + spi-cpol; + spi-cs-setup-delay-ns = <20>; + spi-cs-hold-delay-ns = <20>; + enable-gpios = <&pinctrl_nub 36 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&pinctrl_ap>; + interrupts = <200 IRQ_TYPE_EDGE_RISING>; + /* Per-device files, built from the Mac's own factory records. */ + firmware-name = "apple/mesacal-j813.bin", "apple/msrk-j813.bin"; + status = "okay"; + }; + }; +}; + +&sep_dart { + apple,dma-range = /bits/ 64 <0x10000004000 0xffff0000>; + apple,dma-offset = /bits/ 64 <0x0>; +}; + +/* Expose the sensor's two pins next to the ones sound uses. */ +&pinctrl_ap { + gpio-reserved-ranges = <0 100>, <101 49>, <152 48>, <201 23>; +}; + +&pinctrl_nub { + gpio-reserved-ranges = <0 18>, <19 17>, <37 3>; +}; diff --git a/drivers/soc/apple/profile.rs b/drivers/soc/apple/profile.rs index ac5f573455b91..622c9cef21039 100644 --- a/drivers/soc/apple/profile.rs +++ b/drivers/soc/apple/profile.rs @@ -710,8 +710,9 @@ fn select( if has(b"apple,t8132") && (has(b"apple,j713") || has(b"apple,j715")) { return Ok(&T8132); } - // Only the J815, whose ADT was read; the J813's sensor bus is unchecked. - if has(b"apple,t8142") && has(b"apple,j815") { + // The J815 and the J813, whose ADTs were read (macOS 27.0 stub firmware): + // the J813's SEP, its DART, spi2 and the Mesa node carry the J815's values. + if has(b"apple,t8142") && (has(b"apple,j815") || has(b"apple,j813")) { return Ok(&T8142); } Err(ENODEV) @@ -722,6 +723,28 @@ fn select( mod tests { use super::*; + #[test] + fn t8142_sensor_boards_require_the_matching_soc() { + let cases: [(&[u8], &[u8], bool); 7] = [ + (b"apple,t8142", b"apple,j813", true), + (b"apple,t8142", b"apple,j815", true), + (b"apple,t8142", b"apple,j814", false), + (b"apple,t8142", b"", false), + (b"", b"apple,j813", false), + (b"apple,t8132", b"apple,j813", false), + (b"apple,t6050", b"apple,j815", false), + ]; + for (soc, board, admitted) in cases { + let has = |c: &[u8]| c == soc || c == board; + let selected = select(&has, &|| &T6020); + if admitted { + assert!(matches!(selected, Ok(profile) if core::ptr::eq(profile, &T8142))); + } else { + assert!(selected.is_err()); + } + } + } + #[test] fn old_firmware_uses_the_legacy_key_store() { assert!(t6020_uses_sepos13(Some(b"iBoot-13822.79.1\0"))); From 8cc280603527502505725ee758e53b455203c9bb Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Thu, 12 Nov 2026 17:54:56 -0500 Subject: [PATCH 2/2] sep: name both T8142 Airs and cover J813 profile invariants Address Ryan's review5883010555 of the J813 follow-up. Name both J813 and J815 in the diagnostic profile label. Add J704 as a negative board, both Airs to the shared known-sensor test, T8142 to the BIT40 window test and an explicit level-one guard assertion. Compare the selected profile's stable name rather than promoted-constant pointer identity. The production selector is unchanged. Apart from the diagnostic label, T8142 profile fields, geometry, guard and defaults are exact previous source. The reviewer accepts aurora-xart model coverage as a separate utility PR; do not change it or user state here. The owner corrected the report: guard1 was explicitly configured, not inherited at runtime. Three actual KUnit bodies pass in a host Rust extraction using actual profile definitions, selector and exact-head known-sensor IDs. Host CStr/error/static-assert glue is used; this is not a kernel module, arm64 QEMU KUnit or physical default-policy test. Fresh hosted checks and the parent1532/loader-alias gate remain before merge. Assisted-by: LLM (Codex) --- drivers/soc/apple/profile.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/soc/apple/profile.rs b/drivers/soc/apple/profile.rs index 622c9cef21039..36814028c471b 100644 --- a/drivers/soc/apple/profile.rs +++ b/drivers/soc/apple/profile.rs @@ -500,17 +500,17 @@ pub(crate) const T8132: PlatformProfile = PlatformProfile { ..T8122 }; -/// MacBook Air 15" M5 (J815). The J815 ADT (macOS 27.0 stub firmware) puts +/// MacBook Air M5 (J813 and J815). Their ADTs (macOS 27.0 stub firmware) put /// the Mesa sensor (`V3`, the J700/J713/J714s generation) on spi2 at /// `0x3a5108000`, 8 MHz, chip select 0, with power on the NUB GPIO controller /// (pin 36) and data-ready on AP GPIO 200. The SEP is a pre-booted /// `iop-sep,ascwrap-v6` (`sepfw-booted`) behind a t8110 DART whose input /// aperture is the BIT(40) alias (`vm-base-0` 0x10000004000, `vm-size-0` /// 0xffff0000): the same SoC side as T8132 and T6050 (J714s, the M5 Pro). -/// So this is T8132's profile with the sensor bus moved. On J815 the SEP -/// attaches with it; the sensor session itself is not tested yet. +/// So this is T8132's profile with the sensor bus moved. J813 was tested +/// with explicit xart_guard=1; the inherited guard policy is unchanged. pub(crate) const T8142: PlatformProfile = PlatformProfile { - name: "T8142/J815", + name: "T8142/J813, J815", sensor: SensorProfile { controller_base: 0x3_a510_8000, ..T8132.sensor @@ -725,10 +725,12 @@ mod tests { #[test] fn t8142_sensor_boards_require_the_matching_soc() { - let cases: [(&[u8], &[u8], bool); 7] = [ + assert_eq!(T8142.xart_guard, 1); + let cases: [(&[u8], &[u8], bool); 8] = [ (b"apple,t8142", b"apple,j813", true), (b"apple,t8142", b"apple,j815", true), (b"apple,t8142", b"apple,j814", false), + (b"apple,t8142", b"apple,j704", false), (b"apple,t8142", b"", false), (b"", b"apple,j813", false), (b"apple,t8132", b"apple,j813", false), @@ -738,7 +740,7 @@ mod tests { let has = |c: &[u8]| c == soc || c == board; let selected = select(&has, &|| &T6020); if admitted { - assert!(matches!(selected, Ok(profile) if core::ptr::eq(profile, &T8142))); + assert!(matches!(selected, Ok(profile) if profile.name == T8142.name)); } else { assert!(selected.is_err()); } @@ -829,7 +831,7 @@ mod tests { /// profile naming one of the known Mesa revisions. #[test] fn every_touch_id_mac_gets_a_sensor_the_shared_path_decodes() { - let macs: [&[&[u8]]; 15] = [ + let macs: [&[&[u8]]; 17] = [ &[b"apple,j313", b"apple,t8103"], &[b"apple,j316s", b"apple,t6000"], &[b"apple,j316c", b"apple,t6001"], @@ -845,6 +847,8 @@ mod tests { &[b"apple,j713", b"apple,t8132"], &[b"apple,j700", b"apple,t8140"], &[b"apple,j714s", b"apple,t6050"], + &[b"apple,j813", b"apple,t8142"], + &[b"apple,j815", b"apple,t8142"], ]; for compatibles in macs { let has = |c: &[u8]| compatibles.iter().any(|x| *x == c); @@ -906,6 +910,7 @@ mod dart_window_tests { &T6041, &T6050, &T8132, + &T8142, ] { assert_eq!(offset(profile.dart_window), 1 << 40); assert_eq!(range(profile.dart_window), (0, 1 << 32));