Skip to content

Commit

Permalink
pci: mediatek: add PCIe controller support for Filogic
Browse files Browse the repository at this point in the history
This adds PCIe controller support for the MediaTek Filogic family..

Signed-off-by: John Crispin <john@phrozen.org>
  • Loading branch information
blogic authored and frank-w committed Feb 4, 2024
1 parent 050b878 commit 705c510
Show file tree
Hide file tree
Showing 7 changed files with 440 additions and 4 deletions.
46 changes: 46 additions & 0 deletions arch/arm/dts/mt7986.dtsi
Expand Up @@ -346,5 +346,51 @@
#phy-cells = <1>;
status = "okay";
};

pcie_port: pcie-phy@11c00000 {
reg = <0x11c00000 0x20000>;
clocks = <&dummy_clk>;
clock-names = "ref";
#phy-cells = <1>;
status = "okay";
};
};

pcie: pcie@11280000 {
compatible = "mediatek,mt7986-pcie",
"mediatek,mt8192-pcie";
device_type = "pci";
reg = <0x11280000 0x4000>;
reg-names = "pcie-mac";
#address-cells = <3>;
#size-cells = <2>;

clocks = <&infracfg_ao CK_INFRA_IPCIE_PIPE_CK>,
<&infracfg_ao CK_INFRA_IPCIE_CK>,
<&infracfg_ao CK_INFRA_IPCIER_CK>,
<&infracfg_ao CK_INFRA_IPCIEB_CK>;
clock-names = "pl_250m", "tl_26m", "peri_26m", "top_133m";

bus-range = <0x00 0xff>;
ranges = <0x82000000 0 0x20000000 0x20000000 0 0x10000000>;

interrupts = <GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>;
#interrupt-cells = <2>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 &pcie_intc 0>, /* INTA */
<0 0 0 2 &pcie_intc 1>, /* INTB */
<0 0 0 3 &pcie_intc 2>, /* INTC */
<0 0 0 4 &pcie_intc 3>; /* INTD */

phy-names = "pcie-phy";
phys = <&pcie_port PHY_TYPE_PCIE>;

status = "okay";

pcie_intc: legacy-interrupt-controller {
interrupt-controller;
#address-cells = <0>;
#interrupt-cells = <1>;
};
};
};
5 changes: 3 additions & 2 deletions drivers/clk/mediatek/clk-mt7986.c
Expand Up @@ -504,8 +504,9 @@ static const struct mtk_gate infracfg_ao_gates[] = {
GATE_INFRA2(CK_INFRA_IUSB_SYS_CK, "infra_iusb_sys", CK_INFRA_USB_SYS_CK,
2),
GATE_INFRA2(CK_INFRA_IUSB_CK, "infra_iusb", CK_INFRA_USB_CK, 3),
GATE_INFRA2(CK_INFRA_IPCIE_CK, "infra_ipcie", CK_INFRA_PCIE_CK, 13),
GATE_INFRA2(CK_INFRA_IPCIER_CK, "infra_ipcier", CK_INFRA_F26M_CK0, 15),
GATE_INFRA2(CK_INFRA_IPCIE_CK, "infra_ipcie", CK_INFRA_PCIE_CK, 12),
GATE_INFRA2(CK_INFRA_IPCIE_PIPE_CK, "infra_ipcie_pipe", CK_INFRA_PCIE_CK, 13),
GATE_INFRA2(CK_INFRA_IPCIER_CK, "infra_ipcier", CK_INFRA_F26M_CK0, 14),
GATE_INFRA2(CK_INFRA_IPCIEB_CK, "infra_ipcieb", CK_INFRA_133M_PHCK, 15),
};

Expand Down
7 changes: 7 additions & 0 deletions drivers/pci/Kconfig
Expand Up @@ -350,6 +350,13 @@ config PCIE_MEDIATEK
Say Y here if you want to enable Gen2 PCIe controller,
which could be found on MT7623 SoC family.

config PCIE_MEDIATEK_GEN3
bool "MediaTek PCIe Gen3 controller"
depends on ARCH_MEDIATEK
help
Say Y here if you want to enable Gen3 PCIe controller,
which could be found on the Mediatek Filogic SoC family.

config PCIE_DW_MESON
bool "Amlogic Meson DesignWare based PCIe controller"
depends on ARCH_MESON
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/Makefile
Expand Up @@ -42,6 +42,7 @@ obj-$(CONFIG_PCIE_INTEL_FPGA) += pcie_intel_fpga.o
obj-$(CONFIG_PCIE_DW_COMMON) += pcie_dw_common.o
obj-$(CONFIG_PCI_KEYSTONE) += pcie_dw_ti.o
obj-$(CONFIG_PCIE_MEDIATEK) += pcie_mediatek.o
obj-$(CONFIG_PCIE_MEDIATEK_GEN3) += pcie_mediatek_gen3.o
obj-$(CONFIG_PCIE_ROCKCHIP) += pcie_rockchip.o
obj-$(CONFIG_PCIE_DW_ROCKCHIP) += pcie_dw_rockchip.o
obj-$(CONFIG_PCIE_DW_MESON) += pcie_dw_meson.o
Expand Down

0 comments on commit 705c510

Please sign in to comment.