From 077c62ee6d8c0326c9a25ffdfe89c4bed3efb280 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 27 Nov 2026 21:51:52 +1100 Subject: [PATCH] arm64: dts: apple: t6050: share Touch ID, add it to K114s, K114c and K116c The SEP mailbox and the Touch ID sensor (ADT spi2/mesa) were written out three times, in the J714s, J716c and K116s board files, while the K114s, K114c and K116c had neither. The live ADTs of the J714s, J716c, K114s and K116s and the 27.2 DeviceTrees of the K114c and K116c describe both alike: the SEP behind sep_mbox and ps_sep, the Mesa sensor on spi2 at 8 MHz on chip select 0, NUB GPIO 21 for power and AP GPIO 138 for data ready. Move the SEP part into t6050-sep.dtsi (was t6050-j716c-sep.dtsi) and the sensor into t6050-touchid.dtsi, which includes it. A board names its per-device calibration and root key in T6050_TOUCHID_FIRMWARE before the include; aurora-touchid-setup builds those files from the Mac's own iBoot System Container. The K boards' shared pin lists now leave pin 138 open. The J714s, J716c and K116s DTBs are unchanged apart from property order (identical after dtc -s). The K114s, K114c and K116c DTBs gain the sep alias, the mailbox and SEP power domain, the firmware-owned fabric parents (K116c only; the 14-inch boards already had them for the ANE), spi2 with fingerprint@0, and pin 138. The other five T6050 DTBs are byte-identical. dtschema reports nothing new. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-j714s.dts | 66 +----------------- .../arm64/boot/dts/apple/t6050-j716c-sep.dtsi | 29 -------- arch/arm64/boot/dts/apple/t6050-j716c.dts | 40 +---------- .../arm64/boot/dts/apple/t6050-k114-k116.dtsi | 7 +- arch/arm64/boot/dts/apple/t6050-k114.dtsi | 5 +- arch/arm64/boot/dts/apple/t6050-k114c.dts | 8 ++- arch/arm64/boot/dts/apple/t6050-k114s.dts | 4 ++ arch/arm64/boot/dts/apple/t6050-k116c.dts | 4 ++ arch/arm64/boot/dts/apple/t6050-k116s.dts | 68 +------------------ arch/arm64/boot/dts/apple/t6050-sep.dtsi | 34 ++++++++++ arch/arm64/boot/dts/apple/t6050-touchid.dtsi | 51 ++++++++++++++ 11 files changed, 115 insertions(+), 201 deletions(-) delete mode 100644 arch/arm64/boot/dts/apple/t6050-j716c-sep.dtsi create mode 100644 arch/arm64/boot/dts/apple/t6050-sep.dtsi create mode 100644 arch/arm64/boot/dts/apple/t6050-touchid.dtsi diff --git a/arch/arm64/boot/dts/apple/t6050-j714s.dts b/arch/arm64/boot/dts/apple/t6050-j714s.dts index 23475ad163f58..a411c8958d2f2 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714s.dts @@ -44,11 +44,6 @@ model = "Apple MacBook Pro (14-inch, M5 Pro, 2026)"; chassis-type = "laptop"; - aliases { - /* the boot loader reserves the SEP firmware and adds its manifests through this alias */ - sep = &sep; - }; - chosen { #address-cells = <2>; #size-cells = <2>; @@ -528,64 +523,9 @@ power-domains = <&pmp0_gfx>; }; -/* - * The SEP (ADT sep, dart-sep): its mailbox, and its power domain with the two - * fabric parents left to the firmware, which genpd votes on and never turns off. - * The boot loader enables the SEP itself through its alias. - */ -&sep_mbox { - status = "okay"; -}; - -&ps_sep { - status = "okay"; -}; - -&ps_fab8_soc { - apple,firmware-owned; - status = "okay"; -}; - -&ps_fab0_piogw { - apple,firmware-owned; - status = "okay"; -}; - -/* - * Touch ID (ADT spi2/mesa): J616s's Mesa sensor (sensor-id 0x3356) at 8 MHz on - * chip select 0, powered by NUB GPIO 21 (function-mesa_pwr), data ready on AP - * GPIO 138. The controller's clock (ADT clock-ids 451) is the 24 MHz reference. - */ -&ps_nub_gpio { - status = "okay"; -}; - -&nub_gpio0 { - status = "okay"; -}; - -&ps_spi2 { - status = "okay"; -}; - -&spi2 { - clocks = <&clkref>; - 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 = <&nub_gpio0 21 GPIO_ACTIVE_HIGH>; - interrupt-parent = <&pinctrl_ap>; - interrupts = <138 IRQ_TYPE_EDGE_RISING>; - /* Per-device factory data from this Mac's own iBoot system container */ - firmware-name = "apple/mesacal-j714s.bin", "apple/msrk-j714s.bin"; - }; -}; +/* Touch ID: the SEP and the Mesa sensor, with this Mac's own calibration and root key */ +#define T6050_TOUCHID_FIRMWARE "apple/mesacal-j714s.bin", "apple/msrk-j714s.bin" +#include "t6050-touchid.dtsi" /* * The ProRes engine (apr0) and its DART, in the SCODEC power state. Its diff --git a/arch/arm64/boot/dts/apple/t6050-j716c-sep.dtsi b/arch/arm64/boot/dts/apple/t6050-j716c-sep.dtsi deleted file mode 100644 index 23019a719e07b..0000000000000 --- a/arch/arm64/boot/dts/apple/t6050-j716c-sep.dtsi +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ OR MIT -/* J716c SEP handoff and the providers needed for warm registration. */ - -/ { - aliases { - /* The loader supplies the reserved image and registration manifests. */ - sep = &sep; - }; -}; - -/* The SEP and its DART are enabled by the driver after its policy is selected. */ -&sep_mbox { - status = "okay"; -}; - -&ps_sep { - status = "okay"; -}; - -/* Retain the fabric parents while the pre-booted enclave owns them. */ -&ps_fab8_soc { - apple,firmware-owned; - status = "okay"; -}; - -&ps_fab0_piogw { - apple,firmware-owned; - status = "okay"; -}; diff --git a/arch/arm64/boot/dts/apple/t6050-j716c.dts b/arch/arm64/boot/dts/apple/t6050-j716c.dts index 679e9f2f78856..0f496ab99e0a7 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716c.dts @@ -282,49 +282,15 @@ 63 2e 00 06 02 69 4f 53 00 00 00 00]; }; -/* - * Touch ID (ADT spi2/mesa), wired as on the J714s: the Mesa sensor (sensor-id - * 0x3356) at 8 MHz on chip select 0, powered by NUB GPIO 21 (function-mesa_pwr), - * data ready on AP GPIO 138. The controller's clock (ADT clock-ids 451) is the - * 24 MHz reference. - */ -&ps_nub_gpio { - status = "okay"; -}; - -&nub_gpio0 { - status = "okay"; -}; - -&ps_spi2 { - status = "okay"; -}; - -&spi2 { - clocks = <&clkref>; - 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 = <&nub_gpio0 21 GPIO_ACTIVE_HIGH>; - interrupt-parent = <&pinctrl_ap>; - interrupts = <138 IRQ_TYPE_EDGE_RISING>; - /* Per-device factory data from this Mac's own iBoot system container */ - firmware-name = "apple/mesacal-j716c.bin", "apple/msrk-j716c.bin"; - }; -}; +/* Touch ID: the SEP and the Mesa sensor, with this Mac's own calibration and root key */ +#define T6050_TOUCHID_FIRMWARE "apple/mesacal-j716c.bin", "apple/msrk-j716c.bin" +#include "t6050-touchid.dtsi" #include "t6050-j716c-isp.dtsi" #include "t6050-j716c-gpu-panel.dtsi" #include "t6050-j716c-display.dtsi" #include "t6050-j716c-left-usb4.dtsi" -#include "t6050-j716c-sep.dtsi" #include "t6050-j716c-sleep.dtsi" #include "t6050-j716c-sleep-full.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index d26d2621b38a0..b4945f66892b3 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi @@ -121,11 +121,12 @@ /* * As on J716c, where reading pin 112 takes an SError, only the pins a node - * names are exposed: 80, PCIe port 0's PERST#, and 134 and 139, the jack - * codec's interrupt and reset. A board that names more pins replaces the list. + * names are exposed: 80, PCIe port 0's PERST#; 134 and 139, the jack codec's + * interrupt and reset; 138, the Touch ID sensor's data-ready line + * (t6050-touchid.dtsi). A board that names more pins replaces the list. */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <81 53>, <135 4>, <140 81>; + gpio-reserved-ranges = <0 80>, <81 53>, <135 3>, <140 81>; }; /* diff --git a/arch/arm64/boot/dts/apple/t6050-k114.dtsi b/arch/arm64/boot/dts/apple/t6050-k114.dtsi index a895eebe32f03..4e84683dfc5be 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114.dtsi @@ -44,10 +44,11 @@ * Pin 112's register takes an SError when read, so only the pins a node names are * exposed: 80 (PCIe port 0's PERST#); 106 and 107, the speaker amps' interrupt and * shutdown line (ADT audio-speaker, used only where a board describes the amps); - * 134 and 139, the jack codec's interrupt and reset; 136 and 137, the speaker ID. + * 134 and 139, the jack codec's interrupt and reset; 136 and 137, the speaker ID; 138, the + * Touch ID sensor's data-ready line (t6050-touchid.dtsi). */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <81 25>, <108 26>, <135 1>, <138 1>, <140 81>; + gpio-reserved-ranges = <0 80>, <81 25>, <108 26>, <135 1>, <140 81>; }; /* diff --git a/arch/arm64/boot/dts/apple/t6050-k114c.dts b/arch/arm64/boot/dts/apple/t6050-k114c.dts index 7550e9838e9a3..23e1a45cb9974 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -158,6 +158,10 @@ /* The GPU, handed over by the boot loader */ #include "t6050-k114-k116-gpu.dtsi" +/* Touch ID: the SEP and the Mesa sensor, with this Mac's own calibration and root key */ +#define T6050_TOUCHID_FIRMWARE "apple/mesacal-k114c.bin", "apple/msrk-k114c.bin" +#include "t6050-touchid.dtsi" + /* * The K114c keeps J714's card with its speakers, at the J714's safe level. The * chassis' K114 entry (t6050-k114.dtsi) has the jack only. @@ -307,10 +311,10 @@ * Pin 112's register takes an SError when read, so only the pins a node here * names are exposed: 80 and 81 (PCIe ports 0 and 1's PERST#); 106 and 107, the speaker * amps' interrupt and shutdown line; 134 and 139, the jack codec's interrupt and - * reset; 136 and 137, the speaker ID. + * reset; 136 and 137, the speaker ID; 138, the Touch ID sensor's data-ready line. */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <138 1>, <140 81>; + gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <140 81>; }; /* It answers only once port 1's root complex is up: pcie-apple then enables it */ diff --git a/arch/arm64/boot/dts/apple/t6050-k114s.dts b/arch/arm64/boot/dts/apple/t6050-k114s.dts index 41059929b296e..234cb5d5eceee 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114s.dts @@ -36,6 +36,10 @@ /* The GPU, handed over by the boot loader */ #include "t6050-k114-k116-gpu.dtsi" +/* Touch ID: the SEP and the Mesa sensor, with this Mac's own calibration and root key */ +#define T6050_TOUCHID_FIRMWARE "apple/mesacal-k114s.bin", "apple/msrk-k114s.bin" +#include "t6050-touchid.dtsi" + / { aliases { /* asahi-bless and the boot loader find the NVRAM partition by this alias */ diff --git a/arch/arm64/boot/dts/apple/t6050-k116c.dts b/arch/arm64/boot/dts/apple/t6050-k116c.dts index 40bfec8ab72a8..6bc716bfc0f42 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116c.dts @@ -29,5 +29,9 @@ /* The GPU, handed over by the boot loader */ #include "t6050-k114-k116-gpu.dtsi" +/* Touch ID: the SEP and the Mesa sensor, with this Mac's own calibration and root key */ +#define T6050_TOUCHID_FIRMWARE "apple/mesacal-k116c.bin", "apple/msrk-k116c.bin" +#include "t6050-touchid.dtsi" + /* The USB-C ports ATC1 and ATC2, as on the other K boards */ #include "t6050-k114-k116-usb.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index 26f4bce4362db..44490669d152b 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -26,13 +26,6 @@ #define T6050_K116S #include "t6050-peripherals.dtsi" -/ { - aliases { - /* the boot loader reserves the SEP firmware and adds its manifests through this alias */ - sep = &sep; - }; -}; - &pinctrl_ap { /* * Pin 112 takes an SError when read, so only the pins a node names are @@ -322,29 +315,6 @@ #include "t6050-k116s-pmp-tunables.dtsi" -/* - * The SEP (ADT sep, dart-sep), as on the J714s: its mailbox, and its power domain with the two - * fabric parents left to the firmware, which genpd votes on and never turns off. The boot - * loader enables the SEP itself through its alias. - */ -&sep_mbox { - status = "okay"; -}; - -&ps_sep { - status = "okay"; -}; - -&ps_fab8_soc { - apple,firmware-owned; - status = "okay"; -}; - -&ps_fab0_piogw { - apple,firmware-owned; - status = "okay"; -}; - /* Sound: the J714s description, every value checked against the K116s ADT. */ /* * The amps' shared shutdown line (SDZ): ADT audio-speaker function-reset, AP pin 107. One @@ -680,41 +650,9 @@ status = "okay"; }; -/* - * Touch ID (ADT spi2/mesa): the Mesa sensor on spi2 at 8 MHz, chip select 0, - * powered by NUB GPIO 21 (function-mesa_pwr), data ready on AP GPIO 138, as - * on the J714s. spi2 runs from the 24 MHz reference (ADT clock-ids 451). - */ -&ps_nub_gpio { - status = "okay"; -}; - -&nub_gpio0 { - status = "okay"; -}; - -&ps_spi2 { - status = "okay"; -}; - -&spi2 { - clocks = <&clkref>; - 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 = <&nub_gpio0 21 GPIO_ACTIVE_HIGH>; - interrupt-parent = <&pinctrl_ap>; - interrupts = <138 IRQ_TYPE_EDGE_RISING>; - /* Per-device factory data from this Mac's own iBoot system container */ - firmware-name = "apple/mesacal-k116s.bin", "apple/msrk-k116s.bin"; - }; -}; +/* Touch ID: the SEP and the Mesa sensor, with this Mac's own calibration and root key */ +#define T6050_TOUCHID_FIRMWARE "apple/mesacal-k116s.bin", "apple/msrk-k116s.bin" +#include "t6050-touchid.dtsi" /* * The PMU's RTC and its alarm. ADT: the PMU's info-rtc (0x2002), diff --git a/arch/arm64/boot/dts/apple/t6050-sep.dtsi b/arch/arm64/boot/dts/apple/t6050-sep.dtsi new file mode 100644 index 0000000000000..102b254178a1d --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-sep.dtsi @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * The SEP (ADT sep, dart-sep) on the T6050 laptops: its mailbox, and its power domain with the + * two fabric parents left to the firmware, which genpd votes on and never turns off. The SEP + * and its DART stay disabled here: apple_sep enables them after it selects its policy, and only + * where the mailbox is enabled. + * + * Included after t6050-peripherals.dtsi. + */ + +/ { + aliases { + /* the boot loader reserves the SEP firmware and adds its manifests through this alias */ + sep = &sep; + }; +}; + +&sep_mbox { + status = "okay"; +}; + +&ps_sep { + status = "okay"; +}; + +&ps_fab8_soc { + apple,firmware-owned; + status = "okay"; +}; + +&ps_fab0_piogw { + apple,firmware-owned; + status = "okay"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-touchid.dtsi b/arch/arm64/boot/dts/apple/t6050-touchid.dtsi new file mode 100644 index 0000000000000..0d7cb8986b809 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-touchid.dtsi @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Touch ID on the T6050 laptops: the SEP (t6050-sep.dtsi) and the Mesa sensor (ADT spi2/mesa). + * The live ADTs of the J714s, J716c, K114s and K116s and the 27.2 DeviceTrees of the other + * boards describe it alike: spi2 at 8 MHz, chip select 0, powered by NUB GPIO 21 + * (function-mesa_pwr), data ready on AP GPIO 138. spi2 runs from the 24 MHz reference (ADT + * clock-ids 451). + * + * The board defines T6050_TOUCHID_FIRMWARE before including this file: the sensor's + * calibration and signed root key, per-device factory data that aurora-touchid-setup builds + * from this Mac's own iBoot System Container. The board also leaves AP pin 138 out of its + * gpio-reserved-ranges. + * + * Included after t6050-peripherals.dtsi. + */ + +#ifndef T6050_TOUCHID_FIRMWARE +#error "define T6050_TOUCHID_FIRMWARE (calibration, root key) before including t6050-touchid.dtsi" +#endif + +#include "t6050-sep.dtsi" + +&ps_nub_gpio { + status = "okay"; +}; + +&nub_gpio0 { + status = "okay"; +}; + +&ps_spi2 { + status = "okay"; +}; + +&spi2 { + clocks = <&clkref>; + 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 = <&nub_gpio0 21 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&pinctrl_ap>; + interrupts = <138 IRQ_TYPE_EDGE_RISING>; + firmware-name = T6050_TOUCHID_FIRMWARE; + }; +};