From 0e4972eea0be12ce816e165ccbabc4a1e6817fdf Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 27 Nov 2026 17:06:09 +1100 Subject: [PATCH 1/5] arm64: dts: apple: t6050: share the K boards' PMU RTC, add K114c, K114s and K116c Only the K116s described the PMU's RTC and alarm. The K114c, K114s and K116c had the SMC's RTC only, so they had no alarm to wake a firmware sleep from. The four boards' ADTs (27.2) give the PMU, nub-spmi0/spmi-abbeyL1, the same RTC registers: info-rtc 0x2002, info-rtc_alarm_ctrl 0x2000, info-rtc_alarm_offset 0x2008, info-rtc_irq_mask_offset 0x200e, info-rtc_scrpad 0x2100 and info-clock_offset <0x2100 6>, the T6041 PMU's layout. The live K114s ADT has the same values. So the K116s node moves into t6050-k114-k116.dtsi unchanged. The K116s DTB and the other T6050 DTBs are byte-identical; K114c, K114s and K116c gain only the rtc node under the PMU. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi | 17 +++++++++++++++++ arch/arm64/boot/dts/apple/t6050-k116s.dts | 16 ---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index d26d2621b38a0..d09519d17008b 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi @@ -198,6 +198,23 @@ }; }; +/* + * The PMU's RTC and its alarm. The four boards' ADTs (27.2) give the PMU + * (nub-spmi0/spmi-abbeyL1) the same registers: info-rtc (0x2002), + * info-rtc_alarm_offset (0x2008), info-rtc_irq_mask_offset (0x200e), + * info-rtc_alarm_ctrl (0x2000) and info-rtc_scrpad (0x2100), the registers of + * the T6041 PMU. It raises no interrupt on this SoC: an armed alarm can only + * wake the machine from a firmware sleep, not from s2idle. + */ +&pmu { + pmu_rtc: rtc { + compatible = "apple,t6050-pmu-rtc", "apple,t6041-pmu-rtc"; + nvmem-cells = <&rtc_offset>; + nvmem-cell-names = "rtc_offset"; + wakeup-source; + }; +}; + /* These boards' SMC fan and power keys are not yet checked */ &smc_hwmon { status = "disabled"; diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index 26f4bce4362db..f1f22f256a3c1 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -716,22 +716,6 @@ }; }; -/* - * The PMU's RTC and its alarm. ADT: the PMU's info-rtc (0x2002), - * info-rtc_alarm_offset (0x2008), info-rtc_irq_mask_offset (0x200e), - * info-rtc_alarm_ctrl (0x2000) and info-rtc_scrpad (0x2100), the registers of - * the T6041 PMU. It raises no interrupt on this SoC: an armed alarm can only - * wake the machine from a firmware sleep, not from s2idle. - */ -&pmu { - pmu_rtc: rtc { - compatible = "apple,t6050-pmu-rtc", "apple,t6041-pmu-rtc"; - nvmem-cells = <&rtc_offset>; - nvmem-cell-names = "rtc_offset"; - wakeup-source; - }; -}; - /* * The video encoder's power states, as on the J714s. iBoot leaves VENC0_SYS on, and the SoC does * not enter the firmware-driven sleep with it on. Enabled and unused, genpd turns it off at From 92497fd80fedd15ef80690e28d0830f3377c4a82 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 27 Nov 2026 17:16:26 +1100 Subject: [PATCH 2/5] arm64: dts: apple: t6050: give the K boards' port 1 DART its power domain dart_apcie1, PCIe port 1's DART (the SD reader's, ADT /arm-io/dart-apcie1 at 0x411000000), names no power domain. The K114c enables it with no domain, and the DART power-domain check flags it on every K board that gains the SD reader. The ADT gives dart-apcie1 no power-gates of its own: it sits in the apcie block, whose power-gates (ADT apcie0) start with APCIE_GP and APCIE_SYS_GP, next to port 0's DART, which takes APCIE_SYS_GP since "give the K boards' port 0 DART its power domain". The T6040's apcie1_dart at the same address takes ps_apcie_sys_gp too. So dart_apcie1 takes ps_apcie_sys_gp, which t6050-k114-k116-usb.dtsi already enables as firmware-owned on all four boards. The four K board DTBs gain only that power-domains property; the other T6050 DTBs are byte-identical. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index d09519d17008b..0f862e9bfecd1 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi @@ -335,3 +335,11 @@ power-domains = <&ps_apcie_sys_gp>; }; +/* + * Port 1's DART (dart-apcie1, the SD reader's) sits in the same apcie block as port 0's and + * takes the same APCIE_SYS_GP, as the T6040's apcie1_dart at the same address does. + */ +&dart_apcie1 { + power-domains = <&ps_apcie_sys_gp>; +}; + From eb35c3ded81d8d1d98e2bcec1a78f5a5ecd23fdd Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 27 Nov 2026 17:18:02 +1100 Subject: [PATCH 3/5] arm64: dts: apple: t6050-k116s: take the SD reader's DART from t6050-die0.dtsi The tree has two nodes for ADT /arm-io/dart-apcie1 (0x411000000): dart_apcie1 in t6050-die0.dtsi, under the SoC bus, and apcie1_dart in t6050-peripherals.dtsi, under /soc. The K114c and J714s map PCIe port 1 through dart_apcie1; the K116s alone enables apcie1_dart, which names no power domain. Map port 1 through dart_apcie1 on the K116s too, as the K114c does: the iommu-map, post-init-providers and the enabled, manual-availability node now refer to it, and the port's DART gets the APCIE_SYS_GP domain the K boards give it. apcie1_dart is left disabled, as on every other T6050 board. That also lets the K boards share one port 1 description. Only the K116s DTB changes: dart_apcie1 is enabled with apple,manual-availability instead of apcie1_dart. The DART power-domain check counts one finding fewer. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-k116s.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index f1f22f256a3c1..bae730eeb2e4d 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -82,9 +82,9 @@ ; interrupt-names = "port0", "port1"; iommu-map = <0x100 &dart_apcie0 1 3>, - <0x200 &apcie1_dart 1 1>; - /* apcie1_dart probes only once port 1 is up: the host must not wait for it */ - post-init-providers = <&apcie1_dart>; + <0x200 &dart_apcie1 1 1>; + /* dart_apcie1 probes only once port 1 is up: the host must not wait for it */ + post-init-providers = <&dart_apcie1>; port01: pci@1,0 { device_type = "pci"; @@ -141,7 +141,7 @@ }; /* ADT dart-apcie1 manual-availability: pcie-apple enables it once port 1 is up */ -&apcie1_dart { +&dart_apcie1 { apple,manual-availability; status = "okay"; }; From 48d9f3950f8962814e9b60890209daa0f92b3a53 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 27 Nov 2026 17:20:42 +1100 Subject: [PATCH 4/5] arm64: dts: apple: t6050: share the K boards' SD card reader, add K114s and K116c Only the K114c and K116s described PCIe port 1 and its SD card reader, each in its own copy; the K114s and K116c had no SD reader. The four boards' ADTs (27.2) have the same apcie0 port 1: port1, phy1 and intr2axi1 at reg[22], reg[24] and reg[25], the shared PHY state at reg[3], IRQ 1531, pci-bridge1 function-perst on gpio0 pin 0x51 (81), and a pcie-sdreader with function-sd_pwr_en pKW8('pcIO', 0x0, 0x190000) and card-detect and write-protect polarity 1, behind dart-apcie1. The live K114s ADT has pci-bridge1's link tunables as the K114c description has them: apcie-config-tunables, pcie-rc-tunables and pcie-rc-gen3/4/5- shadow-tunables. So: - t6050-k114-k116.dtsi describes port 1, the GL9755 and dart_apcie1 as the K114c did, adds sd_pwr_en as pcIO output 3 after the three shared ones and exposes pin 81. - t6050-k114.dtsi exposes pin 81 for the 14-inch boards. - The K114c keeps none of it in its own file. - The K116s keeps its single pcIO output and points port 1's power at it (output 0). The K114c and K116s DTBs are byte-identical, as are the other T6050 DTBs. The K114s and K116c gain port 1 with the SD reader, dart_apcie1, the fourth pcIO output and pin 81. The shared block is Joshua Warren's K114c description, tested on the K114c. Signed-off-by: Ryan Murray --- .../arm64/boot/dts/apple/t6050-k114-k116.dtsi | 125 +++++++++++++++--- arch/arm64/boot/dts/apple/t6050-k114.dtsi | 9 +- arch/arm64/boot/dts/apple/t6050-k114c.dts | 102 -------------- arch/arm64/boot/dts/apple/t6050-k116s.dts | 103 +-------------- 4 files changed, 116 insertions(+), 223 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index 0f862e9bfecd1..a3c456952078b 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 and 81, PCIe ports 0 and 1's PERST#, and 134 and 139, + * the jack codec's interrupt and reset. 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>, <82 52>, <135 4>, <140 81>; }; /* @@ -141,19 +142,48 @@ * (T6050_K_BOARD_ID). The N1's platform ID is board-id << 16 | chip 0x6050. * aura's T6050 hand-off wants the host's iommu-map to mark the ports as it * found them. + * + * PCIe port 1: the SD card reader (ADT apcie0/pci-bridge1/pcie-sdreader, a + * GL9755), the same on all four boards' ADTs and laid out as on J714s. The + * boot loader leaves the port down, so the kernel trains it. From the ADTs: + * port1, phy1, intr2axi1: apcie0 reg[22], reg[24], reg[25] (port 0's are + * reg[16], reg[18], reg[19]), behind /arm-io's ranges (+0x200000000) + * phy-shared: apcie0 reg[3], the shared PHY's state, which the train reads; + * the boot loader leaves the PHY up with port 0 + * IRQ 1531: apcie0 interrupts[1] + * PERST#: pci-bridge1 function-perst, gpio0 pin 0x51 (81) + * power: pcie-sdreader function-sd_pwr_en, SMC pcIO (0x0, 0x190000), output + * 3 of smc_pcio below + * link tunables: pci-bridge1's apcie-config-tunables, pcie-rc-tunables and + * pcie-rc-gen{3,4,5}-shadow-tunables, as (offset, size, mask, value) + * The reader is behind dart-apcie1 (0x211000000, IRQ 1532; manual-availability: + * it answers only once the root complex is up). The ADT's mapper-apcie1 names + * no stream (the bridge requests one at run time), so stream 1 is this tree's + * choice, below the DART's first bypass stream (16), as on J714s. + * pci-bridge1's function-clkreq (gpio0 pin 0x4d) is not described: the + * driver does not take CLKREQ# lines. */ &pcie0 { - iommu-map = <0x100 &dart_apcie0 1 3>; + iommu-map = <0x100 &dart_apcie0 1 3>, + <0x200 &dart_apcie1 1 1>; bus-range = <0 4>; status = "okay"; reg = <0x1c 0xb0000000 0x0 0x10000000>, <0x4 0x14000000 0x0 0x4000>, <0x4 0x10028000 0x0 0x8000>, <0x4 0x17010000 0x0 0x4000>, - <0x4 0x10024000 0x0 0x4000>; - reg-names = "config", "rc", "port0", "phy0", "intr2axi0"; - interrupts = ; - interrupt-names = "port0"; + <0x4 0x10024000 0x0 0x4000>, + <0x4 0x11028000 0x0 0x8000>, + <0x4 0x17014000 0x0 0x4000>, + <0x4 0x11024000 0x0 0x4000>, + <0x4 0x17020000 0x0 0x4000>; + reg-names = "config", "rc", "port0", "phy0", "intr2axi0", "port1", "phy1", "intr2axi1", + "phy-shared"; + interrupts = , + ; + interrupt-names = "port0", "port1"; + /* dart_apcie1 probes only once port 1 is up: the host must not wait for it */ + post-init-providers = <&dart_apcie1>; port00: pci@0,0 { device_type = "pci"; @@ -196,6 +226,70 @@ local-bd-address = [00 00 00 00 00 00]; }; }; + + port01: pci@1,0 { + device_type = "pci"; + reg = <0x800 0 0 0 0>; + bus-range = <2 2>; + /* Down at boot: the kernel trains it, powering the reader first */ + apple,link-trained-by-bootloader; + /* ADT pcie-sdreader function-sd_pwr_en: SMC pcIO output 3 below */ + pwren-gpios = <&smc_pcio 3 GPIO_ACTIVE_HIGH>; + /* PERST#: ADT pci-bridge1 function-perst, GPIO 81 */ + reset-gpios = <&pinctrl_ap 81 GPIO_ACTIVE_LOW>; + /* ADT pci-bridge1 */ + apple,apcie-config-tunables = <0x140 4 0x1 0x1>, + <0x144 4 0xffffff 0x253770>, + <0x8a8 4 0x1 0x1>, + <0x8ac 4 0x1 0x1>; + apple,pcie-rc-tunables = <0x78 4 0x7000 0x0>, + <0x194 4 0x2 0x2>, + <0xb80 4 0x7f3f3f 0x7f1e1e>, + <0xb88 4 0x7f3f3f 0x7f1e1e>; + apple,pcie-rc-gen3-shadow-tunables = <0x154 4 0xf0f0f0f 0x5050505>, + <0x890 4 0x3000000 0x0>, + <0x8a8 4 0xffff0f 0x1>; + apple,pcie-rc-gen4-shadow-tunables = <0x178 4 0xffff 0x5555>, + <0x890 4 0x3000000 0x1000000>, + <0x8a8 4 0xffff0f 0x1>; + apple,pcie-rc-gen5-shadow-tunables = <0x1ac 4 0xffff 0x5555>, + <0x890 4 0x3000000 0x2000000>, + <0x8a8 4 0xffff0f 0x1>; + + #address-cells = <3>; + #size-cells = <2>; + ranges; + + interrupt-controller; + #interrupt-cells = <1>; + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &port01 0 0 0 0>, + <0 0 0 2 &port01 0 0 0 1>, + <0 0 0 3 &port01 0 0 0 2>, + <0 0 0 4 &port01 0 0 0 3>; + + /* + * The GL9755. Card detect and write protect are active high: ADT + * pcie-sdreader card-detect-polarity and write-protect-polarity = 1. + */ + sdhci0: mmc@0,0 { + compatible = "pci17a0,9755"; + reg = <0x20000 0x0 0x0 0x0 0x0>; + cd-inverted; + wp-inverted; + }; + }; +}; + +/* + * ADT dart-apcie1 manual-availability: pcie-apple enables it once port 1 is up. It sits in + * the same apcie block as port 0's DART and takes the same APCIE_SYS_GP (enabled in + * t6050-k114-k116-usb.dtsi), as the T6040's apcie1_dart at the same address does. + */ +&dart_apcie1 { + power-domains = <&ps_apcie_sys_gp>; + apple,manual-availability; + status = "okay"; }; /* @@ -318,10 +412,13 @@ /* * The board's pcIO outputs, from the ADT: dp2hdmi_pwr_en pKW8('pcIO', 0, 0x1a0000), * hdmi_pwr_en pKW8('pcIO', 0x800000, 0xf0000), and the trackpad AFE reset (2), - * pKW8('pcIO', 0x10000, 0x11c0000); the same as on J716c. + * pKW8('pcIO', 0x10000, 0x11c0000), the same as on J716c; then the SD reader's + * power (3), sd_pwr_en pKW8('pcIO', 0x0, 0x190000): ADT pcie-sdreader + * function-sd_pwr_en. */ &smc_pcio { - apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 0x011c000000010000>; + apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 + 0x011c000000010000 0x0019000000000000>; }; /* @@ -335,11 +432,3 @@ power-domains = <&ps_apcie_sys_gp>; }; -/* - * Port 1's DART (dart-apcie1, the SD reader's) sits in the same apcie block as port 0's and - * takes the same APCIE_SYS_GP, as the T6040's apcie1_dart at the same address does. - */ -&dart_apcie1 { - power-domains = <&ps_apcie_sys_gp>; -}; - diff --git a/arch/arm64/boot/dts/apple/t6050-k114.dtsi b/arch/arm64/boot/dts/apple/t6050-k114.dtsi index a895eebe32f03..ac9f638d7ee27 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114.dtsi @@ -42,12 +42,13 @@ /* * 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. + * exposed: 80 and 81 (PCIe ports 0 and 1'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. */ &pinctrl_ap { - gpio-reserved-ranges = <0 80>, <81 25>, <108 26>, <135 1>, <138 1>, <140 81>; + gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <138 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..ac5ef78196fbf 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -225,105 +225,3 @@ }; }; }; - -/* - * PCIe port 1: the SD card reader, this board's own beside the shared port 0 - * (t6050-k114-k116.dtsi): its registers, interrupt and DART stream 1 of dart-apcie1. - */ -&pcie0 { - reg = <0x1c 0xb0000000 0x0 0x10000000>, - <0x4 0x14000000 0x0 0x4000>, - <0x4 0x10028000 0x0 0x8000>, - <0x4 0x17010000 0x0 0x4000>, - <0x4 0x10024000 0x0 0x4000>, - <0x4 0x11028000 0x0 0x8000>, - <0x4 0x17014000 0x0 0x4000>, - <0x4 0x11024000 0x0 0x4000>, - <0x4 0x17020000 0x0 0x4000>; - reg-names = "config", "rc", "port0", "phy0", "intr2axi0", "port1", "phy1", "intr2axi1", - "phy-shared"; - interrupts = , - ; - interrupt-names = "port0", "port1"; - iommu-map = <0x100 &dart_apcie0 1 3>, - <0x200 &dart_apcie1 1 1>; - /* dart_apcie1 probes only once port 1 is up: the host must not wait for it */ - post-init-providers = <&dart_apcie1>; - - /* - * PCIe port 1: the SD card reader (ADT pci-bridge1/pcie-sdreader, a GL9755), as on - * J714s. The boot loader leaves it down, so the kernel trains it: power is the SMC - * pcIO output of function-sd_pwr_en (index 3 below), PERST# GPIO 81, IRQ 1531. It is - * on stream 1 of dart-apcie1. The link tunables are pci-bridge1's, as on port 0. - */ - port01: pci@1,0 { - device_type = "pci"; - reg = <0x800 0 0 0 0>; - bus-range = <2 2>; - apple,link-trained-by-bootloader; - pwren-gpios = <&smc_pcio 3 GPIO_ACTIVE_HIGH>; - reset-gpios = <&pinctrl_ap 81 GPIO_ACTIVE_LOW>; - apple,apcie-config-tunables = <0x140 4 0x1 0x1>, - <0x144 4 0xffffff 0x253770>, - <0x8a8 4 0x1 0x1>, - <0x8ac 4 0x1 0x1>; - apple,pcie-rc-tunables = <0x78 4 0x7000 0x0>, - <0x194 4 0x2 0x2>, - <0xb80 4 0x7f3f3f 0x7f1e1e>, - <0xb88 4 0x7f3f3f 0x7f1e1e>; - apple,pcie-rc-gen3-shadow-tunables = <0x154 4 0xf0f0f0f 0x5050505>, - <0x890 4 0x3000000 0x0>, - <0x8a8 4 0xffff0f 0x1>; - apple,pcie-rc-gen4-shadow-tunables = <0x178 4 0xffff 0x5555>, - <0x890 4 0x3000000 0x1000000>, - <0x8a8 4 0xffff0f 0x1>; - apple,pcie-rc-gen5-shadow-tunables = <0x1ac 4 0xffff 0x5555>, - <0x890 4 0x3000000 0x2000000>, - <0x8a8 4 0xffff0f 0x1>; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - interrupt-controller; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 7>; - interrupt-map = <0 0 0 1 &port01 0 0 0 0>, - <0 0 0 2 &port01 0 0 0 1>, - <0 0 0 3 &port01 0 0 0 2>, - <0 0 0 4 &port01 0 0 0 3>; - - /* The GL9755; card detect and write protect active high (ADT *-polarity = 1) */ - sdhci0: mmc@0,0 { - compatible = "pci17a0,9755"; - reg = <0x20000 0x0 0x0 0x0 0x0>; - cd-inverted; - wp-inverted; - }; - }; -}; - -/* - * 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. - */ -&pinctrl_ap { - gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <138 1>, <140 81>; -}; - -/* It answers only once port 1's root complex is up: pcie-apple then enables it */ -&dart_apcie1 { - apple,manual-availability; - status = "okay"; -}; - -/* - * The board's pcIO outputs (t6050-k114-k116.dtsi lists indices 0 to 2), plus index 3, - * sd_pwr_en pKW8('pcIO', 0x0, 0x190000): ADT pcie-sdreader function-sd_pwr_en. - */ -&smc_pcio { - apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 - 0x011c000000010000 0x0019000000000000>; -}; diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index bae730eeb2e4d..fc9e3efc23e53 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -44,106 +44,11 @@ }; /* - * PCIe port 0, the N1, is in t6050-k114-k116.dtsi. - * - * PCIe port 1: the SD card reader (ADT apcie0/pci-bridge1/pcie-sdreader, a - * GL9755), as on J714s. The boot loader leaves the port down, so the kernel - * trains it. From this board's ADT: - * port1, phy1, intr2axi1: apcie0 reg[22], reg[24], reg[25] (port 0's are - * reg[16], reg[18], reg[19]), behind /arm-io's ranges (+0x200000000) - * phy-shared: apcie0 reg[3], the shared PHY's state, which the train reads; - * the boot loader leaves the PHY up with port 0 - * IRQ 1531: apcie0 interrupts[1] - * PERST#: pci-bridge1 function-perst, gpio0 pin 0x51 (81) - * power: pcie-sdreader function-sd_pwr_en, SMC pcIO (0x0, 0x190000), output - * 0 of smc_pcio below - * link tunables: pci-bridge1's apcie-config-tunables, pcie-rc-tunables and - * pcie-rc-gen{3,4,5}-shadow-tunables, as (offset, size, mask, value) - * The reader is behind dart-apcie1 (0x211000000, IRQ 1532; manual-availability: - * it answers only once the root complex is up). The ADT's mapper-apcie1 names - * no stream (the bridge requests one at run time), so stream 1 is this tree's - * choice, below the DART's first bypass stream (16), as on J714s. - * pci-bridge1's function-clkreq (gpio0 pin 0x4d) is not described: the - * driver does not take CLKREQ# lines. + * PCIe port 0 (the N1) and port 1 (the SD card reader) are in t6050-k114-k116.dtsi. + * This board drives one SMC pcIO output (below), so the reader's power is output 0. */ -&pcie0 { - reg = <0x1c 0xb0000000 0x0 0x10000000>, - <0x4 0x14000000 0x0 0x4000>, - <0x4 0x10028000 0x0 0x8000>, - <0x4 0x17010000 0x0 0x4000>, - <0x4 0x10024000 0x0 0x4000>, - <0x4 0x11028000 0x0 0x8000>, - <0x4 0x17014000 0x0 0x4000>, - <0x4 0x11024000 0x0 0x4000>, - <0x4 0x17020000 0x0 0x4000>; - reg-names = "config", "rc", "port0", "phy0", "intr2axi0", "port1", "phy1", "intr2axi1", - "phy-shared"; - interrupts = , - ; - interrupt-names = "port0", "port1"; - iommu-map = <0x100 &dart_apcie0 1 3>, - <0x200 &dart_apcie1 1 1>; - /* dart_apcie1 probes only once port 1 is up: the host must not wait for it */ - post-init-providers = <&dart_apcie1>; - - port01: pci@1,0 { - device_type = "pci"; - reg = <0x800 0 0 0 0>; - bus-range = <2 2>; - /* Down at boot: the kernel trains it, powering the reader first */ - apple,link-trained-by-bootloader; - /* ADT pcie-sdreader function-sd_pwr_en: SMC pcIO output 0 below */ - pwren-gpios = <&smc_pcio 0 GPIO_ACTIVE_HIGH>; - /* PERST#: ADT pci-bridge1 function-perst, GPIO 81 */ - reset-gpios = <&pinctrl_ap 81 GPIO_ACTIVE_LOW>; - /* ADT pci-bridge1 */ - apple,apcie-config-tunables = <0x140 4 0x1 0x1>, - <0x144 4 0xffffff 0x253770>, - <0x8a8 4 0x1 0x1>, - <0x8ac 4 0x1 0x1>; - apple,pcie-rc-tunables = <0x78 4 0x7000 0x0>, - <0x194 4 0x2 0x2>, - <0xb80 4 0x7f3f3f 0x7f1e1e>, - <0xb88 4 0x7f3f3f 0x7f1e1e>; - apple,pcie-rc-gen3-shadow-tunables = <0x154 4 0xf0f0f0f 0x5050505>, - <0x890 4 0x3000000 0x0>, - <0x8a8 4 0xffff0f 0x1>; - apple,pcie-rc-gen4-shadow-tunables = <0x178 4 0xffff 0x5555>, - <0x890 4 0x3000000 0x1000000>, - <0x8a8 4 0xffff0f 0x1>; - apple,pcie-rc-gen5-shadow-tunables = <0x1ac 4 0xffff 0x5555>, - <0x890 4 0x3000000 0x2000000>, - <0x8a8 4 0xffff0f 0x1>; - - #address-cells = <3>; - #size-cells = <2>; - ranges; - - interrupt-controller; - #interrupt-cells = <1>; - interrupt-map-mask = <0 0 0 7>; - interrupt-map = <0 0 0 1 &port01 0 0 0 0>, - <0 0 0 2 &port01 0 0 0 1>, - <0 0 0 3 &port01 0 0 0 2>, - <0 0 0 4 &port01 0 0 0 3>; - - /* - * The GL9755. Card detect and write protect are active high: ADT - * pcie-sdreader card-detect-polarity and write-protect-polarity = 1. - */ - sdhci0: mmc@0,0 { - compatible = "pci17a0,9755"; - reg = <0x20000 0x0 0x0 0x0 0x0>; - cd-inverted; - wp-inverted; - }; - }; -}; - -/* ADT dart-apcie1 manual-availability: pcie-apple enables it once port 1 is up */ -&dart_apcie1 { - apple,manual-availability; - status = "okay"; +&port01 { + pwren-gpios = <&smc_pcio 0 GPIO_ACTIVE_HIGH>; }; /* From e36ad0d661e3b4bf141f69992ffa25f69e224151 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 27 Nov 2026 18:12:35 +1100 Subject: [PATCH 5/5] arm64: dts: apple: t6050: select the M5 Max's PMIC buses by hardware, not by board t6050-peripherals.dtsi describes nub-spmi1 and nub-spmi4 only for a list of six boards (J714c, J716c, J775c, J775d, K114c, K116c). What the six have in common is the die: they are the M5 Max boards (the J775d's die 0 is one). The 27.2 ADTs agree. nub-spmi1 (spmi-mosquitoM1, interrupt 731) and nub-spmi4 (spmi-jerezC0 and spmi-jerezC1, interrupt 746) are in the J714cAP, J716cAP, J775cAP, J775dAP, K114cAP and K116cAP DeviceTrees and in the live J716c ADT, and in none of the M5 Pro's: J714sAP, J716sAP, J873sAP, K114sAP, K116sAP and the live K114s and K116s ADTs. So the new t6050-soc-max.dtsi, the M5 Max's die-0 part, defines T6050_MAX_PMIC_BUSES. The two buses are now guarded by that hardware macro, as the ATC2 router is by T6050_ATC2_USB4_ROUTER, and the six boards include the file before t6050-peripherals.dtsi. It is the place for the Max's other SoC blocks, the PMP tunables and the second media engines among them. All 11 T6050 DTBs are byte-identical. Signed-off-by: Ryan Murray --- arch/arm64/boot/dts/apple/t6050-j714c.dts | 2 ++ arch/arm64/boot/dts/apple/t6050-j716c.dts | 2 ++ arch/arm64/boot/dts/apple/t6050-j775c.dts | 2 ++ arch/arm64/boot/dts/apple/t6050-j775d.dts | 2 ++ arch/arm64/boot/dts/apple/t6050-k114c.dts | 2 ++ arch/arm64/boot/dts/apple/t6050-k116c.dts | 2 ++ arch/arm64/boot/dts/apple/t6050-peripherals.dtsi | 6 ++++-- arch/arm64/boot/dts/apple/t6050-soc-max.dtsi | 12 ++++++++++++ 8 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 arch/arm64/boot/dts/apple/t6050-soc-max.dtsi diff --git a/arch/arm64/boot/dts/apple/t6050-j714c.dts b/arch/arm64/boot/dts/apple/t6050-j714c.dts index ff202d0d0ec0c..e60bae57450c4 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714c.dts @@ -15,6 +15,8 @@ /dts-v1/; #define T6050_J714C +/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */ +#include "t6050-soc-max.dtsi" /* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */ #define T6050_ATC2_USB4_ROUTER #include diff --git a/arch/arm64/boot/dts/apple/t6050-j716c.dts b/arch/arm64/boot/dts/apple/t6050-j716c.dts index 679e9f2f78856..ce7d52fc05a79 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716c.dts @@ -14,6 +14,8 @@ /dts-v1/; #define T6050_J716C +/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */ +#include "t6050-soc-max.dtsi" /* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */ #define T6050_ATC2_USB4_ROUTER #include "t6050-max.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-j775c.dts b/arch/arm64/boot/dts/apple/t6050-j775c.dts index 65d92d3a17480..58c308f8d58e0 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775c.dts @@ -33,4 +33,6 @@ }; #define T6050_J775C +/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */ +#include "t6050-soc-max.dtsi" #include "t6050-peripherals.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-j775d.dts b/arch/arm64/boot/dts/apple/t6050-j775d.dts index b136a0eed288b..65bafecbc0056 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775d.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775d.dts @@ -506,6 +506,8 @@ }; #define T6050_J775D +/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */ +#include "t6050-soc-max.dtsi" #include "t6050-peripherals.dtsi" /* diff --git a/arch/arm64/boot/dts/apple/t6050-k114c.dts b/arch/arm64/boot/dts/apple/t6050-k114c.dts index ac5ef78196fbf..9c2063503342e 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -12,6 +12,8 @@ /* Defined before the includes: t6050-max.dtsi guards the ATC2 router on it. */ #define T6050_K114C +/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */ +#include "t6050-soc-max.dtsi" /* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */ #define T6050_ATC2_USB4_ROUTER /* The N1's firmware and this board's ADT board-id, for t6050-k114-k116.dtsi */ diff --git a/arch/arm64/boot/dts/apple/t6050-k116c.dts b/arch/arm64/boot/dts/apple/t6050-k116c.dts index 40bfec8ab72a8..688b10b35ce8f 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116c.dts @@ -24,6 +24,8 @@ }; #define T6050_K116C +/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */ +#include "t6050-soc-max.dtsi" #include "t6050-peripherals.dtsi" /* The GPU, handed over by the boot loader */ diff --git a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi index 9c8f5441a94a3..f4472ddf9eba4 100644 --- a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi @@ -1324,7 +1324,8 @@ #else &{/soc} { #endif -#if defined(T6050_J714C) || defined(T6050_J716C) || defined(T6050_J775C) || defined(T6050_J775D) || defined(T6050_K114C) || defined(T6050_K116C) +/* nub-spmi1: an M5 Max bus (t6050-soc-max.dtsi) */ +#ifdef T6050_MAX_PMIC_BUSES nub_spmi1: spmi@28a054000 { compatible = "apple,t6050-spmi", "apple,t8142-spmi"; reg = <0x2 0x8a054000 0x0 0x4000>, @@ -1337,7 +1338,8 @@ }; #endif -#if defined(T6050_J714C) || defined(T6050_J716C) || defined(T6050_J775C) || defined(T6050_J775D) || defined(T6050_K114C) || defined(T6050_K116C) +/* nub-spmi4: the other bus of t6050-soc-max.dtsi */ +#ifdef T6050_MAX_PMIC_BUSES nub_spmi4: spmi@28a114000 { compatible = "apple,t6050-spmi", "apple,t8142-spmi"; reg = <0x2 0x8a114000 0x0 0x4000>, diff --git a/arch/arm64/boot/dts/apple/t6050-soc-max.dtsi b/arch/arm64/boot/dts/apple/t6050-soc-max.dtsi new file mode 100644 index 0000000000000..1686e5ce952ab --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-soc-max.dtsi @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * The M5 Max's die-0 SoC part, for every board built on it: the MacBook Pros J714c, J716c, + * K114c and K116c and the Mac Studios J775c and J775d. Boards include it before + * t6050-peripherals.dtsi; it selects the blocks the M5 Pro's die does not have. + * + * The Max's ADTs (27.2: J714cAP, J716cAP, J775cAP, J775dAP, K114cAP, K116cAP, and the live + * J716c ADT) have two more SPMI buses than the M5 Pro's (J714sAP, J716sAP, J873sAP, K114sAP, + * K116sAP, and the live K114s and K116s ADTs): nub-spmi1 (spmi-mosquitoM1, interrupt 731) and + * nub-spmi4 (spmi-jerezC0 and spmi-jerezC1, interrupt 746), the Max's other PMICs. + */ +#define T6050_MAX_PMIC_BUSES