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 0f38e351ad11e..53aeaf1c3f093 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775c.dts @@ -43,4 +43,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-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index 0de7e2dcc6a05..9d071b83ab919 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,87 @@ 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"; +}; + +/* + * 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 */ @@ -301,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>; }; /* 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 d7eb9fddf40f9..402d1d947d9a4 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 */ @@ -206,105 +208,3 @@ */ #include "t6050-k114-k116-usb.dtsi" #include "t6050-k114-usb.dtsi" - -/* - * 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-k116c.dts b/arch/arm64/boot/dts/apple/t6050-k116c.dts index f73e86c12f87e..dc2002084a106 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-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts index 28d32133e59b0..3b29c1084dc2b 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 &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>; - - 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 */ -&apcie1_dart { - apple,manual-availability; - status = "okay"; +&port01 { + pwren-gpios = <&smc_pcio 0 GPIO_ACTIVE_HIGH>; }; /* @@ -675,22 +580,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 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