1*c66ec88fSEmmanuel VadotMediaTek Gen2 PCIe controller 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotRequired properties: 4*c66ec88fSEmmanuel Vadot- compatible: Should contain one of the following strings: 5*c66ec88fSEmmanuel Vadot "mediatek,mt2701-pcie" 6*c66ec88fSEmmanuel Vadot "mediatek,mt2712-pcie" 7*c66ec88fSEmmanuel Vadot "mediatek,mt7622-pcie" 8*c66ec88fSEmmanuel Vadot "mediatek,mt7623-pcie" 9*c66ec88fSEmmanuel Vadot "mediatek,mt7629-pcie" 10*c66ec88fSEmmanuel Vadot- device_type: Must be "pci" 11*c66ec88fSEmmanuel Vadot- reg: Base addresses and lengths of the PCIe subsys and root ports. 12*c66ec88fSEmmanuel Vadot- reg-names: Names of the above areas to use during resource lookup. 13*c66ec88fSEmmanuel Vadot- #address-cells: Address representation for root ports (must be 3) 14*c66ec88fSEmmanuel Vadot- #size-cells: Size representation for root ports (must be 2) 15*c66ec88fSEmmanuel Vadot- clocks: Must contain an entry for each entry in clock-names. 16*c66ec88fSEmmanuel Vadot See ../clocks/clock-bindings.txt for details. 17*c66ec88fSEmmanuel Vadot- clock-names: 18*c66ec88fSEmmanuel Vadot Mandatory entries: 19*c66ec88fSEmmanuel Vadot - sys_ckN :transaction layer and data link layer clock 20*c66ec88fSEmmanuel Vadot Required entries for MT2701/MT7623: 21*c66ec88fSEmmanuel Vadot - free_ck :for reference clock of PCIe subsys 22*c66ec88fSEmmanuel Vadot Required entries for MT2712/MT7622: 23*c66ec88fSEmmanuel Vadot - ahb_ckN :AHB slave interface operating clock for CSR access and RC 24*c66ec88fSEmmanuel Vadot initiated MMIO access 25*c66ec88fSEmmanuel Vadot Required entries for MT7622: 26*c66ec88fSEmmanuel Vadot - axi_ckN :application layer MMIO channel operating clock 27*c66ec88fSEmmanuel Vadot - aux_ckN :pe2_mac_bridge and pe2_mac_core operating clock when 28*c66ec88fSEmmanuel Vadot pcie_mac_ck/pcie_pipe_ck is turned off 29*c66ec88fSEmmanuel Vadot - obff_ckN :OBFF functional block operating clock 30*c66ec88fSEmmanuel Vadot - pipe_ckN :LTSSM and PHY/MAC layer operating clock 31*c66ec88fSEmmanuel Vadot where N starting from 0 to one less than the number of root ports. 32*c66ec88fSEmmanuel Vadot- phys: List of PHY specifiers (used by generic PHY framework). 33*c66ec88fSEmmanuel Vadot- phy-names : Must be "pcie-phy0", "pcie-phy1", "pcie-phyN".. based on the 34*c66ec88fSEmmanuel Vadot number of PHYs as specified in *phys* property. 35*c66ec88fSEmmanuel Vadot- power-domains: A phandle and power domain specifier pair to the power domain 36*c66ec88fSEmmanuel Vadot which is responsible for collapsing and restoring power to the peripheral. 37*c66ec88fSEmmanuel Vadot- bus-range: Range of bus numbers associated with this controller. 38*c66ec88fSEmmanuel Vadot- ranges: Ranges for the PCI memory and I/O regions. 39*c66ec88fSEmmanuel Vadot 40*c66ec88fSEmmanuel VadotRequired properties for MT7623/MT2701: 41*c66ec88fSEmmanuel Vadot- #interrupt-cells: Size representation for interrupts (must be 1) 42*c66ec88fSEmmanuel Vadot- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties 43*c66ec88fSEmmanuel Vadot Please refer to the standard PCI bus binding document for a more detailed 44*c66ec88fSEmmanuel Vadot explanation. 45*c66ec88fSEmmanuel Vadot- resets: Must contain an entry for each entry in reset-names. 46*c66ec88fSEmmanuel Vadot See ../reset/reset.txt for details. 47*c66ec88fSEmmanuel Vadot- reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the 48*c66ec88fSEmmanuel Vadot number of root ports. 49*c66ec88fSEmmanuel Vadot 50*c66ec88fSEmmanuel VadotRequired properties for MT2712/MT7622: 51*c66ec88fSEmmanuel Vadot-interrupts: A list of interrupt outputs of the controller, must have one 52*c66ec88fSEmmanuel Vadot entry for each PCIe port 53*c66ec88fSEmmanuel Vadot 54*c66ec88fSEmmanuel VadotIn addition, the device tree node must have sub-nodes describing each 55*c66ec88fSEmmanuel VadotPCIe port interface, having the following mandatory properties: 56*c66ec88fSEmmanuel Vadot 57*c66ec88fSEmmanuel VadotRequired properties: 58*c66ec88fSEmmanuel Vadot- device_type: Must be "pci" 59*c66ec88fSEmmanuel Vadot- reg: Only the first four bytes are used to refer to the correct bus number 60*c66ec88fSEmmanuel Vadot and device number. 61*c66ec88fSEmmanuel Vadot- #address-cells: Must be 3 62*c66ec88fSEmmanuel Vadot- #size-cells: Must be 2 63*c66ec88fSEmmanuel Vadot- #interrupt-cells: Must be 1 64*c66ec88fSEmmanuel Vadot- interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties 65*c66ec88fSEmmanuel Vadot Please refer to the standard PCI bus binding document for a more detailed 66*c66ec88fSEmmanuel Vadot explanation. 67*c66ec88fSEmmanuel Vadot- ranges: Sub-ranges distributed from the PCIe controller node. An empty 68*c66ec88fSEmmanuel Vadot property is sufficient. 69*c66ec88fSEmmanuel Vadot 70*c66ec88fSEmmanuel VadotExamples for MT7623: 71*c66ec88fSEmmanuel Vadot 72*c66ec88fSEmmanuel Vadot hifsys: syscon@1a000000 { 73*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt7623-hifsys", 74*c66ec88fSEmmanuel Vadot "mediatek,mt2701-hifsys", 75*c66ec88fSEmmanuel Vadot "syscon"; 76*c66ec88fSEmmanuel Vadot reg = <0 0x1a000000 0 0x1000>; 77*c66ec88fSEmmanuel Vadot #clock-cells = <1>; 78*c66ec88fSEmmanuel Vadot #reset-cells = <1>; 79*c66ec88fSEmmanuel Vadot }; 80*c66ec88fSEmmanuel Vadot 81*c66ec88fSEmmanuel Vadot pcie: pcie@1a140000 { 82*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt7623-pcie"; 83*c66ec88fSEmmanuel Vadot device_type = "pci"; 84*c66ec88fSEmmanuel Vadot reg = <0 0x1a140000 0 0x1000>, /* PCIe shared registers */ 85*c66ec88fSEmmanuel Vadot <0 0x1a142000 0 0x1000>, /* Port0 registers */ 86*c66ec88fSEmmanuel Vadot <0 0x1a143000 0 0x1000>, /* Port1 registers */ 87*c66ec88fSEmmanuel Vadot <0 0x1a144000 0 0x1000>; /* Port2 registers */ 88*c66ec88fSEmmanuel Vadot reg-names = "subsys", "port0", "port1", "port2"; 89*c66ec88fSEmmanuel Vadot #address-cells = <3>; 90*c66ec88fSEmmanuel Vadot #size-cells = <2>; 91*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 92*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0xf800 0 0 0>; 93*c66ec88fSEmmanuel Vadot interrupt-map = <0x0000 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>, 94*c66ec88fSEmmanuel Vadot <0x0800 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>, 95*c66ec88fSEmmanuel Vadot <0x1000 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>; 96*c66ec88fSEmmanuel Vadot clocks = <&topckgen CLK_TOP_ETHIF_SEL>, 97*c66ec88fSEmmanuel Vadot <&hifsys CLK_HIFSYS_PCIE0>, 98*c66ec88fSEmmanuel Vadot <&hifsys CLK_HIFSYS_PCIE1>, 99*c66ec88fSEmmanuel Vadot <&hifsys CLK_HIFSYS_PCIE2>; 100*c66ec88fSEmmanuel Vadot clock-names = "free_ck", "sys_ck0", "sys_ck1", "sys_ck2"; 101*c66ec88fSEmmanuel Vadot resets = <&hifsys MT2701_HIFSYS_PCIE0_RST>, 102*c66ec88fSEmmanuel Vadot <&hifsys MT2701_HIFSYS_PCIE1_RST>, 103*c66ec88fSEmmanuel Vadot <&hifsys MT2701_HIFSYS_PCIE2_RST>; 104*c66ec88fSEmmanuel Vadot reset-names = "pcie-rst0", "pcie-rst1", "pcie-rst2"; 105*c66ec88fSEmmanuel Vadot phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>, 106*c66ec88fSEmmanuel Vadot <&pcie2_phy PHY_TYPE_PCIE>; 107*c66ec88fSEmmanuel Vadot phy-names = "pcie-phy0", "pcie-phy1", "pcie-phy2"; 108*c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT2701_POWER_DOMAIN_HIF>; 109*c66ec88fSEmmanuel Vadot bus-range = <0x00 0xff>; 110*c66ec88fSEmmanuel Vadot ranges = <0x81000000 0 0x1a160000 0 0x1a160000 0 0x00010000 /* I/O space */ 111*c66ec88fSEmmanuel Vadot 0x83000000 0 0x60000000 0 0x60000000 0 0x10000000>; /* memory space */ 112*c66ec88fSEmmanuel Vadot 113*c66ec88fSEmmanuel Vadot pcie@0,0 { 114*c66ec88fSEmmanuel Vadot reg = <0x0000 0 0 0 0>; 115*c66ec88fSEmmanuel Vadot #address-cells = <3>; 116*c66ec88fSEmmanuel Vadot #size-cells = <2>; 117*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 118*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 0>; 119*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 0 &sysirq GIC_SPI 193 IRQ_TYPE_LEVEL_LOW>; 120*c66ec88fSEmmanuel Vadot ranges; 121*c66ec88fSEmmanuel Vadot }; 122*c66ec88fSEmmanuel Vadot 123*c66ec88fSEmmanuel Vadot pcie@1,0 { 124*c66ec88fSEmmanuel Vadot reg = <0x0800 0 0 0 0>; 125*c66ec88fSEmmanuel Vadot #address-cells = <3>; 126*c66ec88fSEmmanuel Vadot #size-cells = <2>; 127*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 128*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 0>; 129*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 0 &sysirq GIC_SPI 194 IRQ_TYPE_LEVEL_LOW>; 130*c66ec88fSEmmanuel Vadot ranges; 131*c66ec88fSEmmanuel Vadot }; 132*c66ec88fSEmmanuel Vadot 133*c66ec88fSEmmanuel Vadot pcie@2,0 { 134*c66ec88fSEmmanuel Vadot reg = <0x1000 0 0 0 0>; 135*c66ec88fSEmmanuel Vadot #address-cells = <3>; 136*c66ec88fSEmmanuel Vadot #size-cells = <2>; 137*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 138*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 0>; 139*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 0 &sysirq GIC_SPI 195 IRQ_TYPE_LEVEL_LOW>; 140*c66ec88fSEmmanuel Vadot ranges; 141*c66ec88fSEmmanuel Vadot }; 142*c66ec88fSEmmanuel Vadot }; 143*c66ec88fSEmmanuel Vadot 144*c66ec88fSEmmanuel VadotExamples for MT2712: 145*c66ec88fSEmmanuel Vadot 146*c66ec88fSEmmanuel Vadot pcie: pcie@11700000 { 147*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt2712-pcie"; 148*c66ec88fSEmmanuel Vadot device_type = "pci"; 149*c66ec88fSEmmanuel Vadot reg = <0 0x11700000 0 0x1000>, 150*c66ec88fSEmmanuel Vadot <0 0x112ff000 0 0x1000>; 151*c66ec88fSEmmanuel Vadot reg-names = "port0", "port1"; 152*c66ec88fSEmmanuel Vadot #address-cells = <3>; 153*c66ec88fSEmmanuel Vadot #size-cells = <2>; 154*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>, 155*c66ec88fSEmmanuel Vadot <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; 156*c66ec88fSEmmanuel Vadot clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>, 157*c66ec88fSEmmanuel Vadot <&topckgen CLK_TOP_PE2_MAC_P1_SEL>, 158*c66ec88fSEmmanuel Vadot <&pericfg CLK_PERI_PCIE0>, 159*c66ec88fSEmmanuel Vadot <&pericfg CLK_PERI_PCIE1>; 160*c66ec88fSEmmanuel Vadot clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1"; 161*c66ec88fSEmmanuel Vadot phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; 162*c66ec88fSEmmanuel Vadot phy-names = "pcie-phy0", "pcie-phy1"; 163*c66ec88fSEmmanuel Vadot bus-range = <0x00 0xff>; 164*c66ec88fSEmmanuel Vadot ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; 165*c66ec88fSEmmanuel Vadot 166*c66ec88fSEmmanuel Vadot pcie0: pcie@0,0 { 167*c66ec88fSEmmanuel Vadot reg = <0x0000 0 0 0 0>; 168*c66ec88fSEmmanuel Vadot #address-cells = <3>; 169*c66ec88fSEmmanuel Vadot #size-cells = <2>; 170*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 171*c66ec88fSEmmanuel Vadot ranges; 172*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 7>; 173*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 1 &pcie_intc0 0>, 174*c66ec88fSEmmanuel Vadot <0 0 0 2 &pcie_intc0 1>, 175*c66ec88fSEmmanuel Vadot <0 0 0 3 &pcie_intc0 2>, 176*c66ec88fSEmmanuel Vadot <0 0 0 4 &pcie_intc0 3>; 177*c66ec88fSEmmanuel Vadot pcie_intc0: interrupt-controller { 178*c66ec88fSEmmanuel Vadot interrupt-controller; 179*c66ec88fSEmmanuel Vadot #address-cells = <0>; 180*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 181*c66ec88fSEmmanuel Vadot }; 182*c66ec88fSEmmanuel Vadot }; 183*c66ec88fSEmmanuel Vadot 184*c66ec88fSEmmanuel Vadot pcie1: pcie@1,0 { 185*c66ec88fSEmmanuel Vadot reg = <0x0800 0 0 0 0>; 186*c66ec88fSEmmanuel Vadot #address-cells = <3>; 187*c66ec88fSEmmanuel Vadot #size-cells = <2>; 188*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 189*c66ec88fSEmmanuel Vadot ranges; 190*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 7>; 191*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 1 &pcie_intc1 0>, 192*c66ec88fSEmmanuel Vadot <0 0 0 2 &pcie_intc1 1>, 193*c66ec88fSEmmanuel Vadot <0 0 0 3 &pcie_intc1 2>, 194*c66ec88fSEmmanuel Vadot <0 0 0 4 &pcie_intc1 3>; 195*c66ec88fSEmmanuel Vadot pcie_intc1: interrupt-controller { 196*c66ec88fSEmmanuel Vadot interrupt-controller; 197*c66ec88fSEmmanuel Vadot #address-cells = <0>; 198*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 199*c66ec88fSEmmanuel Vadot }; 200*c66ec88fSEmmanuel Vadot }; 201*c66ec88fSEmmanuel Vadot }; 202*c66ec88fSEmmanuel Vadot 203*c66ec88fSEmmanuel VadotExamples for MT7622: 204*c66ec88fSEmmanuel Vadot 205*c66ec88fSEmmanuel Vadot pcie: pcie@1a140000 { 206*c66ec88fSEmmanuel Vadot compatible = "mediatek,mt7622-pcie"; 207*c66ec88fSEmmanuel Vadot device_type = "pci"; 208*c66ec88fSEmmanuel Vadot reg = <0 0x1a140000 0 0x1000>, 209*c66ec88fSEmmanuel Vadot <0 0x1a143000 0 0x1000>, 210*c66ec88fSEmmanuel Vadot <0 0x1a145000 0 0x1000>; 211*c66ec88fSEmmanuel Vadot reg-names = "subsys", "port0", "port1"; 212*c66ec88fSEmmanuel Vadot #address-cells = <3>; 213*c66ec88fSEmmanuel Vadot #size-cells = <2>; 214*c66ec88fSEmmanuel Vadot interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>, 215*c66ec88fSEmmanuel Vadot <GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>; 216*c66ec88fSEmmanuel Vadot clocks = <&pciesys CLK_PCIE_P0_MAC_EN>, 217*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P1_MAC_EN>, 218*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P0_AHB_EN>, 219*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P1_AHB_EN>, 220*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P0_AUX_EN>, 221*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P1_AUX_EN>, 222*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P0_AXI_EN>, 223*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P1_AXI_EN>, 224*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P0_OBFF_EN>, 225*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P1_OBFF_EN>, 226*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P0_PIPE_EN>, 227*c66ec88fSEmmanuel Vadot <&pciesys CLK_PCIE_P1_PIPE_EN>; 228*c66ec88fSEmmanuel Vadot clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1", 229*c66ec88fSEmmanuel Vadot "aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1", 230*c66ec88fSEmmanuel Vadot "obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1"; 231*c66ec88fSEmmanuel Vadot phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>; 232*c66ec88fSEmmanuel Vadot phy-names = "pcie-phy0", "pcie-phy1"; 233*c66ec88fSEmmanuel Vadot power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>; 234*c66ec88fSEmmanuel Vadot bus-range = <0x00 0xff>; 235*c66ec88fSEmmanuel Vadot ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>; 236*c66ec88fSEmmanuel Vadot 237*c66ec88fSEmmanuel Vadot pcie0: pcie@0,0 { 238*c66ec88fSEmmanuel Vadot reg = <0x0000 0 0 0 0>; 239*c66ec88fSEmmanuel Vadot #address-cells = <3>; 240*c66ec88fSEmmanuel Vadot #size-cells = <2>; 241*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 242*c66ec88fSEmmanuel Vadot ranges; 243*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 7>; 244*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 1 &pcie_intc0 0>, 245*c66ec88fSEmmanuel Vadot <0 0 0 2 &pcie_intc0 1>, 246*c66ec88fSEmmanuel Vadot <0 0 0 3 &pcie_intc0 2>, 247*c66ec88fSEmmanuel Vadot <0 0 0 4 &pcie_intc0 3>; 248*c66ec88fSEmmanuel Vadot pcie_intc0: interrupt-controller { 249*c66ec88fSEmmanuel Vadot interrupt-controller; 250*c66ec88fSEmmanuel Vadot #address-cells = <0>; 251*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 252*c66ec88fSEmmanuel Vadot }; 253*c66ec88fSEmmanuel Vadot }; 254*c66ec88fSEmmanuel Vadot 255*c66ec88fSEmmanuel Vadot pcie1: pcie@1,0 { 256*c66ec88fSEmmanuel Vadot reg = <0x0800 0 0 0 0>; 257*c66ec88fSEmmanuel Vadot #address-cells = <3>; 258*c66ec88fSEmmanuel Vadot #size-cells = <2>; 259*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 260*c66ec88fSEmmanuel Vadot ranges; 261*c66ec88fSEmmanuel Vadot interrupt-map-mask = <0 0 0 7>; 262*c66ec88fSEmmanuel Vadot interrupt-map = <0 0 0 1 &pcie_intc1 0>, 263*c66ec88fSEmmanuel Vadot <0 0 0 2 &pcie_intc1 1>, 264*c66ec88fSEmmanuel Vadot <0 0 0 3 &pcie_intc1 2>, 265*c66ec88fSEmmanuel Vadot <0 0 0 4 &pcie_intc1 3>; 266*c66ec88fSEmmanuel Vadot pcie_intc1: interrupt-controller { 267*c66ec88fSEmmanuel Vadot interrupt-controller; 268*c66ec88fSEmmanuel Vadot #address-cells = <0>; 269*c66ec88fSEmmanuel Vadot #interrupt-cells = <1>; 270*c66ec88fSEmmanuel Vadot }; 271*c66ec88fSEmmanuel Vadot }; 272*c66ec88fSEmmanuel Vadot }; 273