Skip to content

Commit a0eb1bc

Browse files
noopwafeljannau
authored andcommitted
arm64: dts: apple: Add PCIe nodes for t8122
This only includes the first port, because it's the only port that is present on my hardware, and only includes the pwren gpio for J613. Uses the t6020 base compatible as that is what the M3 hardware appears to be compatible with, rather than the configuration applied by the generic base compatible. Signed-off-by: Alyssa Milburn <amilburn@zall.org> Co-developed-by: Michael Reeves <michael.reeves077@gmail.com> Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
1 parent 3c9a1d4 commit a0eb1bc

7 files changed

Lines changed: 293 additions & 0 deletions

File tree

arch/arm64/boot/dts/apple/t8122-j433.dts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,30 @@
1616
/ {
1717
compatible = "apple,j433", "apple,t8122", "apple,arm-platform";
1818
model = "Apple iMac (24-inch, 2x USB-C, M3, 2023)";
19+
20+
aliases {
21+
ethernet0 = &ethernet0;
22+
};
23+
};
24+
25+
&wifi0 {
26+
brcm,board-type = "apple,azores";
27+
};
28+
29+
&bluetooth0 {
30+
brcm,board-type = "apple,azores";
31+
};
32+
33+
&port01 {
34+
bus-range = <2 2>;
35+
status = "okay";
36+
ethernet0: ethernet@0,0 {
37+
reg = <0x20000 0x0 0x0 0x0 0x0>;
38+
/* To be filled by the loader */
39+
local-mac-address = [00 10 18 00 00 00];
40+
};
41+
};
42+
43+
&pcie1_dart {
44+
status = "okay";
1945
};

arch/arm64/boot/dts/apple/t8122-j434.dts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,34 @@
1717
compatible = "apple,j434", "apple,t8122", "apple,arm-platform";
1818
model = "Apple iMac (24-inch, 4x USB-C, M3, 2023)";
1919
};
20+
21+
&wifi0 {
22+
brcm,board-type = "apple,iona";
23+
};
24+
25+
&bluetooth0 {
26+
brcm,board-type = "apple,iona";
27+
};
28+
29+
&port01 {
30+
bus-range = <2 2>;
31+
status = "okay";
32+
ethernet0: ethernet@0,0 {
33+
reg = <0x20000 0x0 0x0 0x0 0x0>;
34+
/* To be filled by the loader */
35+
local-mac-address = [00 10 18 00 00 00];
36+
};
37+
};
38+
39+
&port02 {
40+
bus-range = <3 3>;
41+
status = "okay";
42+
};
43+
44+
&pcie1_dart {
45+
status = "okay";
46+
};
47+
48+
&pcie2_dart {
49+
status = "okay";
50+
};

arch/arm64/boot/dts/apple/t8122-j504.dts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@
3131
};
3232
};
3333

34+
&wifi0 {
35+
brcm,board-type = "apple,tresco";
36+
};
37+
38+
&bluetooth0 {
39+
brcm,board-type = "apple,tresco";
40+
};
41+
42+
&port01 {
43+
/* SD card reader */
44+
bus-range = <2 2>;
45+
status = "okay";
46+
47+
sdhci0: mmc@0,0 {
48+
compatible = "pci17a0,9755";
49+
reg = <0x20000 0x0 0x0 0x0 0x0>;
50+
cd-inverted;
51+
wp-inverted;
52+
};
53+
};
54+
55+
&pcie1_dart {
56+
status = "okay";
57+
};
58+
59+
3460
&fpwm1 {
3561
status = "okay";
3662
};

arch/arm64/boot/dts/apple/t8122-j613.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
};
3131
};
3232

33+
&wifi0 {
34+
brcm,board-type = "apple,dnieper";
35+
};
36+
37+
&bluetooth0 {
38+
brcm,board-type = "apple,dnieper";
39+
};
40+
3341
&fpwm1 {
3442
status = "okay";
3543
};

arch/arm64/boot/dts/apple/t8122-j615.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030
};
3131
};
3232

