Skip to content

Commit 1115e79

Browse files
committed
arm: dts: apple: Add Apple M2 Pro/Max device trees
Device trees for the 14" and 16" MacBook Pro and the Mac mini. Taken from the asahi branch of the Asahi Linux github repository. Signed-off-by: Mark Kettenis <[email protected]>
1 parent e372aa8 commit 1115e79

24 files changed

+6332
-6
lines changed

arch/arm/dts/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ dtb-$(CONFIG_ARCH_APPLE) += \
3939
t6001-j316c.dtb \
4040
t6001-j375c.dtb \
4141
t6002-j375d.dtb \
42+
t6020-j414s.dtb \
43+
t6020-j416s.dtb \
44+
t6020-j474s.dtb \
45+
t6021-j414c.dtb \
46+
t6021-j416c.dtb \
47+
t6021-j475c.dtb \
48+
t6022-j180d.dtb \
49+
t6022-j475d.dtb \
4250
t8103-j274.dtb \
4351
t8103-j293.dtb \
4452
t8103-j313.dtb \

arch/arm/dts/t6020-j414s.dts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* MacBook Pro (14-inch, M2 Pro, 2023)
4+
*
5+
* target-type: J414s
6+
*
7+
* Copyright The Asahi Linux Contributors
8+
*/
9+
10+
/dts-v1/;
11+
12+
#include "t6020.dtsi"
13+
#include "t602x-j414-j416.dtsi"
14+
15+
/ {
16+
compatible = "apple,j414s", "apple,t6020", "apple,arm-platform";
17+
model = "Apple MacBook Pro (14-inch, M2 Pro, 2023)";
18+
};
19+
20+
&wifi0 {
21+
brcm,board-type = "apple,tokara";
22+
};
23+
24+
&bluetooth0 {
25+
brcm,board-type = "apple,tokara";
26+
};
27+
28+
&panel {
29+
compatible = "apple,panel-j414", "apple,panel-mini-led", "apple,panel";
30+
width-mm = <302>;
31+
height-mm = <196>;
32+
adj-height-mm = <189>;
33+
};
34+
35+
&sound {
36+
compatible = "apple,j414-macaudio", "apple,j314-macaudio", "apple,macaudio";
37+
model = "MacBook Pro J414";
38+
};
39+
40+
&mtp_mt {
41+
firmware-name = "apple/tpmtfw-j414s.bin";
42+
};

arch/arm/dts/t6020-j416s.dts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* MacBook Pro (16-inch, M2 Pro, 2023)
4+
*
5+
* target-type: J416s
6+
*
7+
* Copyright The Asahi Linux Contributors
8+
*/
9+
10+
/dts-v1/;
11+
12+
#include "t6020.dtsi"
13+
#include "t602x-j414-j416.dtsi"
14+
15+
/ {
16+
compatible = "apple,j416s", "apple,t6020", "apple,arm-platform";
17+
model = "Apple MacBook Pro (16-inch, M2 Pro, 2023)";
18+
};
19+
20+
&wifi0 {
21+
brcm,board-type = "apple,amami";
22+
};
23+
24+
&bluetooth0 {
25+
brcm,board-type = "apple,amami";
26+
};
27+
28+
&panel {
29+
compatible = "apple,panel-j416", "apple,panel-mini-led", "apple,panel";
30+
width-mm = <346>;
31+
height-mm = <223>;
32+
adj-height-mm = <216>;
33+
};
34+
35+
&sound {
36+
compatible = "apple,j416-macaudio", "apple,j316-macaudio", "apple,macaudio";
37+
model = "MacBook Pro J416";
38+
};
39+
40+
&mtp_mt {
41+
firmware-name = "apple/tpmtfw-j416s.bin";
42+
};

