Skip to content

Commit b4f4054

Browse files
marcansvenpeter42
authored andcommitted
arm64: dts: apple: t8112: Add nodes for integrated USB Type-C ports
Add device nodes and connections to support USB 3.x on the SoC's integrated USBi Type-C ports of M2-based devices. Each Type-C port has an Apple Type-C PHY for USB 2.0, USB 3.x, USB4/Thunderbolt, and DisplayPort, a Synopsys Designware USB 3.x controller, two DART iommu instances and a CD321x USB PD controller. The port labels use Apple's established naming scheme for the ports. Signed-off-by: Hector Martin <marcan@marcan.st> Co-developed-by: Janne Grunau <j@jannau.net> Signed-off-by: Janne Grunau <j@jannau.net> Tested-by: Sven Peter <sven@kernel.org> # M1 mac mini and macbook air Reviewed-by: Sven Peter <sven@kernel.org> Reviewed-by: Neal Gompa <neal@gompa.dev> Link: https://patch.msgid.link/20260109-apple-dt-usb-c-atc-dwc3-v1-2-ce0e92c1a016@jannau.net Signed-off-by: Sven Peter <sven@kernel.org>
1 parent 2b737cc commit b4f4054

6 files changed

Lines changed: 287 additions & 0 deletions

File tree

arch/arm64/boot/dts/apple/t8112-j413.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@
6060
};
6161
};
6262

63+
/*
64+
* Provide labels for the USB type C ports.
65+
*/
66+
67+
&typec0 {
68+
label = "USB-C Left-back";
69+
};
70+
71+
&typec1 {
72+
label = "USB-C Left-front";
73+
};
74+
6375
&i2c0 {
6476
/* MagSafe port */
6577
hpm5: usb-pd@3a {

arch/arm64/boot/dts/apple/t8112-j415.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@
6060
};
6161
};
6262

63+
/*
64+
* Provide labels for the USB type C ports.
65+
*/
66+
67+
&typec0 {
68+
label = "USB-C Left-back";
69+
};
70+
71+
&typec1 {
72+
label = "USB-C Left-front";
73+
};
74+
6375
&i2c0 {
6476
/* MagSafe port */
6577
hpm5: usb-pd@3a {

arch/arm64/boot/dts/apple/t8112-j473.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,15 @@
5252
&pcie2_dart {
5353
status = "okay";
5454
};
55+
56+
/*
57+
* Provide labels for the USB type C ports.
58+
*/
59+
60+
&typec0 {
61+
label = "USB-C Back-left";
62+
};
63+
64+
&typec1 {
65+
label = "USB-C Back-right";
66+
};

arch/arm64/boot/dts/apple/t8112-j493.dts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,18 @@
108108
};
109109
};
110110

111+
/*
112+
* Provide labels for the USB type C ports.
113+
*/
114+
115+
&typec0 {
116+
label = "USB-C Left-back";
117+
};
118+
119+
&typec1 {
120+
label = "USB-C Left-front";
121+
};
122+
111123
&i2c4 {
112124
status = "okay";
113125
};

arch/arm64/boot/dts/apple/t8112-jxxx.dtsi

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
/ {
1313
aliases {
14+
atcphy0 = &atcphy0;
15+
atcphy1 = &atcphy1;
1416
serial0 = &serial0;
1517
serial2 = &serial2;
1618
};
@@ -53,6 +55,29 @@
5355
interrupt-parent = <&pinctrl_ap>;
5456
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
5557
interrupt-names = "irq";
58+
59+
typec0: connector {
60+
compatible = "usb-c-connector";
61+
power-role = "dual";
62+
data-role = "dual";
63+
64+
ports {
65+
#address-cells = <1>;
66+
#size-cells = <0>;
67+
port@0 {
68+
reg = <0>;
69+
typec0_connector_hs: endpoint {
70+
remote-endpoint = <&dwc3_0_hs>;
71+
};
72+
};
73+
port@1 {
74+
reg = <1>;
75+
typec0_connector_ss: endpoint {
76+
remote-endpoint = <&atcphy0_typec_lanes>;
77+
};
78+
};
79+
};
80+
};
5681
};
5782

