Merge tag 'nfsd-4.12' of git://linux-nfs.org/~bfields/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 Mandatory subnodes:
34 - For "faraday,ftpci100" a node representing the interrupt-controller inside the
35   host bridge is mandatory. It has the following mandatory properties:
36   - interrupt: see interrupt-controller/interrupts.txt
37   - interrupt-parent: see interrupt-controller/interrupts.txt
38   - interrupt-controller: see interrupt-controller/interrupts.txt
39   - #address-cells: set to <0>
40   - #interrupt-cells: set to <1>
41
42 I/O space considerations:
43
44 The plain variant has 128MiB of non-prefetchable memory space, whereas the
45 "dual" variant has 64MiB. Take this into account when describing the ranges.
46
47 Interrupt map considerations:
48
49 The "dual" variant will get INT A, B, C, D from the system interrupt controller
50 and should point to respective interrupt in that controller in its
51 interrupt-map.
52
53 The code which is the only documentation of how the Faraday PCI (the non-dual
54 variant) interrupts assigns the default interrupt mapping/swizzling has
55 typically been like this, doing the swizzling on the interrupt controller side
56 rather than in the interconnect:
57
58 interrupt-map-mask = <0xf800 0 0 7>;
59 interrupt-map =
60         <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */
61         <0x4800 0 0 2 &pci_intc 1>,
62         <0x4800 0 0 3 &pci_intc 2>,
63         <0x4800 0 0 4 &pci_intc 3>,
64         <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */
65         <0x5000 0 0 2 &pci_intc 2>,
66         <0x5000 0 0 3 &pci_intc 3>,
67         <0x5000 0 0 4 &pci_intc 0>,
68         <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */
69         <0x5800 0 0 2 &pci_intc 3>,
70         <0x5800 0 0 3 &pci_intc 0>,
71         <0x5800 0 0 4 &pci_intc 1>,
72         <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */
73         <0x6000 0 0 2 &pci_intc 0>,
74         <0x6000 0 0 3 &pci_intc 1>,
75         <0x6000 0 0 4 &pci_intc 2>;
76
77 Example:
78
79 pci@50000000 {
80         compatible = "cortina,gemini-pci", "faraday,ftpci100";
81         reg = <0x50000000 0x100>;
82         interrupts = <8 IRQ_TYPE_LEVEL_HIGH>, /* PCI A */
83                         <26 IRQ_TYPE_LEVEL_HIGH>, /* PCI B */
84                         <27 IRQ_TYPE_LEVEL_HIGH>, /* PCI C */
85                         <28 IRQ_TYPE_LEVEL_HIGH>; /* PCI D */
86         #address-cells = <3>;
87         #size-cells = <2>;
88         #interrupt-cells = <1>;
89
90         bus-range = <0x00 0xff>;
91         ranges = /* 1MiB I/O space 0x50000000-0x500fffff */
92                  <0x01000000 0 0          0x50000000 0 0x00100000>,
93                  /* 128MiB non-prefetchable memory 0x58000000-0x5fffffff */
94                  <0x02000000 0 0x58000000 0x58000000 0 0x08000000>;
95
96         /* DMA ranges */
97         dma-ranges =
98         /* 128MiB at 0x00000000-0x07ffffff */
99         <0x02000000 0 0x00000000 0x00000000 0 0x08000000>,
100         /* 64MiB at 0x00000000-0x03ffffff */
101         <0x02000000 0 0x00000000 0x00000000 0 0x04000000>,
102         /* 64MiB at 0x00000000-0x03ffffff */
103         <0x02000000 0 0x00000000 0x00000000 0 0x04000000>;
104
105         interrupt-map-mask = <0xf800 0 0 7>;
106         interrupt-map =
107                 <0x4800 0 0 1 &pci_intc 0>, /* Slot 9 */
108                 <0x4800 0 0 2 &pci_intc 1>,
109                 <0x4800 0 0 3 &pci_intc 2>,
110                 <0x4800 0 0 4 &pci_intc 3>,
111                 <0x5000 0 0 1 &pci_intc 1>, /* Slot 10 */
112                 <0x5000 0 0 2 &pci_intc 2>,
113                 <0x5000 0 0 3 &pci_intc 3>,
114                 <0x5000 0 0 4 &pci_intc 0>,
115                 <0x5800 0 0 1 &pci_intc 2>, /* Slot 11 */
116                 <0x5800 0 0 2 &pci_intc 3>,
117                 <0x5800 0 0 3 &pci_intc 0>,
118                 <0x5800 0 0 4 &pci_intc 1>,
119                 <0x6000 0 0 1 &pci_intc 3>, /* Slot 12 */
120                 <0x6000 0 0 2 &pci_intc 0>,
121                 <0x6000 0 0 3 &pci_intc 0>,
122                 <0x6000 0 0 4 &pci_intc 0>;
123         pci_intc: interrupt-controller {
124                 interrupt-parent = <&intcon>;
125                 interrupt-controller;
126                 #address-cells = <0>;
127                 #interrupt-cells = <1>;
128         };
129 };