diff --git a/Documentation/devicetree/bindings/arm/apple.yaml b/Documentation/devicetree/bindings/arm/apple.yaml index 4823b3a00e5a9..1b1987b2581d6 100644 --- a/Documentation/devicetree/bindings/arm/apple.yaml +++ b/Documentation/devicetree/bindings/arm/apple.yaml @@ -478,6 +478,14 @@ properties: - const: apple,t6041 - const: apple,arm-platform + - description: Apple M5 Max SoC based platforms + items: + - enum: + - apple,j714c # MacBook Pro (14-inch, M5 Max, 2026) + - apple,j716c # MacBook Pro (16-inch, M5 Max, 2026) + - const: apple,t6050 + - const: apple,arm-platform + - description: Apple M5 Ultra SoC based platforms items: - const: apple,j775d # Mac Studio (M5 Ultra, 2026) diff --git a/Documentation/devicetree/bindings/gpio/apple,smc-pcio-gpio.yaml b/Documentation/devicetree/bindings/gpio/apple,smc-pcio-gpio.yaml index 94d9672189fc6..58f33eceac5ef 100644 --- a/Documentation/devicetree/bindings/gpio/apple,smc-pcio-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/apple,smc-pcio-gpio.yaml @@ -29,12 +29,13 @@ properties: minItems: 1 maxItems: 64 uniqueItems: true - description: Unique command templates with low 16 bits clear, in GPIO order + description: + Unique command templates with low 16 bits clear, in GPIO order. A board + that uses none of the outputs leaves the list out. required: - compatible - gpio-controller - '#gpio-cells' - - apple,output-commands additionalProperties: false diff --git a/Documentation/devicetree/bindings/soc/apple/apple,dockchannel.yaml b/Documentation/devicetree/bindings/soc/apple/apple,dockchannel.yaml index 9ee4a45c910d9..630786f68d11f 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,dockchannel.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,dockchannel.yaml @@ -27,6 +27,7 @@ properties: - apple,t6030-dockchannel - apple,t6031-dockchannel - apple,t6041-dockchannel + - apple,t6050-dockchannel - apple,t8112-dockchannel - apple,t8122-dockchannel - apple,t8132-dockchannel diff --git a/Documentation/devicetree/bindings/soc/apple/apple,rtk-helper-asc4.yaml b/Documentation/devicetree/bindings/soc/apple/apple,rtk-helper-asc4.yaml index 7b0d286ee03d7..874f667ce3f61 100644 --- a/Documentation/devicetree/bindings/soc/apple/apple,rtk-helper-asc4.yaml +++ b/Documentation/devicetree/bindings/soc/apple/apple,rtk-helper-asc4.yaml @@ -26,6 +26,7 @@ properties: - apple,t6030-mtp - apple,t6031-mtp - apple,t6041-mtp + - apple,t6050-mtp - apple,t8112-mtp - apple,t8122-mtp - apple,t8132-mtp @@ -35,6 +36,7 @@ properties: - apple,t6020-rtk-helper-asc4 - apple,t6030-rtk-helper-asc4 - apple,t6041-rtk-helper-asc4 + - apple,t6050-rtk-helper-asc4 - apple,t8112-rtk-helper-asc4 - apple,t8122-rtk-helper-asc4 - apple,t8132-rtk-helper-asc4 diff --git a/arch/arm64/boot/dts/apple/Makefile b/arch/arm64/boot/dts/apple/Makefile index 8a6e8c001a69f..38be2c9cec947 100644 --- a/arch/arm64/boot/dts/apple/Makefile +++ b/arch/arm64/boot/dts/apple/Makefile @@ -101,6 +101,8 @@ dtb-$(CONFIG_ARCH_APPLE) += t6040-j773s.dtb dtb-$(CONFIG_ARCH_APPLE) += t6041-j575c.dtb dtb-$(CONFIG_ARCH_APPLE) += t6041-j614c.dtb dtb-$(CONFIG_ARCH_APPLE) += t6041-j616c.dtb +dtb-$(CONFIG_ARCH_APPLE) += t6050-j714c.dtb +dtb-$(CONFIG_ARCH_APPLE) += t6050-j716c.dtb dtb-$(CONFIG_ARCH_APPLE) += t6050-j775d.dtb dtb-$(CONFIG_ARCH_APPLE) += t8112-j413.dtb dtb-$(CONFIG_ARCH_APPLE) += t8112-j415.dtb diff --git a/arch/arm64/boot/dts/apple/t6050-j714c.dts b/arch/arm64/boot/dts/apple/t6050-j714c.dts new file mode 100644 index 0000000000000..0f345ae461fcd --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-j714c.dts @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (14-inch, M5 Max, 2026) + * + * target-type: J714c + * + * The M5 Max is one T6050 die, die 0 (t6050-max.dtsi). This file enables + * and configures what has been brought up on this board, the same set as + * t6050-j716c.dts; the SoC's other ports and buses stay disabled until each + * is described for it. + * + * Copyright The Asahi Linux Contributors + */ + +/dts-v1/; + +#include "t6050-max.dtsi" + +/ { + compatible = "apple,j714c", "apple,t6050", "apple,arm-platform"; + model = "Apple MacBook Pro (14-inch, M5 Max, 2026)"; + chassis-type = "laptop"; + + aliases { + serial0 = &dockchannel; + /* kboot fills the N1's factory addresses from /chosen through these */ + wifi0 = &n1_alpha; + bluetooth0 = &n1_beta; + }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + framebuffer0: framebuffer@0 { + compatible = "apple,simple-framebuffer", "simple-framebuffer"; + reg = <0 0 0 0>; /* To be filled by the loader */ + /* Format properties will be added by the loader */ + status = "disabled"; + }; + }; +}; + +/* + * PCIe port 0: the N1 (Wi-Fi and Bluetooth). The registers, interrupt, DART streams + * and PERST# pin are the J716c's: the J714c's ADT has the same port. The boot loader + * trains the link after the SMC releases the N1's reset and keeps power, clocks, the + * PHY and PERST; Linux owns the routing, MSI and the DART. Disabled with its DART + * until the boot loader trains it, which also renumbers the bus here to the PCI + * core's order. + */ +&pcie0 { + 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"; + + /* The N1's three functions are on DART streams 1-3 */ + iommu-map = <0x100 &dart_apcie0 1 3>; + bus-range = <0 4>; + + port00: pci@0,0 { + device_type = "pci"; + reg = <0x0 0 0 0 0>; + bus-range = <1 1>; + apple,link-trained-by-bootloader; + /* PERST#, driven only by the root-port reset after the N1's ROM stage */ + reset-gpios = <&pinctrl_ap 80 GPIO_ACTIVE_LOW>; + status = "disabled"; + + #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 &port00 0 0 0 0>, + <0 0 0 2 &port00 0 0 0 1>, + <0 0 0 3 &port00 0 0 0 2>, + <0 0 0 4 &port00 0 0 0 3>; + + /* platform ID (board 0x0a << 16) | chip 0x6050 */ + n1_control: control@0,0 { + compatible = "pci106b,1900"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + firmware-name = "apple/centauri/j714c-ftab.bin"; + apple,centauri-platform-id = <0x000a6050>; + apple,centauri-protocol = <27>; + }; + + n1_alpha: wifi@0,1 { + compatible = "pci106b,1902"; + reg = <0x10100 0x0 0x0 0x0 0x0>; + local-mac-address = [00 00 00 00 00 00]; + }; + + n1_beta: bluetooth@0,2 { + compatible = "pci106b,1903"; + reg = <0x10200 0x0 0x0 0x0 0x0>; + local-bd-address = [00 00 00 00 00 00]; + }; + }; +}; + +/* ATC1, ATC3 and the PD controller buses nub-spmi-a0 and -a2: not yet described for this board */ +&nub_spmi_a0 { + status = "disabled"; +}; + +&nub_spmi_a2 { + status = "disabled"; +}; + +&atc1_phy_mbox { + status = "disabled"; +}; + +&atc1_phy { + status = "disabled"; +}; + +&usb_drd1 { + status = "disabled"; +}; + +&usb_drd1_dart_0 { + status = "disabled"; +}; + +&usb_drd1_dart_1 { + status = "disabled"; +}; + +&atc3_phy_mbox { + status = "disabled"; +}; + +&atc3_phy { + status = "disabled"; +}; + +&usb_drd3 { + status = "disabled"; +}; + +&usb_drd3_dart_0 { + status = "disabled"; +}; + +&usb_drd3_dart_1 { + status = "disabled"; +}; + +&i2c1 { + status = "disabled"; +}; + +&i2c2 { + status = "disabled"; +}; + +/* + * Only the pins a node here names are exposed, as on the J716c: pin 112's register + * takes an SError when read. 80 is PCIe port 0's PERST#. + */ +&pinctrl_ap { + gpio-reserved-ranges = <0 80>, <81 140>; +}; + +/* This board's SMC fan and power keys are not yet checked */ +&smc_hwmon { + status = "disabled"; +}; + +/* + * The console is on the USB debug link, which drains only while a host reads + * it; the machine also boots with nothing attached there. + */ +&dockchannel { + apple,tx-never-wait; + status = "okay"; +}; + +/* + * The keyboard and trackpad: the HID transport on the MTP's DockChannel FIFO. + * The J714c's MTP firmware owns the trackpad AFE reset, so there is no reset + * GPIO here, unlike the J716c. + */ +&mtp_dockchannel { + mtp_hid: input@8000 { + compatible = "apple,dockchannel-hid"; + reg = <0x8000 0x1000>, <0xc000 0x1000>, + <0x0 0x1000>, <0x4000 0x1000>; + reg-names = "config", "data", "rmt-config", "rmt-data"; + iommus = <&mtp_dart 0>; + interrupt-parent = <&mtp_dockchannel>; + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>, + <3 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tx", "rx"; + apple,fifo-size = <0x800>; + apple,helper-cpu = <&mtp>; + + multi-touch { + apple,power-method = <2>; + apple,firmware-managed-reset; + firmware-name = "apple/tpmtfw-j714c.bin"; + }; + + keyboard { + }; + + stm { + }; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-j716c.dts b/arch/arm64/boot/dts/apple/t6050-j716c.dts new file mode 100644 index 0000000000000..ba6f14f90440b --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-j716c.dts @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (16-inch, M5 Max, 2026) + * + * target-type: J716c + * + * The M5 Max is one T6050 die, die 0 (t6050-max.dtsi). This file enables + * and configures what has been brought up on this board; the SoC's other + * ports and buses stay disabled until each is described for it. + * + * Copyright The Asahi Linux Contributors + */ + +/dts-v1/; + +#include "t6050-max.dtsi" + +/ { + compatible = "apple,j716c", "apple,t6050", "apple,arm-platform"; + model = "Apple MacBook Pro (16-inch, M5 Max, 2026)"; + chassis-type = "laptop"; + + aliases { + serial0 = &dockchannel; + /* kboot fills the N1's factory addresses from /chosen through these */ + wifi0 = &n1_alpha; + bluetooth0 = &n1_beta; + }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + framebuffer0: framebuffer@0 { + compatible = "apple,simple-framebuffer", "simple-framebuffer"; + reg = <0 0 0 0>; /* To be filled by the loader */ + /* Format properties will be added by the loader */ + status = "disabled"; + }; + }; +}; + +/* + * PCIe port 0: the N1 (Wi-Fi and Bluetooth), the only GP port this board uses besides the SD + * reader on port 1 (not yet described). The boot loader trains the link after the SMC releases + * the N1's reset and keeps power, clocks, the PHY and PERST; Linux owns the routing, MSI and + * the DART. Disabled with its DART until the boot loader trains it, which also renumbers the + * bus here to the PCI core's order. + */ +&pcie0 { + 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"; + + /* The N1's three functions are on DART streams 1-3 */ + iommu-map = <0x100 &dart_apcie0 1 3>; + bus-range = <0 4>; + + port00: pci@0,0 { + device_type = "pci"; + reg = <0x0 0 0 0 0>; + bus-range = <1 1>; + apple,link-trained-by-bootloader; + /* PERST#, driven only by the root-port reset after the N1's ROM stage */ + reset-gpios = <&pinctrl_ap 80 GPIO_ACTIVE_LOW>; + status = "disabled"; + + #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 &port00 0 0 0 0>, + <0 0 0 2 &port00 0 0 0 1>, + <0 0 0 3 &port00 0 0 0 2>, + <0 0 0 4 &port00 0 0 0 3>; + + /* platform ID (board 0x0e << 16) | chip 0x6050 */ + n1_control: control@0,0 { + compatible = "pci106b,1900"; + reg = <0x10000 0x0 0x0 0x0 0x0>; + firmware-name = "apple/centauri/j716c-ftab.bin"; + apple,centauri-platform-id = <0x000e6050>; + apple,centauri-protocol = <27>; + }; + + n1_alpha: wifi@0,1 { + compatible = "pci106b,1902"; + reg = <0x10100 0x0 0x0 0x0 0x0>; + local-mac-address = [00 00 00 00 00 00]; + }; + + n1_beta: bluetooth@0,2 { + compatible = "pci106b,1903"; + reg = <0x10200 0x0 0x0 0x0 0x0>; + local-bd-address = [00 00 00 00 00 00]; + }; + }; +}; + +/* ATC1, ATC3 and the PD controller buses nub-spmi-a0 and -a2: not yet described for this board */ +&nub_spmi_a0 { + status = "disabled"; +}; + +&nub_spmi_a2 { + status = "disabled"; +}; + +&atc1_phy_mbox { + status = "disabled"; +}; + +&atc1_phy { + status = "disabled"; +}; + +&usb_drd1 { + status = "disabled"; +}; + +&usb_drd1_dart_0 { + status = "disabled"; +}; + +&usb_drd1_dart_1 { + status = "disabled"; +}; + +&atc3_phy_mbox { + status = "disabled"; +}; + +&atc3_phy { + status = "disabled"; +}; + +&usb_drd3 { + status = "disabled"; +}; + +&usb_drd3_dart_0 { + status = "disabled"; +}; + +&usb_drd3_dart_1 { + status = "disabled"; +}; + +&i2c1 { + status = "disabled"; +}; + +&i2c2 { + status = "disabled"; +}; + +/* + * Pin 112's register (0x29c0001c0) takes an SError when read, so only the pins a node + * here names are exposed: 80 (PCIe port 0's PERST#, ADT pci-bridge0 function-perst). + * A reserved line cannot be requested, so a node that names a new pin opens it here too. + */ +&pinctrl_ap { + gpio-reserved-ranges = <0 80>, <81 140>; +}; + +/* This board's SMC fan and power keys are not yet checked */ +&smc_hwmon { + status = "disabled"; +}; + +/* + * The console is on the USB debug link, which drains only while a host reads + * it; the machine also boots with nothing attached there. + */ +&dockchannel { + apple,tx-never-wait; + status = "okay"; +}; + +/* The keyboard and trackpad: the HID transport on the MTP's DockChannel FIFO */ +&mtp_dockchannel { + mtp_hid: input@8000 { + compatible = "apple,dockchannel-hid"; + reg = <0x8000 0x1000>, <0xc000 0x1000>, + <0x0 0x1000>, <0x4000 0x1000>; + reg-names = "config", "data", "rmt-config", "rmt-data"; + iommus = <&mtp_dart 0>; + interrupt-parent = <&mtp_dockchannel>; + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>, + <3 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tx", "rx"; + apple,fifo-size = <0x800>; + apple,helper-cpu = <&mtp>; + apple,afe-reset-gpios = <&smc_pcio 2 GPIO_ACTIVE_HIGH>; + + multi-touch { + apple,power-method = <2>; + firmware-name = "apple/tpmtfw-j716c.bin"; + }; + + keyboard { + }; + + stm { + }; + }; +}; + +/* This board's PCIO outputs, the trackpad AFE reset (2) among them */ +&smc_pcio { + apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 0x011c000000010000>; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-max.dtsi b/arch/arm64/boot/dts/apple/t6050-max.dtsi new file mode 100644 index 0000000000000..753b7de956832 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-max.dtsi @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Apple T6050 "M5 Max" SoC: one die + * + * Die 0 alone: t6050-die0.dtsi and one instance of the per-die template + * (t6050-dieX.dtsi), then the blocks described so far for this part only. + * + * Copyright The Asahi Linux Contributors + */ + +#include +#include +#include +#include +#include + +#include "multi-die-cpp.h" + +#include "t6050-base.dtsi" + +/ { + /* + * Six cores in each cluster. The sixth of each comes after the others, so that the + * first fifteen CPUs are numbered as on a part with five cores in each cluster. + */ + cpus { + T6050_M_CPU(cpu0, 40000, cpufreq_mc0); + T6050_M_CPU(cpu1, 40001, cpufreq_mc0); + T6050_M_CPU(cpu2, 40002, cpufreq_mc0); + T6050_M_CPU(cpu3, 40003, cpufreq_mc0); + T6050_M_CPU(cpu4, 40004, cpufreq_mc0); + T6050_M_CPU(cpu6, 40100, cpufreq_mc1); + T6050_M_CPU(cpu7, 40101, cpufreq_mc1); + T6050_M_CPU(cpu8, 40102, cpufreq_mc1); + T6050_M_CPU(cpu9, 40103, cpufreq_mc1); + T6050_M_CPU(cpu10, 40104, cpufreq_mc1); + T6050_P_CPU(cpu12, 10200, cpufreq_pc); + T6050_P_CPU(cpu13, 10201, cpufreq_pc); + T6050_P_CPU(cpu14, 10202, cpufreq_pc); + T6050_P_CPU(cpu15, 10203, cpufreq_pc); + T6050_P_CPU(cpu16, 10204, cpufreq_pc); + + /* The sixth core of each cluster */ + T6050_M_CPU(cpu5, 40005, cpufreq_mc0); + T6050_M_CPU(cpu11, 40105, cpufreq_mc1); + T6050_P_CPU(cpu17, 10205, cpufreq_pc); + }; +}; + +#define DIE +#define DIE_NO 0 +#define DIE_UNIT_PREFIX +#define DIE_ATC1 atc1 +#define SOC_NODE die0 + +#include "t6050-dieX.dtsi" +#include "t6050-die0.dtsi" + +#undef DIE +#undef DIE_NO +#undef DIE_UNIT_PREFIX +#undef DIE_ATC1 +#undef SOC_NODE + +/* + * The MTP coprocessor (the keyboard and trackpad's), which iBoot leaves running with its + * firmware, behind its DART, and the DockChannel FIFO its HID transport uses; the board adds + * that transport. From the ADT: /arm-io/mtp reg[0] 0x294600000 (the ASC, its v4 mailbox at + * +0x8000; interrupts [677, 676, 679, 678]: 676..679 in send-empty, send-not-empty, recv-empty, + * recv-not-empty order), dart-mtp 0x294800000 (interrupt 659, SID 0, vm-base 0x100_00004000), + * dockchannel-mtp 0x294b14000 for its interrupts (660) and 0x294b28000.. for the FIFOs. + */ +&die0 { + mtp_mbox: mailbox@294608000 { + compatible = "apple,t6050-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x2 0x94608000 0x0 0x4000>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + }; + + mtp_dart: iommu@294800000 { + compatible = "apple,t6050-dart", "apple,t8110-dart"; + reg = <0x2 0x94800000 0x0 0xc000>; + interrupts = ; + #iommu-cells = <1>; + apple,dma-range = <0x100 0x4000 0x0 0xffff0000>; + }; + + mtp: mtp@294600000 { + compatible = "apple,t6050-mtp", "apple,t6050-rtk-helper-asc4", "apple,mtp", + "apple,rtk-helper-asc4"; + reg = <0x2 0x94600000 0x0 0x4000>, + <0x2 0x94c00000 0x0 0xc4000>; + reg-names = "asc", "sram"; + mboxes = <&mtp_mbox>; + iommus = <&mtp_dart 0>; + #helper-cells = <0>; + }; + + mtp_dockchannel: fifo@294b14000 { + compatible = "apple,t6050-dockchannel", "apple,dockchannel"; + reg = <0x2 0x94b14000 0x0 0x1000>; + reg-names = "irq"; + interrupts = ; + ranges = <0 0x2 0x94b28000 0x10000>; + nonposted-mmio; + #address-cells = <1>; + #size-cells = <1>; + interrupt-controller; + #interrupt-cells = <2>; + }; +}; diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c index 7679347046a13..d3c482fa4234c 100644 --- a/drivers/pinctrl/pinctrl-apple-gpio.c +++ b/drivers/pinctrl/pinctrl-apple-gpio.c @@ -633,6 +633,7 @@ static int apple_gpio_pinctrl_probe(struct platform_device *pdev) static const struct of_device_id apple_gpio_pinctrl_of_match[] = { { .compatible = "apple,t8140-pinctrl", .data = &apple_gpio_uncached_hw }, { .compatible = "apple,t8132-pinctrl", .data = &apple_gpio_uncached_hw }, + { .compatible = "apple,t6050-pinctrl", .data = &apple_gpio_uncached_hw }, { .compatible = "apple,t8103-pinctrl", }, { .compatible = "apple,pinctrl", }, { }