Skip to content

Commit c501cf9

Browse files
committed
Merge branch 'remotes/lorenzo/pci/mediatek'
- Split DT bindings for PCIe controllers with independent MSI domains into separate nodes for MT2712/MT7622 (Chuanjia Liu) - Locate shared registers from "mediatek,generic-pciecfg" property (Chuanjia Liu) - Get IRQ from "pcie_irq" if "interrupt-names" property is present to fix an MSI issue (Chuanjia Liu) - Get PCI domain from "linux,pci-domain" property if present (Chuanjia Liu) * remotes/lorenzo/pci/mediatek: PCI: mediatek: Use PCI domain to handle ports detection PCI: mediatek: Add new method to get irq number PCI: mediatek: Add new method to get shared pcie-cfg base address dt-bindings: PCI: mediatek: Update the Device tree bindings
2 parents af42a0d + 7721670 commit c501cf9

File tree

3 files changed

+189
-108
lines changed

3 files changed

+189
-108
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/pci/mediatek-pcie-cfg.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: MediaTek PCIECFG controller
8+
9+
maintainers:
10+
- Chuanjia Liu <[email protected]>
11+
- Jianjun Wang <[email protected]>
12+
13+
description: |
14+
The MediaTek PCIECFG controller controls some feature about
15+
LTSSM, ASPM and so on.
16+
17+
properties:
18+
compatible:
19+
items:
20+
- enum:
21+
- mediatek,generic-pciecfg
22+
- const: syscon
23+
24+
reg:
25+
maxItems: 1
26+
27+
required:
28+
- compatible
29+
- reg
30+
31+
additionalProperties: false
32+
33+
examples:
34+
- |
35+
pciecfg: pciecfg@1a140000 {
36+
compatible = "mediatek,generic-pciecfg", "syscon";
37+
reg = <0x1a140000 0x1000>;
38+
};
39+
...

Documentation/devicetree/bindings/pci/mediatek-pcie.txt

Lines changed: 111 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Required properties:
88
"mediatek,mt7623-pcie"
99
"mediatek,mt7629-pcie"
1010
- device_type: Must be "pci"
11-
- reg: Base addresses and lengths of the PCIe subsys and root ports.
11+
- reg: Base addresses and lengths of the root ports.
1212
- reg-names: Names of the above areas to use during resource lookup.
1313
- #address-cells: Address representation for root ports (must be 3)
1414
- #size-cells: Size representation for root ports (must be 2)
@@ -47,9 +47,12 @@ Required properties for MT7623/MT2701:
4747
- reset-names: Must be "pcie-rst0", "pcie-rst1", "pcie-rstN".. based on the
4848
number of root ports.
4949

50-
Required properties for MT2712/MT7622:
50+
Required properties for MT2712/MT7622/MT7629:
5151
-interrupts: A list of interrupt outputs of the controller, must have one
5252
entry for each PCIe port
53+
- interrupt-names: Must include the following entries:
54+
- "pcie_irq": The interrupt that is asserted when an MSI/INTX is received
55+
- linux,pci-domain: PCI domain ID. Should be unique for each host controller
5356

5457
In addition, the device tree node must have sub-nodes describing each
5558
PCIe port interface, having the following mandatory properties:
@@ -143,130 +146,143 @@ Examples for MT7623:
143146

144147
Examples for MT2712:
145148

