Merge tag 'for-linus-5.7-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / drivers / staging / mt7621-pci / mediatek,mt7621-pci.txt
1 MediaTek MT7621 PCIe controller
2
3 Required properties:
4 - compatible: "mediatek,mt7621-pci"
5 - device_type: Must be "pci"
6 - reg: Base addresses and lengths of the PCIe subsys and root ports.
7 - bus-range: Range of bus numbers associated with this controller.
8 - #address-cells: Address representation for root ports (must be 3)
9 - pinctrl-names : The pin control state names.
10 - pinctrl-0: The "default" pinctrl state.
11 - #size-cells: Size representation for root ports (must be 2)
12 - ranges: Ranges for the PCI memory and I/O regions.
13 - #interrupt-cells: Must be 1
14 - interrupt-map-mask and interrupt-map: Standard PCI IRQ mapping properties.
15   Please refer to the standard PCI bus binding document for a more detailed
16   explanation.
17 - status: either "disabled" or "okay".
18 - resets: Must contain an entry for each entry in reset-names.
19   See ../reset/reset.txt for details.
20 - reset-names: Must be "pcie0", "pcie1", "pcieN"... based on the number of
21   root ports.
22 - clocks: Must contain an entry for each entry in clock-names.
23   See ../clocks/clock-bindings.txt for details.
24 - clock-names: Must be "pcie0", "pcie1", "pcieN"... based on the number of
25   root ports.
26 - reset-gpios: GPIO specs for the reset pins.
27
28 In addition, the device tree node must have sub-nodes describing each PCIe port
29 interface, having the following mandatory properties:
30
31 Required properties:
32 - reg: Only the first four bytes are used to refer to the correct bus number
33       and device number.
34 - #address-cells: Must be 3
35 - #size-cells: Must be 2
36 - ranges: Sub-ranges distributed from the PCIe controller node. An empty
37   property is sufficient.
38 - bus-range: Range of bus numbers associated with this port.
39
40 Example for MT7621:
41
42         pcie: pcie@1e140000 {
43                 compatible = "mediatek,mt7621-pci";
44         reg = <0x1e140000 0x100    /* host-pci bridge registers */
45                0x1e142000 0x100    /* pcie port 0 RC control registers */
46                0x1e143000 0x100    /* pcie port 1 RC control registers */
47                0x1e144000 0x100>;  /* pcie port 2 RC control registers */
48
49                 #address-cells = <3>;
50                 #size-cells = <2>;
51
52                 pinctrl-names = "default";
53                 pinctrl-0 = <&pcie_pins>;
54
55                 device_type = "pci";
56
57                 bus-range = <0 255>;
58                 ranges = <
59                         0x02000000 0 0x00000000 0x60000000 0 0x10000000 /* pci memory */
60                         0x01000000 0 0x00000000 0x1e160000 0 0x00010000 /* io space */
61                 >;
62
63                 #interrupt-cells = <1>;
64                 interrupt-map-mask = <0xF0000 0 0 1>;
65                 interrupt-map = <0x10000 0 0 1 &gic GIC_SHARED 4 IRQ_TYPE_LEVEL_HIGH>,
66                                 <0x20000 0 0 1 &gic GIC_SHARED 24 IRQ_TYPE_LEVEL_HIGH>,
67                                 <0x30000 0 0 1 &gic GIC_SHARED 25 IRQ_TYPE_LEVEL_HIGH>;
68
69                 status = "disabled";
70
71                 resets = <&rstctrl 24 &rstctrl 25 &rstctrl 26>;
72                 reset-names = "pcie0", "pcie1", "pcie2";
73                 clocks = <&clkctrl 24 &clkctrl 25 &clkctrl 26>;
74                 clock-names = "pcie0", "pcie1", "pcie2";
75
76                 reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
77                                 <&gpio 8 GPIO_ACTIVE_LOW>,
78                                 <&gpio 7 GPIO_ACTIVE_LOW>;
79
80                 pcie@0,0 {
81                         reg = <0x0000 0 0 0 0>;
82                         #address-cells = <3>;
83                         #size-cells = <2>;
84                         ranges;
85                         bus-range = <0x00 0xff>;
86                 };
87
88                 pcie@1,0 {
89                         reg = <0x0800 0 0 0 0>;
90                         #address-cells = <3>;
91                         #size-cells = <2>;
92                         ranges;
93                         bus-range = <0x00 0xff>;
94                 };
95
96                 pcie@2,0 {
97                         reg = <0x1000 0 0 0 0>;
98                         #address-cells = <3>;
99                         #size-cells = <2>;
100                         ranges;
101                         bus-range = <0x00 0xff>;
102                 };
103         };
104