33+
&wifi0 {
34+
brcm,board-type = "apple,tuzla";
35+
};
36+
37+
&bluetooth0 {
38+
brcm,board-type = "apple,tuzla";
39+
};
40+
3341
&fpwm1 {
3442
status = "okay";
3543
};

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
/ {
1313
aliases {
14+
bluetooth0 = &bluetooth0;
1415
serial0 = &serial0;
16+
wifi0 = &wifi0;
1517
};
1618

1719
chosen {
@@ -46,3 +48,27 @@
4648
&serial0 {
4749
status = "okay";
4850
};
51+
52+
/*
53+
* Force the bus number assignments so that we can declare some of the
54+
* on-board devices and properties that are populated by the bootloader
55+
* (such as MAC addresses).
56+
*/
57+
&port00 {
58+
bus-range = <1 1>;
59+
60+
wifi0: wifi@0,0 {
61+
compatible = "pci14e4,4434";
62+
reg = <0x10000 0x0 0x0 0x0 0x0>;
63+
/* To be filled by the loader */
64+
local-mac-address = [00 00 00 00 00 00];
65+
apple,antenna-sku = "XX";
66+
};
67+
68+
bluetooth0: bluetooth@0,1 {
69+
compatible = "pci14e4,5f72";
70+
reg = <0x10100 0x0 0x0 0x0 0x0>;
71+
/* To be filled by the loader */
72+
local-bd-address = [00 00 00 00 00 00];
73+
};
74+
};

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

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,13 @@
357357
<APPLE_PINMUX(148, 1)>;
358358
};
359359

360+
pcie_pins: pcie-pins {
361+
// clkreq pins
362+
pinmux = <APPLE_PINMUX(183, 1)>,
363+
<APPLE_PINMUX(184, 1)>,
364+
<APPLE_PINMUX(185, 1)>,
365+
<APPLE_PINMUX(186, 1)>;
366+
};
360367
};
361368

