* [PATCH 1/5] arm64: apple: Add pinctrl nodes
2021-10-25 21:10 [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Marc Zyngier
@ 2021-10-25 21:10 ` Marc Zyngier
2021-10-25 21:10 ` [PATCH 2/5] arm64: apple: Add PCIe node Marc Zyngier
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2021-10-25 21:10 UTC (permalink / raw)
To: devicetree, linux-arm-kernel
Cc: Mark Kettenis, Sven Peter, Hector Martin, Alyssa Rosenzweig,
kernel-team, Linus Walleij
From: Mark Kettenis <kettenis@openbsd.org>
Add pinctrl nodes corresponding to the gpio,t8101 nodes in the
Apple device tree for the Mac mini (M1, 2020).
Clock references are left out at the moment and will be added once
the appropriate bindings have been settled upon.
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210520171310.772-3-mark.kettenis@xs4all.nl
---
arch/arm64/boot/dts/apple/t8103.dtsi | 87 ++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index a1e22a2ea2e5..7af1ffbc970d 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -9,6 +9,7 @@
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/pinctrl/apple.h>
/ {
compatible = "apple,t8103", "apple,arm-platform";
@@ -131,5 +132,91 @@ aic: interrupt-controller@23b100000 {
interrupt-controller;
reg = <0x2 0x3b100000 0x0 0x8000>;
};
+
+ pinctrl_ap: pinctrl@23c100000 {
+ compatible = "apple,t8103-pinctrl", "apple,pinctrl";
+ reg = <0x2 0x3c100000 0x0 0x100000>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&pinctrl_ap 0 0 212>;
+ apple,npins = <212>;
+
+ interrupt-controller;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 190 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 191 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 192 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 193 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 194 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 195 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 196 IRQ_TYPE_LEVEL_HIGH>;
+
+ pcie_pins: pcie-pins {
+ pinmux = <APPLE_PINMUX(150, 1)>,
+ <APPLE_PINMUX(151, 1)>,
+ <APPLE_PINMUX(32, 1)>;
+ };
+ };
+
+ pinctrl_aop: pinctrl@24a820000 {
+ compatible = "apple,t8103-pinctrl", "apple,pinctrl";
+ reg = <0x2 0x4a820000 0x0 0x4000>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&pinctrl_aop 0 0 42>;
+ apple,npins = <42>;
+
+ interrupt-controller;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 268 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 269 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 270 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 271 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 272 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 273 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 274 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ pinctrl_nub: pinctrl@23d1f0000 {
+ compatible = "apple,t8103-pinctrl", "apple,pinctrl";
+ reg = <0x2 0x3d1f0000 0x0 0x4000>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&pinctrl_nub 0 0 23>;
+ apple,npins = <23>;
+
+ interrupt-controller;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 330 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 331 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 332 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 333 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 334 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 335 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 336 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ pinctrl_smc: pinctrl@23e820000 {
+ compatible = "apple,t8103-pinctrl", "apple,pinctrl";
+ reg = <0x2 0x3e820000 0x0 0x4000>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+ gpio-ranges = <&pinctrl_smc 0 0 16>;
+ apple,npins = <16>;
+
+ interrupt-controller;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 391 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 392 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 393 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 394 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 395 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 396 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 397 IRQ_TYPE_LEVEL_HIGH>;
+ };
};
};
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/5] arm64: apple: Add PCIe node
2021-10-25 21:10 [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Marc Zyngier
2021-10-25 21:10 ` [PATCH 1/5] arm64: apple: Add pinctrl nodes Marc Zyngier
@ 2021-10-25 21:10 ` Marc Zyngier
2021-10-25 21:10 ` [PATCH 3/5] arm64: dts: apple: t8103: Add PCIe DARTs Marc Zyngier
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2021-10-25 21:10 UTC (permalink / raw)
To: devicetree, linux-arm-kernel
Cc: Mark Kettenis, Sven Peter, Hector Martin, Alyssa Rosenzweig,
kernel-team
From: Mark Kettenis <kettenis@openbsd.org>
Add node corresponding to the apcie,t8103 node in the
Apple device tree for the Mac mini (M1, 2020).
Power domain references and DART (IOMMU) references are left out
at the moment and will be added once the appropriate bindings have
been settled upon.
Acked-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210921183420.436-5-kettenis@openbsd.org
---
arch/arm64/boot/dts/apple/t8103.dtsi | 63 ++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index 7af1ffbc970d..ed562e1103a9 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -218,5 +218,68 @@ pinctrl_smc: pinctrl@23e820000 {
<AIC_IRQ 396 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 397 IRQ_TYPE_LEVEL_HIGH>;
};
+
+ pcie0: pcie@690000000 {
+ compatible = "apple,t8103-pcie", "apple,pcie";
+ device_type = "pci";
+
+ reg = <0x6 0x90000000 0x0 0x1000000>,
+ <0x6 0x80000000 0x0 0x100000>,
+ <0x6 0x81000000 0x0 0x4000>,
+ <0x6 0x82000000 0x0 0x4000>,
+ <0x6 0x83000000 0x0 0x4000>;
+ reg-names = "config", "rc", "port0", "port1", "port2";
+
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 695 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 698 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 701 IRQ_TYPE_LEVEL_HIGH>;
+
+ msi-controller;
+ msi-parent = <&pcie0>;
+ msi-ranges = <&aic AIC_IRQ 704 IRQ_TYPE_EDGE_RISING 32>;
+
+ bus-range = <0 3>;
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges = <0x43000000 0x6 0xa0000000 0x6 0xa0000000 0x0 0x20000000>,
+ <0x02000000 0x0 0xc0000000 0x6 0xc0000000 0x0 0x40000000>;
+
+ pinctrl-0 = <&pcie_pins>;
+ pinctrl-names = "default";
+
+ pci@0,0 {
+ device_type = "pci";
+ reg = <0x0 0x0 0x0 0x0 0x0>;
+ reset-gpios = <&pinctrl_ap 152 0>;
+ max-link-speed = <2>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+ };
+
+ pci@1,0 {
+ device_type = "pci";
+ reg = <0x800 0x0 0x0 0x0 0x0>;
+ reset-gpios = <&pinctrl_ap 153 0>;
+ max-link-speed = <2>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+ };
+
+ pci@2,0 {
+ device_type = "pci";
+ reg = <0x1000 0x0 0x0 0x0 0x0>;
+ reset-gpios = <&pinctrl_ap 33 0>;
+ max-link-speed = <1>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+ };
+ };
};
};
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/5] arm64: dts: apple: t8103: Add PCIe DARTs
2021-10-25 21:10 [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Marc Zyngier
2021-10-25 21:10 ` [PATCH 1/5] arm64: apple: Add pinctrl nodes Marc Zyngier
2021-10-25 21:10 ` [PATCH 2/5] arm64: apple: Add PCIe node Marc Zyngier
@ 2021-10-25 21:10 ` Marc Zyngier
2021-10-25 21:10 ` [PATCH 4/5] arm64: dts: apple: t8103: Add root port interrupt routing Marc Zyngier
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2021-10-25 21:10 UTC (permalink / raw)
To: devicetree, linux-arm-kernel
Cc: Mark Kettenis, Sven Peter, Hector Martin, Alyssa Rosenzweig,
kernel-team
PCIe on the Apple M1 (aka t8103) requires the use of IOMMUs (aka
DARTs). Add the three instances that deal with the internal PCIe
ports and route each port's traffic through its DART.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/boot/dts/apple/t8103.dtsi | 30 ++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index ed562e1103a9..ded82a734d11 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -219,6 +219,30 @@ pinctrl_smc: pinctrl@23e820000 {
<AIC_IRQ 397 IRQ_TYPE_LEVEL_HIGH>;
};
+ pcie0_dart_0: dart@681008000 {
+ compatible = "apple,t8103-dart";
+ reg = <0x6 0x81008000 0x0 0x4000>;
+ #iommu-cells = <1>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 696 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ pcie0_dart_1: dart@682008000 {
+ compatible = "apple,t8103-dart";
+ reg = <0x6 0x82008000 0x0 0x4000>;
+ #iommu-cells = <1>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 699 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ pcie0_dart_2: dart@683008000 {
+ compatible = "apple,t8103-dart";
+ reg = <0x6 0x83008000 0x0 0x4000>;
+ #iommu-cells = <1>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 702 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
pcie0: pcie@690000000 {
compatible = "apple,t8103-pcie", "apple,pcie";
device_type = "pci";
@@ -239,6 +263,12 @@ pcie0: pcie@690000000 {
msi-parent = <&pcie0>;
msi-ranges = <&aic AIC_IRQ 704 IRQ_TYPE_EDGE_RISING 32>;
+
+ iommu-map = <0x100 &pcie0_dart_0 1 1>,
+ <0x200 &pcie0_dart_1 1 1>,
+ <0x300 &pcie0_dart_2 1 1>;
+ iommu-map-mask = <0xff00>;
+
bus-range = <0 3>;
#address-cells = <3>;
#size-cells = <2>;
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/5] arm64: dts: apple: t8103: Add root port interrupt routing
2021-10-25 21:10 [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Marc Zyngier
` (2 preceding siblings ...)
2021-10-25 21:10 ` [PATCH 3/5] arm64: dts: apple: t8103: Add PCIe DARTs Marc Zyngier
@ 2021-10-25 21:10 ` Marc Zyngier
2021-10-25 21:10 ` [PATCH 5/5] arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address Marc Zyngier
2021-10-27 2:10 ` [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Hector Martin
5 siblings, 0 replies; 8+ messages in thread
From: Marc Zyngier @ 2021-10-25 21:10 UTC (permalink / raw)
To: devicetree, linux-arm-kernel
Cc: Mark Kettenis, Sven Peter, Hector Martin, Alyssa Rosenzweig,
kernel-team
Add the interrupt-map properties that are required for INTx
signalling.
Tested-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/boot/dts/apple/t8103.dtsi | 33 +++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index ded82a734d11..fc8b2bb06ffe 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -278,7 +278,7 @@ pcie0: pcie@690000000 {
pinctrl-0 = <&pcie_pins>;
pinctrl-names = "default";
- pci@0,0 {
+ port00: pci@0,0 {
device_type = "pci";
reg = <0x0 0x0 0x0 0x0 0x0>;
reset-gpios = <&pinctrl_ap 152 0>;
@@ -287,9 +287,18 @@ pci@0,0 {
#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>;
};
- pci@1,0 {
+ port01: pci@1,0 {
device_type = "pci";
reg = <0x800 0x0 0x0 0x0 0x0>;
reset-gpios = <&pinctrl_ap 153 0>;
@@ -298,9 +307,18 @@ pci@1,0 {
#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 &port01 0 0 0 0>,
+ <0 0 0 2 &port01 0 0 0 1>,
+ <0 0 0 3 &port01 0 0 0 2>,
+ <0 0 0 4 &port01 0 0 0 3>;
};
- pci@2,0 {
+ port02: pci@2,0 {
device_type = "pci";
reg = <0x1000 0x0 0x0 0x0 0x0>;
reset-gpios = <&pinctrl_ap 33 0>;
@@ -309,6 +327,15 @@ pci@2,0 {
#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 &port02 0 0 0 0>,
+ <0 0 0 2 &port02 0 0 0 1>,
+ <0 0 0 3 &port02 0 0 0 2>,
+ <0 0 0 4 &port02 0 0 0 3>;
};
};
};
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/5] arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address
2021-10-25 21:10 [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Marc Zyngier
` (3 preceding siblings ...)
2021-10-25 21:10 ` [PATCH 4/5] arm64: dts: apple: t8103: Add root port interrupt routing Marc Zyngier
@ 2021-10-25 21:10 ` Marc Zyngier
2021-10-25 21:45 ` Alyssa Rosenzweig
2021-10-27 2:10 ` [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Hector Martin
5 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2021-10-25 21:10 UTC (permalink / raw)
To: devicetree, linux-arm-kernel
Cc: Mark Kettenis, Sven Peter, Hector Martin, Alyssa Rosenzweig,
kernel-team
At the moment, all the Minis running Linux have the same MAC
address (00:10:18:00:00:00), which is a bit annoying.
Expose the PCI node corresponding to the Ethernet device, and
declare a 'local-mac-address' property. The bootloader will update
it (m1n1 already has the required feature). And if it doesn't, then
the default value is already present in the DT.
This relies on forcing the bus number for each port so that the
endpoints connected to them are correctly numbered (and keeps dtc
quiet).
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
arch/arm64/boot/dts/apple/t8103-j274.dts | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8103-j274.dts b/arch/arm64/boot/dts/apple/t8103-j274.dts
index e0f6775b9878..33a80f9501dc 100644
--- a/arch/arm64/boot/dts/apple/t8103-j274.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j274.dts
@@ -17,6 +17,7 @@ / {
aliases {
serial0 = &serial0;
+ ethernet0 = ðernet0;
};
chosen {
@@ -43,3 +44,25 @@ memory@800000000 {
&serial0 {
status = "okay";
};
+
+/*
+ * Force the bus number assignments so that we can declare some of the
+ * on-board devices and properties that are populated by the bootloader
+ * (such as MAC addresses).
+ */
+&port00 {
+ bus-range = <1 1>;
+};
+
+&port01 {
+ bus-range = <2 2>;
+};
+
+&port02 {
+ bus-range = <3 3>;
+ ethernet0: pci@0,0 {
+ reg = <0x30000 0x0 0x0 0x0 0x0>;
+ /* To be filled by the loader */
+ local-mac-address = [00 10 18 00 00 00];
+ };
+};
--
2.30.2
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support
2021-10-25 21:10 [PATCH 0/5] arm64: apple: DT updates for M1 PCIe support Marc Zyngier
` (4 preceding siblings ...)
2021-10-25 21:10 ` [PATCH 5/5] arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address Marc Zyngier
@ 2021-10-27 2:10 ` Hector Martin
5 siblings, 0 replies; 8+ messages in thread
From: Hector Martin @ 2021-10-27 2:10 UTC (permalink / raw)
To: Marc Zyngier, devicetree, linux-arm-kernel
Cc: Mark Kettenis, Sven Peter, Alyssa Rosenzweig, kernel-team
On 26/10/2021 06.10, Marc Zyngier wrote:
> Now that most of the PCIe dependencies are on their way to 5.16,
> here are the last missing pieces in the form of DT updates.
>
> Marc Zyngier (3):
> arm64: dts: apple: t8103: Add PCIe DARTs
> arm64: dts: apple: t8103: Add root port interrupt routing
> arm64: dts: apple: j274: Expose PCI node for the Ethernet MAC address
>
> Mark Kettenis (2):
> arm64: apple: Add pinctrl nodes
> arm64: apple: Add PCIe node
>
> arch/arm64/boot/dts/apple/t8103-j274.dts | 23 +++
> arch/arm64/boot/dts/apple/t8103.dtsi | 207 +++++++++++++++++++++++
> 2 files changed, 230 insertions(+)
>
Thank you! I've merged this into asahi-soc/dt. Things are getting tied
together nicely for 5.16 :)
Acked-by: Hector Martin <marcan@marcan.st>
--
Hector Martin (marcan@marcan.st)
Public Key: https://mrcn.st/pub
^ permalink raw reply [flat|nested] 8+ messages in thread