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