From 761db815708be64cb27ca2c8a62927924bd0994d Mon Sep 17 00:00:00 2001 From: Marcelo Alcantara Date: Mon, 14 Sep 2026 13:29:32 +1000 Subject: [PATCH 1/2] iommu: apple-dart: raise MAX_DARTS_PER_DEVICE to 8 A device may reference one DART stream per controller it uses. The Apple display-subsystem lists one scanout DART (stream 0) per DCP; on M2 Max, wiring all four external DCPs (dcpext0..3) plus disp0 needs five. The cap of 3 makes apple_dart_of_xlate() reject the extra streams with -EINVAL, so the later DCPs never get a scanout mapping and their firmware faults on the first frame. Raise the cap to 8. --- drivers/iommu/apple-dart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c index bf3648125a78cf..aa3c82ebd72ffa 100644 --- a/drivers/iommu/apple-dart.c +++ b/drivers/iommu/apple-dart.c @@ -40,7 +40,7 @@ #define DART_MAX_STREAMS 256 #define DART_MAX_TTBR 4 -#define MAX_DARTS_PER_DEVICE 3 +#define MAX_DARTS_PER_DEVICE 8 #define DART_PCIEC_PAGE_SHIFT 14 #define DART_PCIEC_ADDR_WIDTH 42 #define DART_PCIEC_STREAMS 64 From 673d2a65e40efaeb5d6eccd68fbf9a8ab16ad352 Mon Sep 17 00:00:00 2001 From: Marcelo Alcantara Date: Mon, 14 Sep 2026 13:29:35 +1000 Subject: [PATCH 2/2] arm64: dts: apple: t6021: add dcpext2/dcpext3 external displays The M2 Max die has four external display controllers, but only dcpext0 (HDMI + Type-C) and dcpext1 (Type-C) were described. Add dcpext2 and dcpext3 as further Type-C route candidates in a new t6021-display2.dtsi, included by the M2 Max laptop boards (j414c/j416c) only -- M2 Pro (t6020) has two external DCPs. This lets the machine drive its internal panel plus HDMI and three Type-C displays at once. Needs MAX_DARTS_PER_DEVICE >= 5 (previous patch): the display-subsystem now lists five scanout DARTs. --- arch/arm64/boot/dts/apple/t6021-display2.dtsi | 308 ++++++++++++++++++ arch/arm64/boot/dts/apple/t6021-j414c.dts | 1 + arch/arm64/boot/dts/apple/t6021-j416c.dts | 1 + 3 files changed, 310 insertions(+) create mode 100644 arch/arm64/boot/dts/apple/t6021-display2.dtsi diff --git a/arch/arm64/boot/dts/apple/t6021-display2.dtsi b/arch/arm64/boot/dts/apple/t6021-display2.dtsi new file mode 100644 index 00000000000000..c518139f1fb4be --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6021-display2.dtsi @@ -0,0 +1,308 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Extra external display controllers (dcpext2 / dcpext3) for M2 Max laptops. + * + * The M2 Max die has four external DCPs; the base support wires only dcpext0 + * (HDMI + Type-C) and dcpext1 (Type-C). This adds dcpext2 and dcpext3 as + * further Type-C route candidates so all three Type-C ports (plus HDMI) can + * drive a display at once. M2 Pro (t6020) has only two external DCPs, so this + * is included by the t6021 (Max) laptop boards only. + * + * Requires MAX_DARTS_PER_DEVICE >= 5 in drivers/iommu/apple-dart.c: the + * display-subsystem lists one scanout DART (SID 0) per DCP, and dcpext2/3 + * push that list past the stock cap of 3. + * + * Copyright The Asahi Linux Contributors + */ + +/ { + aliases { + dcpext2 = &dcpext2; + dcpext3 = &dcpext3; + }; + + clk_dispext2: clock-dispext2 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + clock-output-names = "clk_dispext2"; + }; + + clk_dispext3: clock-dispext3 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <0>; + clock-output-names = "clk_dispext3"; + }; +}; + +&{/soc} { + + dispext2_dart: iommu@48d304000 { + compatible = "apple,t6020-dart", "apple,t8110-dart"; + reg = <0x4 0x8d304000 0x0 0x4000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_dispext2_cpu0>; + apple,dma-range = <0x100 0x0 0x10 0x0>; + status = "okay"; + }; + + dcpext2_dart: iommu@48d30c000 { + compatible = "apple,t6020-dart", "apple,t8110-dart"; + reg = <0x4 0x8d30c000 0x0 0x4000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_dispext2_cpu0>; + apple,dma-range = <0x100 0x0 0x10 0x0>; + status = "okay"; + }; + + dcpext2_mbox: mbox@48dc08000 { + compatible = "apple,t6020-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x4 0x8dc08000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_dispext2_cpu0>; + resets = <&ps_dispext2_cpu0>; + status = "okay"; + }; + + dcpext2: dcp@48dc00000 { + compatible = "apple,t6020-dcpext", "apple,dcpext"; + mboxes = <&dcpext2_mbox>; + mbox-names = "mbox"; + iommus = <&dcpext2_dart 5>; + reg-names = "coproc", "disp-0", "disp-1", "disp-2", "disp-3"; + reg = <0x4 0x8dc00000 0x0 0x4000>, + <0x4 0x8c000000 0x0 0x4000000>, + <0x4 0x8d320000 0x0 0x4000>, + <0x4 0x8d344000 0x0 0x4000>, + <0x4 0x8d800000 0x0 0x800000>; + apple,bw-scratch = <&pmgr_dcp 0 4 0x1220>; + apple,iomfb-surfaces = <1 1 0 1>; + power-domains = <&ps_dispext2_cpu0>; + resets = <&ps_dispext2_cpu0>; + clocks = <&clk_dispext2>; + apple,dcp-index = <3>; + status = "okay"; + apple,connector-type = "USB-C"; + apple,dptx-phy = <1>; + phys = <&atcphy0 PHY_TYPE_DP>, <&atcphy1 PHY_TYPE_DP>, + <&atcphy2 PHY_TYPE_DP>; + phy-names = "typec0", "typec1", "typec2"; + mux-controls = <&atcphy0_xbar 0>, <&atcphy1_xbar 0>, + <&atcphy2_xbar 0>; + mux-control-names = "typec0", "typec1", "typec2"; + apple,typec-mux-indices = <4 4 4>; + apple,typec-dptx-phys = <0 1 2>; + #address-cells = <2>; + #size-cells = <2>; + + piodma { + iommus = <&dispext2_dart 4>; + }; + + typec-routes { + #address-cells = <1>; + #size-cells = <0>; + + route@0 { + reg = <0>; + mode-switch; + port { + dcpext2_typec0: endpoint { + remote-endpoint = <&typec0_dcpext2>; + }; + }; + }; + + route@1 { + reg = <1>; + mode-switch; + port { + dcpext2_typec1: endpoint { + remote-endpoint = <&typec1_dcpext2>; + }; + }; + }; + + route@2 { + reg = <2>; + mode-switch; + port { + dcpext2_typec2: endpoint { + remote-endpoint = <&typec2_dcpext2>; + }; + }; + }; + }; + }; + + dispext3_dart: iommu@50d304000 { + compatible = "apple,t6020-dart", "apple,t8110-dart"; + reg = <0x5 0x0d304000 0x0 0x4000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_dispext3_cpu0>; + apple,dma-range = <0x100 0x0 0x10 0x0>; + status = "okay"; + }; + + dcpext3_dart: iommu@50d30c000 { + compatible = "apple,t6020-dart", "apple,t8110-dart"; + reg = <0x5 0x0d30c000 0x0 0x4000>; + #iommu-cells = <1>; + interrupt-parent = <&aic>; + interrupts = ; + power-domains = <&ps_dispext3_cpu0>; + apple,dma-range = <0x100 0x0 0x10 0x0>; + status = "okay"; + }; + + dcpext3_mbox: mbox@50dc08000 { + compatible = "apple,t6020-asc-mailbox", "apple,asc-mailbox-v4"; + reg = <0x5 0x0dc08000 0x0 0x4000>; + interrupt-parent = <&aic>; + interrupts = , + , + , + ; + interrupt-names = "send-empty", "send-not-empty", + "recv-empty", "recv-not-empty"; + #mbox-cells = <0>; + power-domains = <&ps_dispext3_cpu0>; + resets = <&ps_dispext3_cpu0>; + status = "okay"; + }; + + dcpext3: dcp@50dc00000 { + compatible = "apple,t6020-dcpext", "apple,dcpext"; + mboxes = <&dcpext3_mbox>; + mbox-names = "mbox"; + iommus = <&dcpext3_dart 5>; + reg-names = "coproc", "disp-0", "disp-1", "disp-2", "disp-3"; + reg = <0x5 0x0dc00000 0x0 0x4000>, + <0x5 0x0c000000 0x0 0x4000000>, + <0x5 0x0d320000 0x0 0x4000>, + <0x5 0x0d344000 0x0 0x4000>, + <0x5 0x0d800000 0x0 0x800000>; + apple,bw-scratch = <&pmgr_dcp 0 4 0x1228>; + apple,iomfb-surfaces = <1 1 0 1>; + power-domains = <&ps_dispext3_cpu0>; + resets = <&ps_dispext3_cpu0>; + clocks = <&clk_dispext3>; + apple,dcp-index = <4>; + status = "okay"; + apple,connector-type = "USB-C"; + apple,dptx-phy = <1>; + phys = <&atcphy0 PHY_TYPE_DP>, <&atcphy1 PHY_TYPE_DP>, + <&atcphy2 PHY_TYPE_DP>; + phy-names = "typec0", "typec1", "typec2"; + mux-controls = <&atcphy0_xbar 0>, <&atcphy1_xbar 0>, + <&atcphy2_xbar 0>; + mux-control-names = "typec0", "typec1", "typec2"; + apple,typec-mux-indices = <6 6 6>; + apple,typec-dptx-phys = <0 1 2>; + #address-cells = <2>; + #size-cells = <2>; + + piodma { + iommus = <&dispext3_dart 4>; + }; + + typec-routes { + #address-cells = <1>; + #size-cells = <0>; + + route@0 { + reg = <0>; + mode-switch; + port { + dcpext3_typec0: endpoint { + remote-endpoint = <&typec0_dcpext3>; + }; + }; + }; + + route@1 { + reg = <1>; + mode-switch; + port { + dcpext3_typec1: endpoint { + remote-endpoint = <&typec1_dcpext3>; + }; + }; + }; + + route@2 { + reg = <2>; + mode-switch; + port { + dcpext3_typec2: endpoint { + remote-endpoint = <&typec2_dcpext3>; + }; + }; + }; + }; + }; +}; + +&display { + iommus = <&disp0_dart 0>, <&dispext0_dart 0>, <&dispext1_dart 0>, + <&dispext2_dart 0>, <&dispext3_dart 0>; +}; + +&typec0 { + ports { + port@3 { + typec0_dcpext2: endpoint@2 { + reg = <2>; + remote-endpoint = <&dcpext2_typec0>; + }; + typec0_dcpext3: endpoint@3 { + reg = <3>; + remote-endpoint = <&dcpext3_typec0>; + }; + }; + }; +}; + +&typec1 { + ports { + port@3 { + typec1_dcpext2: endpoint@2 { + reg = <2>; + remote-endpoint = <&dcpext2_typec1>; + }; + typec1_dcpext3: endpoint@3 { + reg = <3>; + remote-endpoint = <&dcpext3_typec1>; + }; + }; + }; +}; + +&typec2 { + ports { + port@3 { + typec2_dcpext2: endpoint@2 { + reg = <2>; + remote-endpoint = <&dcpext2_typec2>; + }; + typec2_dcpext3: endpoint@3 { + reg = <3>; + remote-endpoint = <&dcpext3_typec2>; + }; + }; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t6021-j414c.dts b/arch/arm64/boot/dts/apple/t6021-j414c.dts index fab3b03ff3c452..ef90ffe8423f4b 100644 --- a/arch/arm64/boot/dts/apple/t6021-j414c.dts +++ b/arch/arm64/boot/dts/apple/t6021-j414c.dts @@ -11,6 +11,7 @@ #include "t6021.dtsi" #include "t602x-j414-j416.dtsi" +#include "t6021-display2.dtsi" / { compatible = "apple,j414c", "apple,t6021", "apple,arm-platform"; diff --git a/arch/arm64/boot/dts/apple/t6021-j416c.dts b/arch/arm64/boot/dts/apple/t6021-j416c.dts index b476e235639ffc..1c95fce375000b 100644 --- a/arch/arm64/boot/dts/apple/t6021-j416c.dts +++ b/arch/arm64/boot/dts/apple/t6021-j416c.dts @@ -11,6 +11,7 @@ #include "t6021.dtsi" #include "t602x-j414-j416.dtsi" +#include "t6021-display2.dtsi" / { compatible = "apple,j416c", "apple,t6021", "apple,arm-platform";