5883
hpm1: usb-pd@3f {
@@ -61,6 +86,115 @@
6186
interrupt-parent = <&pinctrl_ap>;
6287
interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
6388
interrupt-names = "irq";
89+
90+
typec1: connector {
91+
compatible = "usb-c-connector";
92+
power-role = "dual";
93+
data-role = "dual";
94+
95+
ports {
96+
#address-cells = <1>;
97+
#size-cells = <0>;
98+
port@0 {
99+
reg = <0>;
100+
typec1_connector_hs: endpoint {
101+
remote-endpoint = <&dwc3_1_hs>;
102+
};
103+
};
104+
port@1 {
105+
reg = <1>;
106+
typec1_connector_ss: endpoint {
107+
remote-endpoint = <&atcphy1_typec_lanes>;
108+
};
109+
};
110+
};
111+
};
112+
};
113+
};
114+
115+
/* USB controllers */
116+
&dwc3_0 {
117+
ports {
118+
#address-cells = <1>;
119+
#size-cells = <0>;
120+
121+
port@0 {
122+
reg = <0>;
123+
dwc3_0_hs: endpoint {
124+
remote-endpoint = <&typec0_connector_hs>;
125+
};
126+
};
127+
128+
port@1 {
129+
reg = <1>;
130+
dwc3_0_ss: endpoint {
131+
remote-endpoint = <&atcphy0_usb3>;
132+
};
133+
};
134+
};
135+
};
136+
137+
&dwc3_1 {
138+
ports {
139+
#address-cells = <1>;
140+
#size-cells = <0>;
141+
142+
port@0 {
143+
reg = <0>;
144+
dwc3_1_hs: endpoint {
145+
remote-endpoint = <&typec1_connector_hs>;
146+
};
147+
};
148+
149+
port@1 {
150+
reg = <1>;
151+
dwc3_1_ss: endpoint {
152+
remote-endpoint = <&atcphy1_usb3>;
153+
};
154+
};
155+
};
156+
};
157+
158+
/* Type-C PHYs */
159+
&atcphy0 {
160+
ports {
161+
#address-cells = <1>;
162+
#size-cells = <0>;
163+
164+
port@0 {
165+
reg = <0>;
166+
atcphy0_typec_lanes: endpoint {
167+
remote-endpoint = <&typec0_connector_ss>;
168+
};
169+
};
170+
171+
port@1 {
172+
reg = <1>;
173+
atcphy0_usb3: endpoint {
174+
remote-endpoint = <&dwc3_0_ss>;
175+
};
176+
};
177+
};
178+
};
179+
180+
&atcphy1 {
181+
ports {
182+
#address-cells = <1>;
183+
#size-cells = <0>;
184+
185+
port@0 {
186+
reg = <0>;
187+
atcphy1_typec_lanes: endpoint {
188+
remote-endpoint = <&typec1_connector_ss>;
189+
};
190+
};
191+
192+
port@1 {
193+
reg = <1>;
194+
atcphy1_usb3: endpoint {
195+
remote-endpoint = <&dwc3_1_ss>;
196+
};
197+
};
64198
};
65199
};
66200

arch/arm64/boot/dts/apple/t8112.dtsi

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <dt-bindings/interrupt-controller/apple-aic.h>
1212
#include <dt-bindings/interrupt-controller/irq.h>
1313
#include <dt-bindings/pinctrl/apple.h>
14+
#include <dt-bindings/phy/phy.h>
1415
#include <dt-bindings/spmi/spmi.h>
1516

1617
/ {
@@ -1010,6 +1011,110 @@
10101011
resets = <&ps_ans>;
10111012
};
10121013