362369
pinctrl_nub: pinctrl@2e41f0000 {
@@ -504,6 +511,167 @@
504511
power-domain-names = "ans", "apcie0";
505512
resets = <&ps_ans>;
506513
};
514+
515+
pcie0_dart: iommu@594000000 {
516+
compatible = "apple,t8122-dart", "apple,t8110-dart";
517+
reg = <0x5 0x94000000 0x0 0x4000>;
518+
#iommu-cells = <1>;
519+
interrupt-parent = <&aic>;
520+
interrupts = <AIC_IRQ 924 IRQ_TYPE_LEVEL_HIGH>;
521+
power-domains = <&ps_apcie_gp>;
522+
};
523+
524+
pcie1_dart: iommu@595000000 {
525+
compatible = "apple,t8122-dart", "apple,t8110-dart";
526+
reg = <0x5 0x95000000 0x0 0x4000>;
527+
#iommu-cells = <1>;
528+
interrupt-parent = <&aic>;
529+
interrupts = <AIC_IRQ 933 IRQ_TYPE_LEVEL_HIGH>;
530+
power-domains = <&ps_apcie_gp>;
531+
status = "disabled";
532+
};
533+
534+
pcie2_dart: iommu@596000000 {
535+
compatible = "apple,t8122-dart", "apple,t8110-dart";
536+
reg = <0x6 0x96000000 0x0 0x4000>;
537+
#iommu-cells = <1>;
538+
interrupt-parent = <&aic>;
539+
interrupts = <AIC_IRQ 942 IRQ_TYPE_LEVEL_HIGH>;
540+
power-domains = <&ps_apcie_gp>;
541+
status = "disabled";
542+
};
543+
544+
pcie3_dart: iommu@597000000 {
545+
compatible = "apple,t8122-dart", "apple,t8110-dart";
546+
reg = <0x6 0x97000000 0x0 0x4000>;
547+
#iommu-cells = <1>;
548+
interrupt-parent = <&aic>;
549+
interrupts = <AIC_IRQ 951 IRQ_TYPE_LEVEL_HIGH>;
550+
power-domains = <&ps_apcie_gp>;
551+
status = "disabled";
552+
};
553+
554+
pcie0: pcie@580000000 {
555+
compatible = "apple,t8122-pcie", "apple,t6020-pcie";
556+
device_type = "pci";
557+
558+
reg = <0x5 0x80000000 0x0 0x1000000>, /* config */
559+
<0x5 0x91000000 0x0 0x4000>, /* rc */
560+
<0x5 0x94008000 0x0 0x4000>, /* port0 */
561+
<0x5 0x95008000 0x0 0x4000>, /* port1 */
562+
<0x5 0x96008000 0x0 0x4000>, /* port2 */
563+
<0x5 0x97008000 0x0 0x4000>, /* port3 */
564+
<0x5 0x9e00c000 0x0 0x4000>, /* phy0 */
565+
<0x5 0x9e010000 0x0 0x4000>, /* phy1 */
566+
<0x5 0x9e014000 0x0 0x4000>, /* phy2 */
567+
<0x5 0x9e018000 0x0 0x4000>; /* phy3 */
568+
reg-names = "config", "rc", "port0", "port1", "port2", "port3", "phy0", "phy1", "phy2", "phy3";
569+
570+
interrupt-parent = <&aic>;
571+
interrupts = <AIC_IRQ 923 IRQ_TYPE_LEVEL_HIGH>,
572+
<AIC_IRQ 932 IRQ_TYPE_LEVEL_HIGH>,
573+
<AIC_IRQ 941 IRQ_TYPE_LEVEL_HIGH>,
574+
<AIC_IRQ 950 IRQ_TYPE_LEVEL_HIGH>;
575+
576+
msi-controller;
577+
msi-parent = <&pcie0>;
578+
msi-ranges = <&aic AIC_IRQ 1075 IRQ_TYPE_EDGE_RISING 32>;
579+
580+
iommu-map = <0x100 &pcie0_dart 0 1>,
581+
<0x200 &pcie1_dart 1 1>,
582+
<0x300 &pcie2_dart 2 1>,
583+
<0x300 &pcie3_dart 3 1>;
584+
iommu-map-mask = <0xff00>;
585+
586+
bus-range = <0 4>;
587+
#address-cells = <3>;
588+
#size-cells = <2>;
589+
ranges = <0x43000000 0x5 0xa0000000 0x5 0xa0000000 0x0 0x20000000>,
590+
<0x02000000 0x0 0xc0000000 0x5 0xc0000000 0x0 0x40000000>;
591+
592+
power-domains = <&ps_apcie_gp>;
593+
pinctrl-0 = <&pcie_pins>;
594+
pinctrl-names = "default";
595+
596+
port00: pci@0,0 {
597+
device_type = "pci";
598+
reg = <0x0 0x0 0x0 0x0 0x0>;
599+
reset-gpios = <&pinctrl_ap 187 GPIO_ACTIVE_LOW>; // perst
600+
601+
#address-cells = <3>;
602+
#size-cells = <2>;
603+
ranges;
604+
605+
interrupt-controller;
606+
#interrupt-cells = <1>;
607+
608+
interrupt-map-mask = <0 0 0 7>;
609+
interrupt-map = <0 0 0 1 &port00 0 0 0 0>,
610+
<0 0 0 2 &port00 0 0 0 1>,
611+
<0 0 0 3 &port00 0 0 0 2>,
612+
<0 0 0 4 &port00 0 0 0 3>;
613+
};
614+
615+
port01: pci@1,0 {
616+
device_type = "pci";
617+
reg = <0x800 0x0 0x0 0x0 0x0>;
618+
reset-gpios = <&pinctrl_ap 188 GPIO_ACTIVE_LOW>; // perst
619+
620+
#address-cells = <3>;
621+
#size-cells = <2>;
622+
ranges;
623+
624+
interrupt-controller;
625+
#interrupt-cells = <1>;
626+
627+
interrupt-map-mask = <0 0 0 7>;
628+
interrupt-map = <0 0 0 1 &port01 0 0 0 0>,
629+
<0 0 0 2 &port01 0 0 0 1>,
630+
<0 0 0 3 &port01 0 0 0 2>,
631+
<0 0 0 4 &port01 0 0 0 3>;
632+
status = "disabled";
633+
};
634+
635+
port02: pci@2,0 {
636+
device_type = "pci";
637+
reg = <0x1000 0x0 0x0 0x0 0x0>;
638+
reset-gpios = <&pinctrl_ap 189 GPIO_ACTIVE_LOW>; // perst
639+
640+
#address-cells = <3>;
641+
#size-cells = <2>;
642+
ranges;
643+
644+
interrupt-controller;
645+
#interrupt-cells = <1>;
646+
647+
interrupt-map-mask = <0 0 0 7>;
648+
interrupt-map = <0 0 0 1 &port02 0 0 0 0>,
649+
<0 0 0 2 &port02 0 0 0 1>,
650+
<0 0 0 3 &port02 0 0 0 2>,
651+
<0 0 0 4 &port02 0 0 0 3>;
652+
status = "disabled";
653+
};
654+
655+
port03: pci@3,0 {
656+
device_type = "pci";
657+
reg = <0x1800 0x0 0x0 0x0 0x0>;
658+
reset-gpios = <&pinctrl_ap 190 GPIO_ACTIVE_LOW>; // perst
659+
660+
#address-cells = <3>;
661+
#size-cells = <2>;
662+
ranges;
663+
664+
interrupt-controller;
665+
#interrupt-cells = <1>;
666+
667+
interrupt-map-mask = <0 0 0 7>;
668+
interrupt-map = <0 0 0 1 &port03 0 0 0 0>,
669+
<0 0 0 2 &port03 0 0 0 1>,
670+
<0 0 0 3 &port03 0 0 0 2>,
671+
<0 0 0 4 &port03 0 0 0 3>;
672+
status = "disabled";
673+
};
674+
};
507675
};
508676
};
509677

0 commit comments

Comments
 (0)