Skip to contentSkip to conversation

dt-bindings: PCI: Add support for Airoha EN7532

PATCH RESEND Applied Felix Fietkau 3 participants 5 messages Jun 15, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v10 1/3 dt-bindings: PCI: Add support for Airoha EN7532

From: John Crispin <[email protected]>

EN7532 is an ARM based platform SoC integrating the same PCIe IP as MT7622, add a binding for it.

---
 Documentation/devicetree/bindings/pci/mediatek-pcie.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/pci/mediatek-pcie.txt +1 -0
index 57ae73462272..684227522267 100644
@@ -7,6 +7,7 @@ Required properties:
 	"mediatek,mt7622-pcie"
 	"mediatek,mt7623-pcie"
 	"mediatek,mt7629-pcie"
+	"airoha,en7523-pcie"
 - device_type: Must be "pci"
 - reg: Base addresses and lengths of the root ports.
 - reg-names: Names of the above areas to use during resource lookup.
Signature · 1 line
2.36.1
#1 lore raw

PATCH RESEND v10 2/3 PCI: mediatek: Allow building for ARCH_AIROHA

Allow selecting the pcie-mediatek driver if ARCH_AIROHA is set, because the Airoha EN7523 SoC uses the same controller as MT7622.
The driver itself is not modified. The PCIe controller DT node should use mediatek,mt7622-pcie after airoha,en7523-pcie.

---
 drivers/pci/controller/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/Kconfig +1 -1
index b8d96d38064d..2f6806dc2a20 100644
@@ -237,7 +237,7 @@ config PCIE_ROCKCHIP_EP
 
 config PCIE_MEDIATEK
 	tristate "MediaTek PCIe controller"
-	depends on ARCH_MEDIATEK || COMPILE_TEST
+	depends on ARCH_AIROHA || ARCH_MEDIATEK || COMPILE_TEST
 	depends on OF
 	depends on PCI_MSI_IRQ_DOMAIN
 	help
Signature · 1 line
2.36.1
#2 lore raw

PATCH RESEND v10 3/3 ARM: dts: Add PCIe support for Airoha EN7523

In reply to Felix Fietkau

This uses the MediaTek MT7622 PCIe driver, since the PCIe IP block is nearly identical to the one in MT7622

---
 arch/arm/boot/dts/en7523-evb.dts |  8 +++++
 arch/arm/boot/dts/en7523.dtsi    | 58 ++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)
arch/arm/boot/dts/en7523-evb.dts +8 -0
index a8d8bb0419a0..f23a25cce119 100644
@@ -33,3 +33,11 @@ &gpio0 {
 &gpio1 {
 	status = "okay";
 };
+
+&pcie0 {
+	status = "okay";
+};
+
+&pcie1 {
+	status = "okay";
+};
arch/arm/boot/dts/en7523.dtsi +58 -0

62 lines not on this page · raw message

Signature · 1 line
2.36.1
#4 lore raw
In reply to Felix Fietkau
Quoted 8 lines · Felix Fietkau

From: John Crispin <[email protected]>

EN7532 is an ARM based platform SoC integrating the same PCIe IP as MT7622, add a binding for it.

Applied patches 1 & 2 to pci/ctrl/mediatek for v5.20, thanks!

I assume patch 3 for:

arch/arm/boot/dts/en7523-evb.dts
arch/arm/boot/dts/en7523.dtsi

needs to go through an ARM tree, right?

Quoted 19 lines
---
 Documentation/devicetree/bindings/pci/mediatek-pcie.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/pci/mediatek-pcie.txt +1 -0
index 57ae73462272..684227522267 100644
@@ -7,6 +7,7 @@ Required properties:
 	"mediatek,mt7622-pcie"
 	"mediatek,mt7623-pcie"
 	"mediatek,mt7629-pcie"
+	"airoha,en7523-pcie"
 - device_type: Must be "pci"
 - reg: Base addresses and lengths of the root ports.
 - reg-names: Names of the above areas to use during resource lookup.
Signature · 1 line
2.36.1
maintainer Applied
#3 lore raw

Re: [PATCH RESEND v10 3/3] ARM: dts: Add PCIe support for Airoha EN7523

In reply to Felix Fietkau
Quoted 4 lines · Felix Fietkau

This uses the MediaTek MT7622 PCIe driver, since the PCIe IP block is nearly identical to the one in MT7622

applied to v5.19-next/dts32

Thanks!

Quoted 88 lines
---
  arch/arm/boot/dts/en7523-evb.dts |  8 +++++
  arch/arm/boot/dts/en7523.dtsi    | 58 ++++++++++++++++++++++++++++++++
  2 files changed, 66 insertions(+)
arch/arm/boot/dts/en7523-evb.dts +8 -0
index a8d8bb0419a0..f23a25cce119 100644
@@ -33,3 +33,11 @@ &gpio0 {
  &gpio1 {
  	status = "okay";
  };
+
+&pcie0 {
+	status = "okay";
+};
+
+&pcie1 {
+	status = "okay";
+};
arch/arm/boot/dts/en7523.dtsi +58 -0
index 2e705b87b6c1..7f839331a777 100644
@@ -143,4 +143,62 @@ gpio1: gpio@1fbf0270 {
  		gpio-controller;
  		#gpio-cells = <2>;
  	};
+
+	pcie0: pcie@1fa91000 {
+		compatible = "airoha,en7523-pcie", "mediatek,mt7622-pcie";
+		device_type = "pci";
+		reg = <0x1fa91000 0x1000>;
+		reg-names = "port0";
+		linux,pci-domain = <0>;
+		#address-cells = <3>;
+		#size-cells = <2>;
+		interrupts = <GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "pcie_irq";
+		clocks = <&scu EN7523_CLK_PCIE>;
+		clock-names = "sys_ck0";
+		bus-range = <0x00 0xff>;
+		ranges = <0x82000000 0 0x20000000  0x20000000  0 0x8000000>;
+		status = "disabled";
+
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0 0 0 7>;
+		interrupt-map = <0 0 0 1 &pcie_intc0 0>,
+				<0 0 0 2 &pcie_intc0 1>,
+				<0 0 0 3 &pcie_intc0 2>,
+				<0 0 0 4 &pcie_intc0 3>;
+		pcie_intc0: interrupt-controller {
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <1>;
+		};
+	};
+
+	pcie1: pcie@1fa92000 {
+		compatible = "airoha,en7523-pcie", "mediatek,mt7622-pcie";
+		device_type = "pci";
+		reg = <0x1fa92000 0x1000>;
+		reg-names = "port1";
+		linux,pci-domain = <1>;
+		#address-cells = <3>;
+		#size-cells = <2>;
+		interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>;
+		interrupt-names = "pcie_irq";
+		clocks = <&scu EN7523_CLK_PCIE>;
+		clock-names = "sys_ck1";
+		bus-range = <0x00 0xff>;
+		ranges = <0x82000000 0 0x28000000  0x28000000  0 0x8000000>;
+		status = "disabled";
+
+		#interrupt-cells = <1>;
+		interrupt-map-mask = <0 0 0 7>;
+		interrupt-map = <0 0 0 1 &pcie_intc1 0>,
+				<0 0 0 2 &pcie_intc1 1>,
+				<0 0 0 3 &pcie_intc1 2>,
+				<0 0 0 4 &pcie_intc1 3>;
+		pcie_intc1: interrupt-controller {
+			interrupt-controller;
+			#address-cells = <0>;
+			#interrupt-cells = <1>;
+		};
+	};
  };