arch/arm/dts/t6020-j474s.dts

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* Mac Mini (M2 Pro, 2023)
4+
*
5+
* target-type: J474s
6+
*
7+
* Copyright The Asahi Linux Contributors
8+
*/
9+
10+
/dts-v1/;
11+
12+
#include "t6020.dtsi"
13+
14+
#define NO_PCIE_SDHC
15+
#include "t602x-j474-j475.dtsi"
16+
17+
/ {
18+
compatible = "apple,j474s", "apple,t6020", "apple,arm-platform";
19+
model = "Apple Mac Mini (M2 Pro, 2023)";
20+
};
21+
22+
&wifi0 {
23+
compatible = "pci14e4,4434";
24+
brcm,board-type = "apple,tasmania";
25+
};
26+
27+
&bluetooth0 {
28+
compatible = "pci14e4,5f72";
29+
brcm,board-type = "apple,tasmania";
30+
};
31+
32+
/* PCIe devices */
33+
&port01 {
34+
/*
35+
* TODO: do not enable port without device. This works around a Linux
36+
* bug which results in mismatched iommus on gaps in PCI(e) ports / bus
37+
* numbers.
38+
*/
39+
bus-range = <2 2>;
40+
status = "okay";
41+
};
42+
43+
&sound {
44+
compatible = "apple,j474-macaudio", "apple,j473-macaudio", "apple,macaudio";
45+
model = "Mac mini J474";
46+
};
47+
48+
&lpdptxphy {
49+
status = "okay";
50+
};
51+
52+
#define USE_DCPEXT0 1
53+
54+
#if USE_DCPEXT0
55+
/ {
56+
aliases {
57+
dcpext0 = &dcpext0;
58+
/delete-property/ dcp;
59+
};
60+
};
61+
62+
&framebuffer0 {
63+
power-domains = <&ps_dispext0_cpu0>, <&ps_dptx_phy_ps>;
64+
};
65+
66+
&dcp {
67+
status = "disabled";
68+
};
69+
&display {
70+
iommus = <&dispext0_dart 0>;
71+
};
72+
&dispext0_dart {
73+
status = "okay";
74+
};
75+
&dcpext0_dart {
76+
status = "okay";
77+
};
78+
&dcpext0_mbox {
79+
status = "okay";
80+
};
81+
&dcpext0 {
82+
#else
83+
&dcp {
84+
#endif
85+
status = "okay";
86+
apple,connector-type = "HDMI-A";
87+
88+
/* HDMI HPD gpio, used as interrupt*/
89+
hdmi-hpd-gpios = <&pinctrl_aop 25 GPIO_ACTIVE_HIGH>;
90+
91+
hdmi-pwren-gpios = <&smc_gpio 23 GPIO_ACTIVE_HIGH>;
92+
dp2hdmi-pwren-gpios = <&smc_gpio 25 GPIO_ACTIVE_HIGH>;
93+
94+
phys = <&lpdptxphy>;
95+
phy-names = "dp-phy";
96+
apple,dptx-phy = <4>;
97+
};
98+
99+
&gpu {
100+
/* Apple does not do this, but they probably should */
101+
apple,perf-base-pstate = <3>;
102+
};

arch/arm/dts/t6020.dtsi

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* Apple T6020 "M2 Pro" SoC
4+
*
5+
* Other names: H14J, "Rhodes Chop"
6+
*
7+
* Copyright The Asahi Linux Contributors
8+
*/
9+
10+
/* This chip is just a cut down version of t6021, so include it and disable the missing parts */
11+
12+
#define GPU_REPEAT(x) <x x>
13+
14+
#include "t6021.dtsi"
15+
16+
/ {
17+
compatible = "apple,t6020", "apple,arm-platform";
18+
};
19+
20+
/delete-node/ &pmgr_south;
21+
22+
&gpu {
23+
compatible = "apple,agx-t6020", "apple,agx-g14x";
24+
25+
apple,avg-power-filter-tc-ms = <302>;
26+
apple,avg-power-ki-only = <2.6375>;
27+
apple,avg-power-kp = <0.18>;
28+
apple,fast-die0-integral-gain = <1350.0>;
29+
apple,ppm-filter-time-constant-ms = <32>;
30+
apple,ppm-ki = <28.0>;
31+
};

arch/arm/dts/t6021-j414c.dts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* MacBook Pro (14-inch, M2 Max, 2023)
4+
*
5+
* target-type: J414c
6+
*
7+
* Copyright The Asahi Linux Contributors
8+
*/
9+
10+
/dts-v1/;
11+
12+
#include "t6021.dtsi"
13+
#include "t602x-j414-j416.dtsi"
14+
15+
/ {
16+
compatible = "apple,j414c", "apple,t6021", "apple,arm-platform";
17+
model = "Apple MacBook Pro (14-inch, M2 Max, 2023)";
18+
};
19+
20+
&wifi0 {
21+
brcm,board-type = "apple,tokara";
22+
};
23+
24+
&bluetooth0 {
25+
brcm,board-type = "apple,tokara";
26+
};
27+
28+
&panel {
29+
compatible = "apple,panel-j414", "apple,panel-mini-led", "apple,panel";
30+
width-mm = <302>;
31+
height-mm = <196>;
32+
adj-height-mm = <189>;
33+
};
34+
35+
&sound {
36+
compatible = "apple,j414-macaudio", "apple,j314-macaudio", "apple,macaudio";
37+
model = "MacBook Pro J414";
38+
};
39+
40+
&mtp_mt {
41+
firmware-name = "apple/tpmtfw-j414c.bin";
42+
};

arch/arm/dts/t6021-j416c.dts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// SPDX-License-Identifier: GPL-2.0+ OR MIT
2+
/*
3+
* MacBook Pro (16-inch, M2 Max, 2022)
4+
*
5+
* target-type: J416c
6+
*
7+
* Copyright The Asahi Linux Contributors
8+
*/
9+
10+
/dts-v1/;
11+
12+
#include "t6021.dtsi"
13+
#include "t602x-j414-j416.dtsi"
14+
15+
/ {
16+
compatible = "apple,j416c", "apple,t6021", "apple,arm-platform";
17+
model = "Apple MacBook Pro (16-inch, M2 Max, 2023)";
18+
};
19+
20+
/* This machine model (only) has two extra boost CPU P-states *
21+
* Disabled: Only the highest CPU bin (38 GPU cores) has this.
22+
* Keep this disabled until m1n1 learns how to remove these OPPs
23+
* for unsupported machines, otherwise it breaks cpufreq.
24+
&avalanche_opp {
25+
opp18 {
26+
opp-hz = /bits/ 64 <3528000000>;
27+
opp-level = <18>;
28+
clock-latency-ns = <67000>;
29+
turbo-mode;
30+
};
31+
opp19 {
32+
opp-hz = /bits/ 64 <3696000000>;
33+
opp-level = <19>;
34+
clock-latency-ns = <67000>;
35+
turbo-mode;
36+
};
37+
};
38+
*/
39+
40+
&wifi0 {
41+
brcm,board-type = "apple,amami";
42+
};
43+
44+
&bluetooth0 {
45+
brcm,board-type = "apple,amami";
46+
};
47+
48+
&panel {
49+
compatible = "apple,panel-j416", "apple,panel-mini-led", "apple,panel";
50+
width-mm = <346>;
51+
height-mm = <223>;
52+
adj-height-mm = <216>;
53+
};
54+
55+
&sound {
56+
compatible = "apple,j416-macaudio", "apple,j316-macaudio", "apple,macaudio";
57+
model = "MacBook Pro J416";
58+
};
59+
60+
&mtp_mt {
61+
firmware-name = "apple/tpmtfw-j416c.bin";
62+
};

0 commit comments

Comments
 (0)