146-
pcie: pcie@11700000 {
149+
pcie1: pcie@112ff000 {
147150
compatible = "mediatek,mt2712-pcie";
148151
device_type = "pci";
149-
reg = <0 0x11700000 0 0x1000>,
150-
<0 0x112ff000 0 0x1000>;
151-
reg-names = "port0", "port1";
152+
reg = <0 0x112ff000 0 0x1000>;
153+
reg-names = "port1";
154+
linux,pci-domain = <1>;
152155
#address-cells = <3>;
153156
#size-cells = <2>;
154-
interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>,
155-
<GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
156-
clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>,
157-
<&topckgen CLK_TOP_PE2_MAC_P1_SEL>,
158-
<&pericfg CLK_PERI_PCIE0>,
157+
interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
158+
interrupt-names = "pcie_irq";
159+
clocks = <&topckgen CLK_TOP_PE2_MAC_P1_SEL>,
159160
<&pericfg CLK_PERI_PCIE1>;
160-
clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1";
161-
phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>;
162-
phy-names = "pcie-phy0", "pcie-phy1";
161+
clock-names = "sys_ck1", "ahb_ck1";
162+
phys = <&u3port1 PHY_TYPE_PCIE>;
163+
phy-names = "pcie-phy1";
163164
bus-range = <0x00 0xff>;
164-
ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>;
165+
ranges = <0x82000000 0 0x11400000 0x0 0x11400000 0 0x300000>;
166+
status = "disabled";
165167

166-
pcie0: pcie@0,0 {
167-
reg = <0x0000 0 0 0 0>;
168-
#address-cells = <3>;
169-
#size-cells = <2>;
168+
#interrupt-cells = <1>;
169+
interrupt-map-mask = <0 0 0 7>;
170+
interrupt-map = <0 0 0 1 &pcie_intc1 0>,
171+
<0 0 0 2 &pcie_intc1 1>,
172+
<0 0 0 3 &pcie_intc1 2>,
173+
<0 0 0 4 &pcie_intc1 3>;
174+
pcie_intc1: interrupt-controller {
175+
interrupt-controller;
176+
#address-cells = <0>;
170177
#interrupt-cells = <1>;
171-
ranges;
172-
interrupt-map-mask = <0 0 0 7>;
173-
interrupt-map = <0 0 0 1 &pcie_intc0 0>,
174-
<0 0 0 2 &pcie_intc0 1>,
175-
<0 0 0 3 &pcie_intc0 2>,
176-
<0 0 0 4 &pcie_intc0 3>;
177-
pcie_intc0: interrupt-controller {
178-
interrupt-controller;
179-
#address-cells = <0>;
180-
#interrupt-cells = <1>;
181-
};
182178
};
179+
};
183180

184-
pcie1: pcie@1,0 {
185-
reg = <0x0800 0 0 0 0>;
186-
#address-cells = <3>;
187-
#size-cells = <2>;
181+
pcie0: pcie@11700000 {
182+
compatible = "mediatek,mt2712-pcie";
183+
device_type = "pci";
184+
reg = <0 0x11700000 0 0x1000>;
185+
reg-names = "port0";
186+
linux,pci-domain = <0>;
187+
#address-cells = <3>;
188+
#size-cells = <2>;
189+
interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
190+
interrupt-names = "pcie_irq";
191+
clocks = <&topckgen CLK_TOP_PE2_MAC_P0_SEL>,
192+
<&pericfg CLK_PERI_PCIE0>;
193+
clock-names = "sys_ck0", "ahb_ck0";
194+
phys = <&u3port0 PHY_TYPE_PCIE>;
195+
phy-names = "pcie-phy0";
196+
bus-range = <0x00 0xff>;
197+
ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>;
198+
status = "disabled";
199+
200+
#interrupt-cells = <1>;
201+
interrupt-map-mask = <0 0 0 7>;
202+
interrupt-map = <0 0 0 1 &pcie_intc0 0>,
203+
<0 0 0 2 &pcie_intc0 1>,
204+
<0 0 0 3 &pcie_intc0 2>,
205+
<0 0 0 4 &pcie_intc0 3>;
206+
pcie_intc0: interrupt-controller {
207+
interrupt-controller;
208+
#address-cells = <0>;
188209
#interrupt-cells = <1>;
189-
ranges;
190-
interrupt-map-mask = <0 0 0 7>;
191-
interrupt-map = <0 0 0 1 &pcie_intc1 0>,
192-
<0 0 0 2 &pcie_intc1 1>,
193-
<0 0 0 3 &pcie_intc1 2>,
194-
<0 0 0 4 &pcie_intc1 3>;
195-
pcie_intc1: interrupt-controller {
196-
interrupt-controller;
197-
#address-cells = <0>;
198-
#interrupt-cells = <1>;
199-
};
200210
};
201211
};
202212

203213
Examples for MT7622:
204214

205-
pcie: pcie@1a140000 {
215+
pcie0: pcie@1a143000 {
206216
compatible = "mediatek,mt7622-pcie";
207217
device_type = "pci";
208-
reg = <0 0x1a140000 0 0x1000>,
209-
<0 0x1a143000 0 0x1000>,
210-
<0 0x1a145000 0 0x1000>;
211-
reg-names = "subsys", "port0", "port1";
218+
reg = <0 0x1a143000 0 0x1000>;
219+
reg-names = "port0";
220+
linux,pci-domain = <0>;
212221
#address-cells = <3>;
213222
#size-cells = <2>;
214-
interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>,
215-
<GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>;
223+
interrupts = <GIC_SPI 228 IRQ_TYPE_LEVEL_LOW>;
224+
interrupt-names = "pcie_irq";
216225
clocks = <&pciesys CLK_PCIE_P0_MAC_EN>,
217-
<&pciesys CLK_PCIE_P1_MAC_EN>,
218226
<&pciesys CLK_PCIE_P0_AHB_EN>,
219-
<&pciesys CLK_PCIE_P1_AHB_EN>,
220227
<&pciesys CLK_PCIE_P0_AUX_EN>,
221-
<&pciesys CLK_PCIE_P1_AUX_EN>,
222228
<&pciesys CLK_PCIE_P0_AXI_EN>,
223-
<&pciesys CLK_PCIE_P1_AXI_EN>,
224229
<&pciesys CLK_PCIE_P0_OBFF_EN>,
225-
<&pciesys CLK_PCIE_P1_OBFF_EN>,
226-
<&pciesys CLK_PCIE_P0_PIPE_EN>,
227-
<&pciesys CLK_PCIE_P1_PIPE_EN>;
228-
clock-names = "sys_ck0", "sys_ck1", "ahb_ck0", "ahb_ck1",
229-
"aux_ck0", "aux_ck1", "axi_ck0", "axi_ck1",
230-
"obff_ck0", "obff_ck1", "pipe_ck0", "pipe_ck1";
231-
phys = <&pcie0_phy PHY_TYPE_PCIE>, <&pcie1_phy PHY_TYPE_PCIE>;
232-
phy-names = "pcie-phy0", "pcie-phy1";
230+
<&pciesys CLK_PCIE_P0_PIPE_EN>;
231+
clock-names = "sys_ck0", "ahb_ck0", "aux_ck0",
232+
"axi_ck0", "obff_ck0", "pipe_ck0";
233+
233234
power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>;
234235
bus-range = <0x00 0xff>;
235-
ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x10000000>;
236+
ranges = <0x82000000 0 0x20000000 0x0 0x20000000 0 0x8000000>;
237+
status = "disabled";
236238

237-
pcie0: pcie@0,0 {
238-
reg = <0x0000 0 0 0 0>;
239-
#address-cells = <3>;
240-
#size-cells = <2>;
239+
#interrupt-cells = <1>;
240+
interrupt-map-mask = <0 0 0 7>;
241+
interrupt-map = <0 0 0 1 &pcie_intc0 0>,
242+
<0 0 0 2 &pcie_intc0 1>,
243+
<0 0 0 3 &pcie_intc0 2>,
244+
<0 0 0 4 &pcie_intc0 3>;
245+
pcie_intc0: interrupt-controller {
246+
interrupt-controller;
247+
#address-cells = <0>;
241248
#interrupt-cells = <1>;
242-
ranges;
243-
interrupt-map-mask = <0 0 0 7>;
244-
interrupt-map = <0 0 0 1 &pcie_intc0 0>,
245-
<0 0 0 2 &pcie_intc0 1>,
246-
<0 0 0 3 &pcie_intc0 2>,
247-
<0 0 0 4 &pcie_intc0 3>;
248-
pcie_intc0: interrupt-controller {
249-
interrupt-controller;
250-
#address-cells = <0>;
251-
#interrupt-cells = <1>;
252-
};
253249
};
250+
};
254251

255-
pcie1: pcie@1,0 {
256-
reg = <0x0800 0 0 0 0>;
257-
#address-cells = <3>;
258-
#size-cells = <2>;
252+
pcie1: pcie@1a145000 {
253+
compatible = "mediatek,mt7622-pcie";
254+
device_type = "pci";
255+
reg = <0 0x1a145000 0 0x1000>;
256+
reg-names = "port1";
257+
linux,pci-domain = <1>;
258+
#address-cells = <3>;
259+
#size-cells = <2>;
260+
interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_LOW>;
261+
interrupt-names = "pcie_irq";
262+
clocks = <&pciesys CLK_PCIE_P1_MAC_EN>,
263+
/* designer has connect RC1 with p0_ahb clock */
264+
<&pciesys CLK_PCIE_P0_AHB_EN>,
265+
<&pciesys CLK_PCIE_P1_AUX_EN>,
266+
<&pciesys CLK_PCIE_P1_AXI_EN>,
267+
<&pciesys CLK_PCIE_P1_OBFF_EN>,
268+
<&pciesys CLK_PCIE_P1_PIPE_EN>;
269+
clock-names = "sys_ck1", "ahb_ck1", "aux_ck1",
270+
"axi_ck1", "obff_ck1", "pipe_ck1";
271+
272+
power-domains = <&scpsys MT7622_POWER_DOMAIN_HIF0>;
273+
bus-range = <0x00 0xff>;
274+
ranges = <0x82000000 0 0x28000000 0x0 0x28000000 0 0x8000000>;
275+
status = "disabled";
276+
277+
#interrupt-cells = <1>;
278+
interrupt-map-mask = <0 0 0 7>;
279+
interrupt-map = <0 0 0 1 &pcie_intc1 0>,
280+
<0 0 0 2 &pcie_intc1 1>,
281+
<0 0 0 3 &pcie_intc1 2>,
282+
<0 0 0 4 &pcie_intc1 3>;
283+
pcie_intc1: interrupt-controller {
284+
interrupt-controller;
285+
#address-cells = <0>;
259286
#interrupt-cells = <1>;
260-
ranges;
261-
interrupt-map-mask = <0 0 0 7>;
262-
interrupt-map = <0 0 0 1 &pcie_intc1 0>,
263-
<0 0 0 2 &pcie_intc1 1>,
264-
<0 0 0 3 &pcie_intc1 2>,
265-
<0 0 0 4 &pcie_intc1 3>;
266-
pcie_intc1: interrupt-controller {
267-
interrupt-controller;
268-
#address-cells = <0>;
269-
#interrupt-cells = <1>;
270-
};
271287
};
272288
};

0 commit comments

Comments
 (0)