Merge tag 'for-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / pci / faraday,ftpci100.txt
1 Faraday Technology FTPCI100 PCI Host Bridge
2
3 This PCI bridge is found inside that Cortina Systems Gemini SoC platform and
4 is a generic IP block from Faraday Technology. It exists in two variants:
5 plain and dual PCI. The plain version embeds a cascading interrupt controller
6 into the host bridge. The dual version routes the interrupts to the host
7 chips interrupt controller.
8
9 The host controller appear on the PCI bus with vendor ID 0x159b (Faraday
10 Technology) and product ID 0x4321.
11
12 Mandatory properties:
13
14 - compatible: ranging from specific to generic, should be one of
15   "cortina,gemini-pci", "faraday,ftpci100"
16   "cortina,gemini-pci-dual", "faraday,ftpci100-dual"
17   "faraday,ftpci100"
18   "faraday,ftpci100-dual"
19 - reg: memory base and size for the host bridge
20 - #address-cells: set to <3>
21 - #size-cells: set to <2>
22 - #interrupt-cells: set to <1>
23 - bus-range: set to <0x00 0xff>
24 - device_type, set to "pci"
25 - ranges: see pci.txt
26 - interrupt-map-mask: see pci.txt
27 - interrupt-map: see pci.txt
28 - dma-ranges: three ranges for the inbound memory region. The ranges must
29   be aligned to a 1MB boundary, and may be 1MB, 2MB, 4MB, 8MB, 16MB, 32MB, 64MB,
30   128MB, 256MB, 512MB, 1GB or 2GB in size. The memory should be marked as
31   pre-fetchable.
32
33 Optional properties:
34 - clocks: when present, this should contain the peripheral clock (PCLK) and the
35   PCI clock (PCICLK). If these are not present, they are assumed to be
36   hard-wired enabled and always on. The PCI clock will be 33 or 66 MHz.
37 - clock-names: when present, this should contain "PCLK" for the peripheral
38   clock and "PCICLK" for the PCI-side clock.
39
40 Mandatory subnodes:
41 - For "faraday,ftpci100" a node representing the interrupt-controller inside the
42   host bridge is mandatory. It has the following mandatory properties:
43   - interrupt: see interrupt-controller/interrupts.txt
44   - interrupt-parent: see interrupt-controller/interrupts.txt
45   - interrupt-controller: see interrupt-controller/interrupts.txt
46   - #address-cells: set to <0>
47   - #interrupt-cells: set to <1>
48
49 I/O space considerations:
50
51 The plain variant has 128MiB of non-prefetchable memory space, whereas the
52 "dual" variant has 64MiB. Take this into account when describing the ranges.
53
54 Interrupt map considerations:
55
56 The "dual" variant will get INT A, B, C, D from the system interrupt controller
57 and should point to respective interrupt in that controller in its
58 interrupt-map.
59
60 The code which is the only documentation of how the Faraday PCI (the non-dual
61 variant) interrupts assigns the default interrupt mapping/swizzling has
62 typically been like this, doing the swizzling on the interrupt controller side
63 rather than in the interconnect:
64
65 interrupt-map-mask = <0xf800 0 0 7>;
66 interrupt-map =
67         <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */
68         <0x4800 0 0 2 &pci_intc 1>,
69         <0x4800 0 0 3 &pci_intc 2>,
70         <0x4800 0 0 4 &pci_intc 3>,
71         <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */
72         <0x5000 0 0 2 &pci_intc 2>,
73         <0x5000 0 0 3 &pci_intc 3>,
74         <0x5000 0 0 4 &pci_intc 0>,
75         <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */
76         <0x5800 0 0 2 &pci_intc 3>,
77         <0x5800 0 0 3 &pci_intc 0>,
78         <0x5800 0 0 4 &pci_intc 1>,
79         <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */
80         <0x6000 0 0 2 &pci_intc 0>,
81         <0x6000 0 0 3 &pci_intc 1>,
82         <0x6000 0 0 4 &pci_intc 2>;
83
84 Example:
85
86 pci@50000000 {
87         compatible = "cortina,gemini-pci", "faraday,ftpci100";
88         reg = <0x50000000 0x100>;
89         interrupts = <8 IRQ_TYPE_LEVEL_HIGH>, /* PCI A */
90                         <26 IRQ_TYPE_LEVEL_HIGH>, /* PCI B */
91                         <27 IRQ_TYPE_LEVEL_HIGH>, /* PCI C */
92                         <28 IRQ_TYPE_LEVEL_HIGH>; /* PCI D */
93         #address-cells = <3>;
94         #size-cells = <2>;
95         #interrupt-cells = <1>;
96
97         bus-range = <0x00 0xff>;
98         ranges = /* 1MiB I/O space 0x50000000-0x500fffff */
99                  <0x01000000 0 0          0x50000000 0 0x00100000>,
100                  /* 128MiB non-prefetchable memory 0x58000000-0x5fffffff */
101                  <0x02000000 0 0x58000000 0x58000000 0 0x08000000>;
102
103         /* DMA ranges */
104         dma-ranges =
105         /* 128MiB at 0x00000000-0x07ffffff */
106         <0x02000000 0 0x00000000 0x00000000 0 0x08000000>,
107         /* 64MiB at 0x00000000-0x03ffffff */
108         <0x02000000 0 0x00000000 0x00000000 0 0x04000000>,
109         /* 64MiB at 0x00000000-0x03ffffff */
110         <0x02000000 0 0x00000000 0x00000000 0 0x04000000>;
111
112         interrupt-map-mask = <0xf800 0 0 7>;
113         interrupt-map =
114                 <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */
115                 <0x4800 0 0 2 &pci_intc 1>,
116                 <0x4800 0 0 3 &pci_intc 2>,
117                 <0x4800 0 0 4 &pci_intc 3>,
118                 <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */
119                 <0x5000 0 0 2 &pci_intc 2>,
120                 <0x5000 0 0 3 &pci_intc 3>,
121                 <0x5000 0 0 4 &pci_intc 0>,
122                 <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */
123                 <0x5800 0 0 2 &pci_intc 3>,
124                 <0x5800 0 0 3 &pci_intc 0>,
125                 <0x5800 0 0 4 &pci_intc 1>,
126                 <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */
127                 <0x6000 0 0 2 &pci_intc 0>,
128                 <0x6000 0 0 3 &pci_intc 0>,
129                 <0x6000 0 0 4 &pci_intc 0>;
130         pci_intc: interrupt-controller {
131                 interrupt-parent = <&intcon>;
132                 interrupt-controller;
133                 #address-cells = <0>;
134                 #interrupt-cells = <1>;
135         };
136 };