1014+
dwc3_0: usb@382280000 {
1015+
compatible = "apple,t8112-dwc3", "apple,t8103-dwc3";
1016+
reg = <0x3 0x82280000 0x0 0xcd00>, <0x3 0x8228cd00 0x0 0x3200>;
1017+
reg-names = "dwc3-core", "dwc3-apple";
1018+
interrupt-parent = <&aic>;
1019+
interrupts = <AIC_IRQ 1031 IRQ_TYPE_LEVEL_HIGH>;
1020+
dr_mode = "otg";
1021+
usb-role-switch;
1022+
role-switch-default-mode = "host";
1023+
iommus = <&dwc3_0_dart_0 0>, <&dwc3_0_dart_1 1>;
1024+
power-domains = <&ps_atc0_usb>;
1025+
resets = <&atcphy0>;
1026+
phys = <&atcphy0 PHY_TYPE_USB2>, <&atcphy0 PHY_TYPE_USB3>;
1027+
phy-names = "usb2-phy", "usb3-phy";
1028+
};
1029+
1030+
dwc3_0_dart_0: iommu@382f00000 {
1031+
compatible = "apple,t8110-dart";
1032+
reg = <0x3 0x82f00000 0x0 0x4000>;
1033+
interrupt-parent = <&aic>;
1034+
interrupts = <AIC_IRQ 1035 IRQ_TYPE_LEVEL_HIGH>;
1035+
#iommu-cells = <1>;
1036+
power-domains = <&ps_atc0_usb>;
1037+
};
1038+
1039+
dwc3_0_dart_1: iommu@382f80000 {
1040+
compatible = "apple,t8110-dart";
1041+
reg = <0x3 0x82f80000 0x0 0x4000>;
1042+
interrupt-parent = <&aic>;
1043+
interrupts = <AIC_IRQ 1035 IRQ_TYPE_LEVEL_HIGH>;
1044+
#iommu-cells = <1>;
1045+
power-domains = <&ps_atc0_usb>;
1046+
};
1047+
1048+
atcphy0: phy@383000000 {
1049+
compatible = "apple,t8112-atcphy", "apple,t8103-atcphy";
1050+
reg = <0x3 0x83000000 0x0 0x4c000>,
1051+
<0x3 0x83050000 0x0 0x8000>,
1052+
<0x3 0x80000000 0x0 0x4000>,
1053+
<0x3 0x82a90000 0x0 0x4000>,
1054+
<0x3 0x82a84000 0x0 0x4000>;
1055+
reg-names = "core", "lpdptx", "axi2af", "usb2phy",
1056+
"pipehandler";
1057+
1058+
#phy-cells = <1>;
1059+
#reset-cells = <0>;
1060+
1061+
orientation-switch;
1062+
mode-switch;
1063+
power-domains = <&ps_atc0_usb>;
1064+
};
1065+
1066+
dwc3_1: usb@502280000 {
1067+
compatible = "apple,t8112-dwc3", "apple,t8103-dwc3";
1068+
reg = <0x5 0x02280000 0x0 0xcd00>, <0x5 0x0228cd00 0x0 0x3200>;
1069+
reg-names = "dwc3-core", "dwc3-apple";
1070+
interrupt-parent = <&aic>;
1071+
interrupts = <AIC_IRQ 1112 IRQ_TYPE_LEVEL_HIGH>;
1072+
dr_mode = "otg";
1073+
usb-role-switch;
1074+
role-switch-default-mode = "host";
1075+
iommus = <&dwc3_1_dart_0 0>, <&dwc3_1_dart_1 1>;
1076+
power-domains = <&ps_atc1_usb>;
1077+
resets = <&atcphy1>;
1078+
phys = <&atcphy1 PHY_TYPE_USB2>, <&atcphy1 PHY_TYPE_USB3>;
1079+
phy-names = "usb2-phy", "usb3-phy";
1080+
};
1081+
1082+
dwc3_1_dart_0: iommu@502f00000 {
1083+
compatible = "apple,t8110-dart";
1084+
reg = <0x5 0x02f00000 0x0 0x4000>;
1085+
interrupt-parent = <&aic>;
1086+
interrupts = <AIC_IRQ 1116 IRQ_TYPE_LEVEL_HIGH>;
1087+
#iommu-cells = <1>;
1088+
power-domains = <&ps_atc1_usb>;
1089+
};
1090+
1091+
dwc3_1_dart_1: iommu@502f80000 {
1092+
compatible = "apple,t8110-dart";
1093+
reg = <0x5 0x02f80000 0x0 0x4000>;
1094+
interrupt-parent = <&aic>;
1095+
interrupts = <AIC_IRQ 1116 IRQ_TYPE_LEVEL_HIGH>;
1096+
#iommu-cells = <1>;
1097+
power-domains = <&ps_atc1_usb>;
1098+
};
1099+
1100+
atcphy1: phy@503000000 {
1101+
compatible = "apple,t8112-atcphy", "apple,t8103-atcphy";
1102+
reg = <0x5 0x03000000 0x0 0x4c000>,
1103+
<0x5 0x03050000 0x0 0x8000>,
1104+
<0x5 0x0 0x0 0x4000>,
1105+
<0x5 0x02a90000 0x0 0x4000>,
1106+
<0x5 0x02a84000 0x0 0x4000>;
1107+
reg-names = "core", "lpdptx", "axi2af", "usb2phy",
1108+
"pipehandler";
1109+
1110+
#phy-cells = <1>;
1111+
#reset-cells = <0>;
1112+
1113+
orientation-switch;
1114+
mode-switch;
1115+
power-domains = <&ps_atc1_usb>;
1116+
};
1117+
10131118
pcie0_dart: iommu@681008000 {
10141119
compatible = "apple,t8110-dart";
10151120
reg = <0x6 0x81008000 0x0 0x4000>;

0 commit comments

Comments
 (0)