aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2013-08-16 02:10:31 -0400
committerOlof Johansson <olof@lixom.net>2013-08-16 02:10:31 -0400
commitf668adebf43556df9834f254479a44a20294dcf1 (patch)
tree1db70c6f513da3c4c2fdc0341ef0d8ffdffa07f5
parentfac2e57742d9aa3dbe41860280352efda9d5566e (diff)
parenta0cec7867ffdf5d153d29b3a8243911ea8dfd366 (diff)
Merge tag 'drivers-3.12' of git://git.infradead.org/linux-mvebu into next/soc
From Jason Cooper: mvebu drivers changes for v3.12 - MBus devicetree bindings - devbus update for address decoding window, cleanup * tag 'drivers-3.12' of git://git.infradead.org/linux-mvebu: (35 commits) memory: mvebu-devbus: Remove unused variable ARM: mvebu: Relocate PCIe node in Armada 370 RD board ARM: mvebu: Fix AXP-WiFi-AP DT for MBUS DT binding ARM: mvebu: add support for the AXP WiFi AP board ARM: mvebu: use dts pre-processor for mv78230 PCI: mvebu: Adapt to the new device tree layout bus: mvebu-mbus: Add devicetree binding ARM: kirkwood: Relocate PCIe device tree nodes ARM: kirkwood: Introduce MBUS_ID ARM: kirkwood: Introduce MBus DT node ARM: kirkwood: Use the preprocessor on device tree files ARM: kirkwood: Split DT and legacy MBus initialization ARM: mvebu: Relocate Armada 370/XP PCIe device tree nodes ARM: mvebu: Relocate Armada 370/XP DeviceBus device tree nodes ARM: mvebu: Add BootROM to Armada 370/XP device tree ARM: mvebu: Add MBus to Armada 370/XP device tree ARM: mvebu: Use the preprocessor on Armada 370/XP device tree files ARM: mvebu: Initialize MBus using the DT binding ARM: mvebu: Remove the harcoded BootROM window allocation bus: mvebu-mbus: Factorize Armada 370/XP data structures ... Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--Documentation/devicetree/bindings/bus/mvebu-mbus.txt276
-rw-r--r--Documentation/devicetree/bindings/pci/mvebu-pci.txt145
-rw-r--r--arch/arm/boot/dts/Makefile1
-rw-r--r--arch/arm/boot/dts/armada-370-db.dts5
-rw-r--r--arch/arm/boot/dts/armada-370-mirabox.dts37
-rw-r--r--arch/arm/boot/dts/armada-370-rd.dts37
-rw-r--r--arch/arm/boot/dts/armada-370-xp.dtsi111
-rw-r--r--arch/arm/boot/dts/armada-370.dtsi112
-rw-r--r--arch/arm/boot/dts/armada-xp-axpwifiap.dts164
-rw-r--r--arch/arm/boot/dts/armada-xp-db.dts131
-rw-r--r--arch/arm/boot/dts/armada-xp-gp.dts107
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78230.dtsi224
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78260.dtsi263
-rw-r--r--arch/arm/boot/dts/armada-xp-mv78460.dtsi411
-rw-r--r--arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts88
-rw-r--r--arch/arm/boot/dts/armada-xp.dtsi9
-rw-r--r--arch/arm/boot/dts/kirkwood-6281.dtsi66
-rw-r--r--arch/arm/boot/dts/kirkwood-6282.dtsi102
-rw-r--r--arch/arm/boot/dts/kirkwood-cloudbox.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-db-88f6281.dts7
-rw-r--r--arch/arm/boot/dts/kirkwood-db-88f6282.dts7
-rw-r--r--arch/arm/boot/dts/kirkwood-db.dtsi10
-rw-r--r--arch/arm/boot/dts/kirkwood-dns320.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-dns325.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-dnskw.dtsi4
-rw-r--r--arch/arm/boot/dts/kirkwood-dockstar.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-dreamplug.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-goflexnet.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-ib62x0.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-iconnect.dts23
-rw-r--r--arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-is2.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-km_kirkwood.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-lschlv2.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-lsxhl.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-lsxl.dtsi4
-rw-r--r--arch/arm/boot/dts/kirkwood-mplcec4.dts23
-rw-r--r--arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts23
-rw-r--r--arch/arm/boot/dts/kirkwood-ns2-common.dtsi4
-rw-r--r--arch/arm/boot/dts/kirkwood-ns2.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-ns2lite.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-ns2max.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-ns2mini.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-nsa310.dts23
-rw-r--r--arch/arm/boot/dts/kirkwood-openblocks_a6.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi4
-rw-r--r--arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-sheevaplug.dts2
-rw-r--r--arch/arm/boot/dts/kirkwood-topkick.dts4
-rw-r--r--arch/arm/boot/dts/kirkwood-ts219-6281.dts6
-rw-r--r--arch/arm/boot/dts/kirkwood-ts219-6282.dts25
-rw-r--r--arch/arm/boot/dts/kirkwood-ts219.dtsi17
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi17
-rw-r--r--arch/arm/mach-dove/common.c68
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c1
-rw-r--r--arch/arm/mach-kirkwood/common.c26
-rw-r--r--arch/arm/mach-kirkwood/pcie.c40
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c23
-rw-r--r--arch/arm/mach-mvebu/armada-370-xp.c34
-rw-r--r--arch/arm/mach-mvebu/platsmp.c25
-rw-r--r--arch/arm/mach-orion5x/common.c36
-rw-r--r--arch/arm/mach-orion5x/common.h17
-rw-r--r--arch/arm/mach-orion5x/d2net-setup.c6
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c24
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c6
-rw-r--r--arch/arm/mach-orion5x/edmini_v2-setup.c6
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c12
-rw-r--r--arch/arm/mach-orion5x/ls-chl-setup.c6
-rw-r--r--arch/arm/mach-orion5x/ls_hgl-setup.c6
-rw-r--r--arch/arm/mach-orion5x/lsmini-setup.c6
-rw-r--r--arch/arm/mach-orion5x/mss2-setup.c6
-rw-r--r--arch/arm/mach-orion5x/mv2120-setup.c6
-rw-r--r--arch/arm/mach-orion5x/net2big-setup.c6
-rw-r--r--arch/arm/mach-orion5x/pci.c9
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c6
-rw-r--r--arch/arm/mach-orion5x/rd88f5181l-ge-setup.c6
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c13
-rw-r--r--arch/arm/mach-orion5x/terastation_pro2-setup.c6
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c6
-rw-r--r--arch/arm/mach-orion5x/ts409-setup.c6
-rw-r--r--arch/arm/mach-orion5x/wnr854t-setup.c6
-rw-r--r--arch/arm/mach-orion5x/wrt350n-v2-setup.c6
-rw-r--r--drivers/bus/mvebu-mbus.c441
-rw-r--r--drivers/memory/mvebu-devbus.c72
-rw-r--r--drivers/pci/host/pci-mvebu.c115
-rw-r--r--include/linux/mbus.h16
87 files changed, 2212 insertions, 1404 deletions
diff --git a/Documentation/devicetree/bindings/bus/mvebu-mbus.txt b/Documentation/devicetree/bindings/bus/mvebu-mbus.txt
new file mode 100644
index 000000000000..7586fb68c072
--- /dev/null
+++ b/Documentation/devicetree/bindings/bus/mvebu-mbus.txt
@@ -0,0 +1,276 @@
1
2* Marvell MBus
3
4Required properties:
5
6- compatible: Should be set to one of the following:
7 marvell,armada370-mbus
8 marvell,armadaxp-mbus
9 marvell,armada370-mbus
10 marvell,armadaxp-mbus
11 marvell,kirkwood-mbus
12 marvell,dove-mbus
13 marvell,orion5x-88f5281-mbus
14 marvell,orion5x-88f5182-mbus
15 marvell,orion5x-88f5181-mbus
16 marvell,orion5x-88f6183-mbus
17 marvell,mv78xx0-mbus
18
19- address-cells: Must be '2'. The first cell for the MBus ID encoding,
20 the second cell for the address offset within the window.
21
22- size-cells: Must be '1'.
23
24- ranges: Must be set up to provide a proper translation for each child.
25 See the examples below.
26
27- controller: Contains a single phandle referring to the MBus controller
28 node. This allows to specify the node that contains the
29 registers that control the MBus, which is typically contained
30 within the internal register window (see below).
31
32Optional properties:
33
34- pcie-mem-aperture: This optional property contains the aperture for
35 the memory region of the PCIe driver.
36 If it's defined, it must encode the base address and
37 size for the address decoding windows allocated for
38 the PCIe memory region.
39
40- pcie-io-aperture: Just as explained for the above property, this
41 optional property contains the aperture for the
42 I/O region of the PCIe driver.
43
44* Marvell MBus controller
45
46Required properties:
47
48- compatible: Should be set to "marvell,mbus-controller".
49
50- reg: Device's register space.
51 Two entries are expected (see the examples below):
52 the first one controls the devices decoding window and
53 the second one controls the SDRAM decoding window.
54
55Example:
56
57 soc {
58 compatible = "marvell,armada370-mbus", "simple-bus";
59 #address-cells = <2>;
60 #size-cells = <1>;
61 controller = <&mbusc>;
62 pcie-mem-aperture = <0xe0000000 0x8000000>;
63 pcie-io-aperture = <0xe8000000 0x100000>;
64
65 internal-regs {
66 compatible = "simple-bus";
67
68 mbusc: mbus-controller@20000 {
69 compatible = "marvell,mbus-controller";
70 reg = <0x20000 0x100>, <0x20180 0x20>;
71 };
72
73 /* more children ...*/
74 };
75 };
76
77** MBus address decoding window specification
78
79The MBus children address space is comprised of two cells: the first one for
80the window ID and the second one for the offset within the window.
81In order to allow to describe valid and non-valid window entries, the
82following encoding is used:
83
84 0xSIAA0000 0x00oooooo
85
86Where:
87
88 S = 0x0 for a MBus valid window
89 S = 0xf for a non-valid window (see below)
90
91If S = 0x0, then:
92
93 I = 4-bit window target ID
94 AA = windpw attribute
95
96If S = 0xf, then:
97
98 I = don't care
99 AA = 1 for internal register
100
101Following the above encoding, for each ranges entry for a MBus valid window
102(S = 0x0), an address decoding window is allocated. On the other side,
103entries for translation that do not correspond to valid windows (S = 0xf)
104are skipped.
105
106 soc {
107 compatible = "marvell,armada370-mbus", "simple-bus";
108 #address-cells = <2>;
109 #size-cells = <1>;
110 controller = <&mbusc>;
111
112 ranges = <0xf0010000 0 0 0xd0000000 0x100000
113 0x01e00000 0 0 0xfff00000 0x100000>;
114
115 bootrom {
116 compatible = "marvell,bootrom";
117 reg = <0x01e00000 0 0x100000>;
118 };
119
120 /* other children */
121 ...
122
123 internal-regs {
124 compatible = "simple-bus";
125 ranges = <0 0xf0010000 0 0x100000>;
126
127 mbusc: mbus-controller@20000 {
128 compatible = "marvell,mbus-controller";
129 reg = <0x20000 0x100>, <0x20180 0x20>;
130 };
131
132 /* more children ...*/
133 };
134 };
135
136In the shown example, the translation entry in the 'ranges' property is what
137makes the MBus driver create a static decoding window for the corresponding
138given child device. Note that the binding does not require child nodes to be
139present. Of course, child nodes are needed to probe the devices.
140
141Since each window is identified by its target ID and attribute ID there's
142a special macro that can be use to simplify the translation entries:
143
144#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
145
146Using this macro, the above example would be:
147
148 soc {
149 compatible = "marvell,armada370-mbus", "simple-bus";
150 #address-cells = <2>;
151 #size-cells = <1>;
152 controller = <&mbusc>;
153
154 ranges = < MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
155 MBUS_ID(0x01, 0xe0) 0 0 0xfff00000 0x100000>;
156
157 bootrom {
158 compatible = "marvell,bootrom";
159 reg = <MBUS_ID(0x01, 0xe0) 0 0x100000>;
160 };
161
162 /* other children */
163 ...
164
165 internal-regs {
166 compatible = "simple-bus";
167 #address-cells = <1>;
168 #size-cells = <1>;
169 ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
170
171 mbusc: mbus-controller@20000 {
172 compatible = "marvell,mbus-controller";
173 reg = <0x20000 0x100>, <0x20180 0x20>;
174 };
175
176 /* other children */
177 ...
178 };
179 };
180
181
182** About the window base address
183
184Remember the MBus controller allows a great deal of flexibility for choosing
185the decoding window base address. When planning the device tree layout it's
186possible to choose any address as the base address, provided of course there's
187a region large enough available, and with the required alignment.
188
189Yet in other words: there's nothing preventing us from setting a base address
190of 0xf0000000, or 0xd0000000 for the NOR device shown above, if such region is
191unused.
192
193** Window allocation policy
194
195The mbus-node ranges property defines a set of mbus windows that are expected
196to be set by the operating system and that are guaranteed to be free of overlaps
197with one another or with the system memory ranges.
198
199Each entry in the property refers to exactly one window. If the operating system
200choses to use a different set of mbus windows, it must ensure that any address
201translations performed from downstream devices are adapted accordingly.
202
203The operating system may insert additional mbus windows that do not conflict
204with the ones listed in the ranges, e.g. for mapping PCIe devices.
205As a special case, the internal register window must be set up by the boot
206loader at the address listed in the ranges property, since access to that region
207is needed to set up the other windows.
208
209** Example
210
211See the example below, where a more complete device tree is shown:
212
213 soc {
214 compatible = "marvell,armadaxp-mbus", "simple-bus";
215 controller = <&mbusc>;
216
217 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000 /* internal-regs */
218 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
219 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000>;
220
221 bootrom {
222 compatible = "marvell,bootrom";
223 reg = <MBUS_ID(0x01, 0x1d) 0 0x100000>;
224 };
225
226 devbus-bootcs {
227 status = "okay";
228 ranges = <0 MBUS_ID(0x01, 0x2f) 0 0x8000000>;
229
230 /* NOR */
231 nor {
232 compatible = "cfi-flash";
233 reg = <0 0x8000000>;
234 bank-width = <2>;
235 };
236 };
237
238 pcie-controller {
239 compatible = "marvell,armada-xp-pcie";
240 status = "okay";
241 device_type = "pci";
242
243 #address-cells = <3>;
244 #size-cells = <2>;
245
246 ranges =
247 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
248 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */
249 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */
250 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
251 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
252 0x82000800 0 0xe0000000 MBUS_ID(0x04, 0xe8) 0xe0000000 0 0x08000000 /* Port 0.0 MEM */
253 0x81000800 0 0 MBUS_ID(0x04, 0xe0) 0xe8000000 0 0x00100000 /* Port 0.0 IO */>;
254
255
256 pcie@1,0 {
257 /* Port 0, Lane 0 */
258 status = "okay";
259 };
260 };
261
262 internal-regs {
263 compatible = "simple-bus";
264 #address-cells = <1>;
265 #size-cells = <1>;
266 ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
267
268 mbusc: mbus-controller@20000 {
269 reg = <0x20000 0x100>, <0x20180 0x20>;
270 };
271
272 interrupt-controller@20000 {
273 reg = <0x20a00 0x2d0>, <0x21070 0x58>;
274 };
275 };
276 };
diff --git a/Documentation/devicetree/bindings/pci/mvebu-pci.txt b/Documentation/devicetree/bindings/pci/mvebu-pci.txt
index f8d405897a94..9556e2fedf6d 100644
--- a/Documentation/devicetree/bindings/pci/mvebu-pci.txt
+++ b/Documentation/devicetree/bindings/pci/mvebu-pci.txt
@@ -1,6 +1,7 @@
1* Marvell EBU PCIe interfaces 1* Marvell EBU PCIe interfaces
2 2
3Mandatory properties: 3Mandatory properties:
4
4- compatible: one of the following values: 5- compatible: one of the following values:
5 marvell,armada-370-pcie 6 marvell,armada-370-pcie
6 marvell,armada-xp-pcie 7 marvell,armada-xp-pcie
@@ -10,11 +11,49 @@ Mandatory properties:
10- #interrupt-cells, set to <1> 11- #interrupt-cells, set to <1>
11- bus-range: PCI bus numbers covered 12- bus-range: PCI bus numbers covered
12- device_type, set to "pci" 13- device_type, set to "pci"
13- ranges: ranges for the PCI memory and I/O regions, as well as the 14- ranges: ranges describing the MMIO registers to control the PCIe
14 MMIO registers to control the PCIe interfaces. 15 interfaces, and ranges describing the MBus windows needed to access
16 the memory and I/O regions of each PCIe interface.
17
18The ranges describing the MMIO registers have the following layout:
19
20 0x82000000 0 r MBUS_ID(0xf0, 0x01) r 0 s
21
22where:
23
24 * r is a 32-bits value that gives the offset of the MMIO
25 registers of this PCIe interface, from the base of the internal
26 registers.
27
28 * s is a 32-bits value that give the size of this MMIO
29 registers area. This range entry translates the '0x82000000 0 r' PCI
30 address into the 'MBUS_ID(0xf0, 0x01) r' CPU address, which is part
31 of the internal register window (as identified by MBUS_ID(0xf0,
32 0x01)).
33
34The ranges describing the MBus windows have the following layout:
35
36 0x8t000000 s 0 MBUS_ID(w, a) 0 1 0
37
38where:
39
40 * t is the type of the MBus window (as defined by the standard PCI DT
41 bindings), 1 for I/O and 2 for memory.
15 42
16In addition, the Device Tree node must have sub-nodes describing each 43 * s is the PCI slot that corresponds to this PCIe interface
44
45 * w is the 'target ID' value for the MBus window
46
47 * a the 'attribute' value for the MBus window.
48
49Since the location and size of the different MBus windows is not fixed in
50hardware, and only determined in runtime, those ranges cover the full first
514 GB of the physical address space, and do not translate into a valid CPU
52address.
53
54In addition, the device tree node must have sub-nodes describing each
17PCIe interface, having the following mandatory properties: 55PCIe interface, having the following mandatory properties:
56
18- reg: used only for interrupt mapping, so only the first four bytes 57- reg: used only for interrupt mapping, so only the first four bytes
19 are used to refer to the correct bus number and device number. 58 are used to refer to the correct bus number and device number.
20- assigned-addresses: reference to the MMIO registers used to control 59- assigned-addresses: reference to the MMIO registers used to control
@@ -26,7 +65,8 @@ PCIe interface, having the following mandatory properties:
26- #address-cells, set to <3> 65- #address-cells, set to <3>
27- #size-cells, set to <2> 66- #size-cells, set to <2>
28- #interrupt-cells, set to <1> 67- #interrupt-cells, set to <1>
29- ranges, empty property. 68- ranges, translating the MBus windows ranges of the parent node into
69 standard PCI addresses.
30- interrupt-map-mask and interrupt-map, standard PCI properties to 70- interrupt-map-mask and interrupt-map, standard PCI properties to
31 define the mapping of the PCIe interface to interrupt numbers. 71 define the mapping of the PCIe interface to interrupt numbers.
32 72
@@ -47,27 +87,50 @@ pcie-controller {
47 87
48 bus-range = <0x00 0xff>; 88 bus-range = <0x00 0xff>;
49 89
50 ranges = <0x82000000 0 0xd0040000 0xd0040000 0 0x00002000 /* Port 0.0 registers */ 90 ranges =
51 0x82000000 0 0xd0042000 0xd0042000 0 0x00002000 /* Port 2.0 registers */ 91 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
52 0x82000000 0 0xd0044000 0xd0044000 0 0x00002000 /* Port 0.1 registers */ 92 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */
53 0x82000000 0 0xd0048000 0xd0048000 0 0x00002000 /* Port 0.2 registers */ 93 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */
54 0x82000000 0 0xd004c000 0xd004c000 0 0x00002000 /* Port 0.3 registers */ 94 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
55 0x82000000 0 0xd0080000 0xd0080000 0 0x00002000 /* Port 1.0 registers */ 95 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
56 0x82000000 0 0xd0082000 0xd0082000 0 0x00002000 /* Port 3.0 registers */ 96 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */
57 0x82000000 0 0xd0084000 0xd0084000 0 0x00002000 /* Port 1.1 registers */ 97 0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000 /* Port 3.0 registers */
58 0x82000000 0 0xd0088000 0xd0088000 0 0x00002000 /* Port 1.2 registers */ 98 0x82000000 0 0x84000 MBUS_ID(0xf0, 0x01) 0x84000 0 0x00002000 /* Port 1.1 registers */
59 0x82000000 0 0xd008c000 0xd008c000 0 0x00002000 /* Port 1.3 registers */ 99 0x82000000 0 0x88000 MBUS_ID(0xf0, 0x01) 0x88000 0 0x00002000 /* Port 1.2 registers */
60 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */ 100 0x82000000 0 0x8c000 MBUS_ID(0xf0, 0x01) 0x8c000 0 0x00002000 /* Port 1.3 registers */
61 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */ 101 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
102 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
103 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
104 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO */
105 0x82000000 0x3 0 MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
106 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */
107 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
108 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */
109
110 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
111 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */
112 0x82000000 0x6 0 MBUS_ID(0x08, 0xd8) 0 1 0 /* Port 1.1 MEM */
113 0x81000000 0x6 0 MBUS_ID(0x08, 0xd0) 0 1 0 /* Port 1.1 IO */
114 0x82000000 0x7 0 MBUS_ID(0x08, 0xb8) 0 1 0 /* Port 1.2 MEM */
115 0x81000000 0x7 0 MBUS_ID(0x08, 0xb0) 0 1 0 /* Port 1.2 IO */
116 0x82000000 0x8 0 MBUS_ID(0x08, 0x78) 0 1 0 /* Port 1.3 MEM */
117 0x81000000 0x8 0 MBUS_ID(0x08, 0x70) 0 1 0 /* Port 1.3 IO */
118
119 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
120 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */
121
122 0x82000000 0xa 0 MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */
123 0x81000000 0xa 0 MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO */>;
62 124
63 pcie@1,0 { 125 pcie@1,0 {
64 device_type = "pci"; 126 device_type = "pci";
65 assigned-addresses = <0x82000800 0 0xd0040000 0 0x2000>; 127 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
66 reg = <0x0800 0 0 0 0>; 128 reg = <0x0800 0 0 0 0>;
67 #address-cells = <3>; 129 #address-cells = <3>;
68 #size-cells = <2>; 130 #size-cells = <2>;
69 #interrupt-cells = <1>; 131 #interrupt-cells = <1>;
70 ranges; 132 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
133 0x81000000 0 0 0x81000000 0x1 0 1 0>;
71 interrupt-map-mask = <0 0 0 0>; 134 interrupt-map-mask = <0 0 0 0>;
72 interrupt-map = <0 0 0 0 &mpic 58>; 135 interrupt-map = <0 0 0 0 &mpic 58>;
73 marvell,pcie-port = <0>; 136 marvell,pcie-port = <0>;
@@ -78,12 +141,13 @@ pcie-controller {
78 141
79 pcie@2,0 { 142 pcie@2,0 {
80 device_type = "pci"; 143 device_type = "pci";
81 assigned-addresses = <0x82001000 0 0xd0044000 0 0x2000>; 144 assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
82 reg = <0x1000 0 0 0 0>; 145 reg = <0x1000 0 0 0 0>;
83 #address-cells = <3>; 146 #address-cells = <3>;
84 #size-cells = <2>; 147 #size-cells = <2>;
85 #interrupt-cells = <1>; 148 #interrupt-cells = <1>;
86 ranges; 149 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
150 0x81000000 0 0 0x81000000 0x2 0 1 0>;
87 interrupt-map-mask = <0 0 0 0>; 151 interrupt-map-mask = <0 0 0 0>;
88 interrupt-map = <0 0 0 0 &mpic 59>; 152 interrupt-map = <0 0 0 0 &mpic 59>;
89 marvell,pcie-port = <0>; 153 marvell,pcie-port = <0>;
@@ -94,12 +158,13 @@ pcie-controller {
94 158
95 pcie@3,0 { 159 pcie@3,0 {
96 device_type = "pci"; 160 device_type = "pci";
97 assigned-addresses = <0x82001800 0 0xd0048000 0 0x2000>; 161 assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
98 reg = <0x1800 0 0 0 0>; 162 reg = <0x1800 0 0 0 0>;
99 #address-cells = <3>; 163 #address-cells = <3>;
100 #size-cells = <2>; 164 #size-cells = <2>;
101 #interrupt-cells = <1>; 165 #interrupt-cells = <1>;
102 ranges; 166 ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
167 0x81000000 0 0 0x81000000 0x3 0 1 0>;
103 interrupt-map-mask = <0 0 0 0>; 168 interrupt-map-mask = <0 0 0 0>;
104 interrupt-map = <0 0 0 0 &mpic 60>; 169 interrupt-map = <0 0 0 0 &mpic 60>;
105 marvell,pcie-port = <0>; 170 marvell,pcie-port = <0>;
@@ -110,12 +175,13 @@ pcie-controller {
110 175
111 pcie@4,0 { 176 pcie@4,0 {
112 device_type = "pci"; 177 device_type = "pci";
113 assigned-addresses = <0x82002000 0 0xd004c000 0 0x2000>; 178 assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
114 reg = <0x2000 0 0 0 0>; 179 reg = <0x2000 0 0 0 0>;
115 #address-cells = <3>; 180 #address-cells = <3>;
116 #size-cells = <2>; 181 #size-cells = <2>;
117 #interrupt-cells = <1>; 182 #interrupt-cells = <1>;
118 ranges; 183 ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
184 0x81000000 0 0 0x81000000 0x4 0 1 0>;
119 interrupt-map-mask = <0 0 0 0>; 185 interrupt-map-mask = <0 0 0 0>;
120 interrupt-map = <0 0 0 0 &mpic 61>; 186 interrupt-map = <0 0 0 0 &mpic 61>;
121 marvell,pcie-port = <0>; 187 marvell,pcie-port = <0>;
@@ -126,12 +192,13 @@ pcie-controller {
126 192
127 pcie@5,0 { 193 pcie@5,0 {
128 device_type = "pci"; 194 device_type = "pci";
129 assigned-addresses = <0x82002800 0 0xd0080000 0 0x2000>; 195 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
130 reg = <0x2800 0 0 0 0>; 196 reg = <0x2800 0 0 0 0>;
131 #address-cells = <3>; 197 #address-cells = <3>;
132 #size-cells = <2>; 198 #size-cells = <2>;
133 #interrupt-cells = <1>; 199 #interrupt-cells = <1>;
134 ranges; 200 ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0
201 0x81000000 0 0 0x81000000 0x5 0 1 0>;
135 interrupt-map-mask = <0 0 0 0>; 202 interrupt-map-mask = <0 0 0 0>;
136 interrupt-map = <0 0 0 0 &mpic 62>; 203 interrupt-map = <0 0 0 0 &mpic 62>;
137 marvell,pcie-port = <1>; 204 marvell,pcie-port = <1>;
@@ -142,12 +209,13 @@ pcie-controller {
142 209
143 pcie@6,0 { 210 pcie@6,0 {
144 device_type = "pci"; 211 device_type = "pci";
145 assigned-addresses = <0x82003000 0 0xd0084000 0 0x2000>; 212 assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
146 reg = <0x3000 0 0 0 0>; 213 reg = <0x3000 0 0 0 0>;
147 #address-cells = <3>; 214 #address-cells = <3>;
148 #size-cells = <2>; 215 #size-cells = <2>;
149 #interrupt-cells = <1>; 216 #interrupt-cells = <1>;
150 ranges; 217 ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0
218 0x81000000 0 0 0x81000000 0x6 0 1 0>;
151 interrupt-map-mask = <0 0 0 0>; 219 interrupt-map-mask = <0 0 0 0>;
152 interrupt-map = <0 0 0 0 &mpic 63>; 220 interrupt-map = <0 0 0 0 &mpic 63>;
153 marvell,pcie-port = <1>; 221 marvell,pcie-port = <1>;
@@ -158,12 +226,13 @@ pcie-controller {
158 226
159 pcie@7,0 { 227 pcie@7,0 {
160 device_type = "pci"; 228 device_type = "pci";
161 assigned-addresses = <0x82003800 0 0xd0088000 0 0x2000>; 229 assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
162 reg = <0x3800 0 0 0 0>; 230 reg = <0x3800 0 0 0 0>;
163 #address-cells = <3>; 231 #address-cells = <3>;
164 #size-cells = <2>; 232 #size-cells = <2>;
165 #interrupt-cells = <1>; 233 #interrupt-cells = <1>;
166 ranges; 234 ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0
235 0x81000000 0 0 0x81000000 0x7 0 1 0>;
167 interrupt-map-mask = <0 0 0 0>; 236 interrupt-map-mask = <0 0 0 0>;
168 interrupt-map = <0 0 0 0 &mpic 64>; 237 interrupt-map = <0 0 0 0 &mpic 64>;
169 marvell,pcie-port = <1>; 238 marvell,pcie-port = <1>;
@@ -174,12 +243,13 @@ pcie-controller {
174 243
175 pcie@8,0 { 244 pcie@8,0 {
176 device_type = "pci"; 245 device_type = "pci";
177 assigned-addresses = <0x82004000 0 0xd008c000 0 0x2000>; 246 assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
178 reg = <0x4000 0 0 0 0>; 247 reg = <0x4000 0 0 0 0>;
179 #address-cells = <3>; 248 #address-cells = <3>;
180 #size-cells = <2>; 249 #size-cells = <2>;
181 #interrupt-cells = <1>; 250 #interrupt-cells = <1>;
182 ranges; 251 ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0
252 0x81000000 0 0 0x81000000 0x8 0 1 0>;
183 interrupt-map-mask = <0 0 0 0>; 253 interrupt-map-mask = <0 0 0 0>;
184 interrupt-map = <0 0 0 0 &mpic 65>; 254 interrupt-map = <0 0 0 0 &mpic 65>;
185 marvell,pcie-port = <1>; 255 marvell,pcie-port = <1>;
@@ -187,14 +257,16 @@ pcie-controller {
187 clocks = <&gateclk 12>; 257 clocks = <&gateclk 12>;
188 status = "disabled"; 258 status = "disabled";
189 }; 259 };
260
190 pcie@9,0 { 261 pcie@9,0 {
191 device_type = "pci"; 262 device_type = "pci";
192 assigned-addresses = <0x82004800 0 0xd0042000 0 0x2000>; 263 assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
193 reg = <0x4800 0 0 0 0>; 264 reg = <0x4800 0 0 0 0>;
194 #address-cells = <3>; 265 #address-cells = <3>;
195 #size-cells = <2>; 266 #size-cells = <2>;
196 #interrupt-cells = <1>; 267 #interrupt-cells = <1>;
197 ranges; 268 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
269 0x81000000 0 0 0x81000000 0x9 0 1 0>;
198 interrupt-map-mask = <0 0 0 0>; 270 interrupt-map-mask = <0 0 0 0>;
199 interrupt-map = <0 0 0 0 &mpic 99>; 271 interrupt-map = <0 0 0 0 &mpic 99>;
200 marvell,pcie-port = <2>; 272 marvell,pcie-port = <2>;
@@ -205,12 +277,13 @@ pcie-controller {
205 277
206 pcie@10,0 { 278 pcie@10,0 {
207 device_type = "pci"; 279 device_type = "pci";
208 assigned-addresses = <0x82005000 0 0xd0082000 0 0x2000>; 280 assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
209 reg = <0x5000 0 0 0 0>; 281 reg = <0x5000 0 0 0 0>;
210 #address-cells = <3>; 282 #address-cells = <3>;
211 #size-cells = <2>; 283 #size-cells = <2>;
212 #interrupt-cells = <1>; 284 #interrupt-cells = <1>;
213 ranges; 285 ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0
286 0x81000000 0 0 0x81000000 0xa 0 1 0>;
214 interrupt-map-mask = <0 0 0 0>; 287 interrupt-map-mask = <0 0 0 0>;
215 interrupt-map = <0 0 0 0 &mpic 103>; 288 interrupt-map = <0 0 0 0 &mpic 103>;
216 marvell,pcie-port = <3>; 289 marvell,pcie-port = <3>;
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index af19e38f8e97..1d94303d4416 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -101,6 +101,7 @@ dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \
101dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ 101dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \
102 armada-370-mirabox.dtb \ 102 armada-370-mirabox.dtb \
103 armada-370-rd.dtb \ 103 armada-370-rd.dtb \
104 armada-xp-axpwifiap.dtb \
104 armada-xp-db.dtb \ 105 armada-xp-db.dtb \
105 armada-xp-gp.dtb \ 106 armada-xp-gp.dtb \
106 armada-xp-openblocks-ax3-4.dtb 107 armada-xp-openblocks-ax3-4.dtb
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts
index beee1699d49e..90ce29dbe119 100644
--- a/arch/arm/boot/dts/armada-370-db.dts
+++ b/arch/arm/boot/dts/armada-370-db.dts
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16/dts-v1/; 16/dts-v1/;
17/include/ "armada-370.dtsi" 17#include "armada-370.dtsi"
18 18
19/ { 19/ {
20 model = "Marvell Armada 370 Evaluation Board"; 20 model = "Marvell Armada 370 Evaluation Board";
@@ -30,6 +30,9 @@
30 }; 30 };
31 31
32 soc { 32 soc {
33 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
34 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
35
33 internal-regs { 36 internal-regs {
34 serial@12000 { 37 serial@12000 {
35 clock-frequency = <200000000>; 38 clock-frequency = <200000000>;
diff --git a/arch/arm/boot/dts/armada-370-mirabox.dts b/arch/arm/boot/dts/armada-370-mirabox.dts
index 45b107763e3b..2471d9da767b 100644
--- a/arch/arm/boot/dts/armada-370-mirabox.dts
+++ b/arch/arm/boot/dts/armada-370-mirabox.dts
@@ -9,7 +9,7 @@
9 */ 9 */
10 10
11/dts-v1/; 11/dts-v1/;
12/include/ "armada-370.dtsi" 12#include "armada-370.dtsi"
13 13
14/ { 14/ {
15 model = "Globalscale Mirabox"; 15 model = "Globalscale Mirabox";
@@ -25,6 +25,25 @@
25 }; 25 };
26 26
27 soc { 27 soc {
28 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
29 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
30
31 pcie-controller {
32 status = "okay";
33
34 /* Internal mini-PCIe connector */
35 pcie@1,0 {
36 /* Port 0, Lane 0 */
37 status = "okay";
38 };
39
40 /* Connected on the PCB to a USB 3.0 XHCI controller */
41 pcie@2,0 {
42 /* Port 1, Lane 0 */
43 status = "okay";
44 };
45 };
46
28 internal-regs { 47 internal-regs {
29 serial@12000 { 48 serial@12000 {
30 clock-frequency = <200000000>; 49 clock-frequency = <200000000>;
@@ -120,22 +139,6 @@
120 reg = <0x25>; 139 reg = <0x25>;
121 }; 140 };
122 }; 141 };
123
124 pcie-controller {
125 status = "okay";
126
127 /* Internal mini-PCIe connector */
128 pcie@1,0 {
129 /* Port 0, Lane 0 */
130 status = "okay";
131 };
132
133 /* Connected on the PCB to a USB 3.0 XHCI controller */
134 pcie@2,0 {
135 /* Port 1, Lane 0 */
136 status = "okay";
137 };
138 };
139 }; 142 };
140 }; 143 };
141}; 144};
diff --git a/arch/arm/boot/dts/armada-370-rd.dts b/arch/arm/boot/dts/armada-370-rd.dts
index a3a2fedb8726..f81810a59629 100644
--- a/arch/arm/boot/dts/armada-370-rd.dts
+++ b/arch/arm/boot/dts/armada-370-rd.dts
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14/dts-v1/; 14/dts-v1/;
15/include/ "armada-370.dtsi" 15#include "armada-370.dtsi"
16 16
17/ { 17/ {
18 model = "Marvell Armada 370 Reference Design"; 18 model = "Marvell Armada 370 Reference Design";
@@ -28,6 +28,25 @@
28 }; 28 };
29 29
30 soc { 30 soc {
31 ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
32 MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>;
33
34 pcie-controller {
35 status = "okay";
36
37 /* Internal mini-PCIe connector */
38 pcie@1,0 {
39 /* Port 0, Lane 0 */
40 status = "okay";
41 };
42
43 /* Internal mini-PCIe connector */
44 pcie@2,0 {
45 /* Port 1, Lane 0 */
46 status = "okay";
47 };
48 };
49
31 internal-regs { 50 internal-regs {
32 serial@12000 { 51 serial@12000 {
33 clock-frequency = <200000000>; 52 clock-frequency = <200000000>;
@@ -85,22 +104,6 @@
85 gpios = <&gpio0 6 1>; 104 gpios = <&gpio0 6 1>;
86 }; 105 };
87 }; 106 };
88
89 pcie-controller {
90 status = "okay";
91
92 /* Internal mini-PCIe connector */
93 pcie@1,0 {
94 /* Port 0, Lane 0 */
95 status = "okay";
96 };
97
98 /* Internal mini-PCIe connector */
99 pcie@2,0 {
100 /* Port 1, Lane 0 */
101 status = "okay";
102 };
103 };
104 }; 107 };
105 }; 108 };
106 }; 109 };
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi
index 90b117624abb..e984ce6bb33f 100644
--- a/arch/arm/boot/dts/armada-370-xp.dtsi
+++ b/arch/arm/boot/dts/armada-370-xp.dtsi
@@ -18,6 +18,8 @@
18 18
19/include/ "skeleton64.dtsi" 19/include/ "skeleton64.dtsi"
20 20
21#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
22
21/ { 23/ {
22 model = "Marvell Armada 370 and XP SoC"; 24 model = "Marvell Armada 370 and XP SoC";
23 compatible = "marvell,armada-370-xp"; 25 compatible = "marvell,armada-370-xp";
@@ -38,18 +40,73 @@
38 }; 40 };
39 41
40 soc { 42 soc {
41 #address-cells = <1>; 43 #address-cells = <2>;
42 #size-cells = <1>; 44 #size-cells = <1>;
43 compatible = "simple-bus"; 45 controller = <&mbusc>;
44 interrupt-parent = <&mpic>; 46 interrupt-parent = <&mpic>;
45 ranges = <0 0 0xd0000000 0x0100000 /* internal registers */ 47 pcie-mem-aperture = <0xe0000000 0x8000000>;
46 0xe0000000 0 0xe0000000 0x8100000 /* PCIe */>; 48 pcie-io-aperture = <0xe8000000 0x100000>;
49
50 devbus-bootcs {
51 compatible = "marvell,mvebu-devbus";
52 reg = <MBUS_ID(0xf0, 0x01) 0x10400 0x8>;
53 ranges = <0 MBUS_ID(0x01, 0x2f) 0 0xffffffff>;
54 #address-cells = <1>;
55 #size-cells = <1>;
56 clocks = <&coreclk 0>;
57 status = "disabled";
58 };
59
60 devbus-cs0 {
61 compatible = "marvell,mvebu-devbus";
62 reg = <MBUS_ID(0xf0, 0x01) 0x10408 0x8>;
63 ranges = <0 MBUS_ID(0x01, 0x3e) 0 0xffffffff>;
64 #address-cells = <1>;
65 #size-cells = <1>;
66 clocks = <&coreclk 0>;
67 status = "disabled";
68 };
69
70 devbus-cs1 {
71 compatible = "marvell,mvebu-devbus";
72 reg = <MBUS_ID(0xf0, 0x01) 0x10410 0x8>;
73 ranges = <0 MBUS_ID(0x01, 0x3d) 0 0xffffffff>;
74 #address-cells = <1>;
75 #size-cells = <1>;
76 clocks = <&coreclk 0>;
77 status = "disabled";
78 };
79
80 devbus-cs2 {
81 compatible = "marvell,mvebu-devbus";
82 reg = <MBUS_ID(0xf0, 0x01) 0x10418 0x8>;
83 ranges = <0 MBUS_ID(0x01, 0x3b) 0 0xffffffff>;
84 #address-cells = <1>;
85 #size-cells = <1>;
86 clocks = <&coreclk 0>;
87 status = "disabled";
88 };
89
90 devbus-cs3 {
91 compatible = "marvell,mvebu-devbus";
92 reg = <MBUS_ID(0xf0, 0x01) 0x10420 0x8>;
93 ranges = <0 MBUS_ID(0x01, 0x37) 0 0xffffffff>;
94 #address-cells = <1>;
95 #size-cells = <1>;
96 clocks = <&coreclk 0>;
97 status = "disabled";
98 };
47 99
48 internal-regs { 100 internal-regs {
49 compatible = "simple-bus"; 101 compatible = "simple-bus";
50 #address-cells = <1>; 102 #address-cells = <1>;
51 #size-cells = <1>; 103 #size-cells = <1>;
52 ranges; 104 ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
105
106 mbusc: mbus-controller@20000 {
107 compatible = "marvell,mbus-controller";
108 reg = <0x20000 0x100>, <0x20180 0x20>;
109 };
53 110
54 mpic: interrupt-controller@20000 { 111 mpic: interrupt-controller@20000 {
55 compatible = "marvell,mpic"; 112 compatible = "marvell,mpic";
@@ -195,50 +252,6 @@
195 status = "disabled"; 252 status = "disabled";
196 }; 253 };
197 254
198 devbus-bootcs@10400 {
199 compatible = "marvell,mvebu-devbus";
200 reg = <0x10400 0x8>;
201 #address-cells = <1>;
202 #size-cells = <1>;
203 clocks = <&coreclk 0>;
204 status = "disabled";
205 };
206
207 devbus-cs0@10408 {
208 compatible = "marvell,mvebu-devbus";
209 reg = <0x10408 0x8>;
210 #address-cells = <1>;
211 #size-cells = <1>;
212 clocks = <&coreclk 0>;
213 status = "disabled";
214 };
215
216 devbus-cs1@10410 {
217 compatible = "marvell,mvebu-devbus";
218 reg = <0x10410 0x8>;
219 #address-cells = <1>;
220 #size-cells = <1>;
221 clocks = <&coreclk 0>;
222 status = "disabled";
223 };
224
225 devbus-cs2@10418 {
226 compatible = "marvell,mvebu-devbus";
227 reg = <0x10418 0x8>;
228 #address-cells = <1>;
229 #size-cells = <1>;
230 clocks = <&coreclk 0>;
231 status = "disabled";
232 };
233
234 devbus-cs3@10420 {
235 compatible = "marvell,mvebu-devbus";
236 reg = <0x10420 0x8>;
237 #address-cells = <1>;
238 #size-cells = <1>;
239 clocks = <&coreclk 0>;
240 status = "disabled";
241 };
242 }; 255 };
243 }; 256 };
244 }; 257 };
diff --git a/arch/arm/boot/dts/armada-370.dtsi b/arch/arm/boot/dts/armada-370.dtsi
index fa3dfc6b4c6a..648e5303446e 100644
--- a/arch/arm/boot/dts/armada-370.dtsi
+++ b/arch/arm/boot/dts/armada-370.dtsi
@@ -15,7 +15,7 @@
15 * common to all Armada SoCs. 15 * common to all Armada SoCs.
16 */ 16 */
17 17
18/include/ "armada-370-xp.dtsi" 18#include "armada-370-xp.dtsi"
19/include/ "skeleton.dtsi" 19/include/ "skeleton.dtsi"
20 20
21/ { 21/ {
@@ -29,8 +29,66 @@
29 }; 29 };
30 30
31 soc { 31 soc {
32 ranges = <0 0xd0000000 0x0100000 /* internal registers */ 32 compatible = "marvell,armada370-mbus", "simple-bus";
33 0xe0000000 0xe0000000 0x8100000 /* PCIe */>; 33
34 bootrom {
35 compatible = "marvell,bootrom";
36 reg = <MBUS_ID(0x01, 0xe0) 0 0x100000>;
37 };
38
39 pcie-controller {
40 compatible = "marvell,armada-370-pcie";
41 status = "disabled";
42 device_type = "pci";
43
44 #address-cells = <3>;
45 #size-cells = <2>;
46
47 bus-range = <0x00 0xff>;
48
49 ranges =
50 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
51 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
52 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
53 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
54 0x82000000 0x2 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
55 0x81000000 0x2 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */>;
56
57 pcie@1,0 {
58 device_type = "pci";
59 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
60 reg = <0x0800 0 0 0 0>;
61 #address-cells = <3>;
62 #size-cells = <2>;
63 #interrupt-cells = <1>;
64 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
65 0x81000000 0 0 0x81000000 0x1 0 1 0>;
66 interrupt-map-mask = <0 0 0 0>;
67 interrupt-map = <0 0 0 0 &mpic 58>;
68 marvell,pcie-port = <0>;
69 marvell,pcie-lane = <0>;
70 clocks = <&gateclk 5>;
71 status = "disabled";
72 };
73
74 pcie@2,0 {
75 device_type = "pci";
76 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
77 reg = <0x1000 0 0 0 0>;
78 #address-cells = <3>;
79 #size-cells = <2>;
80 #interrupt-cells = <1>;
81 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
82 0x81000000 0 0 0x81000000 0x2 0 1 0>;
83 interrupt-map-mask = <0 0 0 0>;
84 interrupt-map = <0 0 0 0 &mpic 62>;
85 marvell,pcie-port = <1>;
86 marvell,pcie-lane = <0>;
87 clocks = <&gateclk 9>;
88 status = "disabled";
89 };
90 };
91
34 internal-regs { 92 internal-regs {
35 system-controller@18200 { 93 system-controller@18200 {
36 compatible = "marvell,armada-370-xp-system-controller"; 94 compatible = "marvell,armada-370-xp-system-controller";
@@ -169,54 +227,6 @@
169 0x18304 0x4>; 227 0x18304 0x4>;
170 status = "okay"; 228 status = "okay";
171 }; 229 };
172
173 pcie-controller {
174 compatible = "marvell,armada-370-pcie";
175 status = "disabled";
176 device_type = "pci";
177
178 #address-cells = <3>;
179 #size-cells = <2>;
180
181 bus-range = <0x00 0xff>;
182
183 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
184 0x82000000 0 0x80000 0x80000 0 0x00002000 /* Port 1.0 registers */
185 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
186 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
187
188 pcie@1,0 {
189 device_type = "pci";
190 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
191 reg = <0x0800 0 0 0 0>;
192 #address-cells = <3>;
193 #size-cells = <2>;
194 #interrupt-cells = <1>;
195 ranges;
196 interrupt-map-mask = <0 0 0 0>;
197 interrupt-map = <0 0 0 0 &mpic 58>;
198 marvell,pcie-port = <0>;
199 marvell,pcie-lane = <0>;
200 clocks = <&gateclk 5>;
201 status = "disabled";
202 };
203
204 pcie@2,0 {
205 device_type = "pci";
206 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
207 reg = <0x1000 0 0 0 0>;
208 #address-cells = <3>;
209 #size-cells = <2>;
210 #interrupt-cells = <1>;
211 ranges;
212 interrupt-map-mask = <0 0 0 0>;
213 interrupt-map = <0 0 0 0 &mpic 62>;
214 marvell,pcie-port = <1>;
215 marvell,pcie-lane = <0>;
216 clocks = <&gateclk 9>;
217 status = "disabled";
218 };
219 };
220 }; 230 };
221 }; 231 };
222}; 232};
diff --git a/arch/arm/boot/dts/armada-xp-axpwifiap.dts b/arch/arm/boot/dts/armada-xp-axpwifiap.dts
new file mode 100644
index 000000000000..c5fe57269f5a
--- /dev/null
+++ b/arch/arm/boot/dts/armada-xp-axpwifiap.dts
@@ -0,0 +1,164 @@
1/*
2 * Device Tree file for Marvell RD-AXPWiFiAP.
3 *
4 * Note: this board is shipped with a new generation boot loader that
5 * remaps internal registers at 0xf1000000. Therefore, if earlyprintk
6 * is used, the CONFIG_DEBUG_MVEBU_UART_ALTERNATE option should be
7 * used.
8 *
9 * Copyright (C) 2013 Marvell
10 *
11 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
12 *
13 * This file is licensed under the terms of the GNU General Public
14 * License version 2. This program is licensed "as is" without any
15 * warranty of any kind, whether express or implied.
16 */
17
18/dts-v1/;
19#include "armada-xp-mv78230.dtsi"
20
21/ {
22 model = "Marvell RD-AXPWiFiAP";
23 compatible = "marvell,rd-axpwifiap", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
24
25 chosen {
26 bootargs = "console=ttyS0,115200 earlyprintk";
27 };
28
29 memory {
30 device_type = "memory";
31 reg = <0x00000000 0x00000000 0x00000000 0x40000000>; /* 1GB */
32 };
33
34 soc {
35 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
36 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
37
38 pcie-controller {
39 status = "okay";
40
41 /* First mini-PCIe port */
42 pcie@1,0 {
43 /* Port 0, Lane 0 */
44 status = "okay";
45 };
46
47 /* Second mini-PCIe port */
48 pcie@2,0 {
49 /* Port 0, Lane 1 */
50 status = "okay";
51 };
52
53 /* Renesas uPD720202 USB 3.0 controller */
54 pcie@3,0 {
55 /* Port 0, Lane 3 */
56 status = "okay";
57 };
58 };
59
60 internal-regs {
61 pinctrl {
62 pinctrl-0 = <&pmx_phy_int>;
63 pinctrl-names = "default";
64
65 pmx_ge0: pmx-ge0 {
66 marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3",
67 "mpp4", "mpp5", "mpp6", "mpp7",
68 "mpp8", "mpp9", "mpp10", "mpp11";
69 marvell,function = "ge0";
70 };
71
72 pmx_ge1: pmx-ge1 {
73 marvell,pins = "mpp12", "mpp13", "mpp14", "mpp15",
74 "mpp16", "mpp17", "mpp18", "mpp19",
75 "mpp20", "mpp21", "mpp22", "mpp23";
76 marvell,function = "ge1";
77 };
78
79 pmx_keys: pmx-keys {
80 marvell,pins = "mpp33";
81 marvell,function = "gpio";
82 };
83
84 pmx_spi: pmx-spi {
85 marvell,pins = "mpp36", "mpp37", "mpp38", "mpp39";
86 marvell,function = "spi";
87 };
88
89 pmx_phy_int: pmx-phy-int {
90 marvell,pins = "mpp32";
91 marvell,function = "gpio";
92 };
93 };
94
95 serial@12000 {
96 clock-frequency = <250000000>;
97 status = "okay";
98 };
99
100 serial@12100 {
101 clock-frequency = <250000000>;
102 status = "okay";
103 };
104
105 sata@a0000 {
106 nr-ports = <1>;
107 status = "okay";
108 };
109
110 mdio {
111 phy0: ethernet-phy@0 {
112 reg = <0>;
113 };
114
115 phy1: ethernet-phy@1 {
116 reg = <1>;
117 };
118 };
119
120 ethernet@70000 {
121 pinctrl-0 = <&pmx_ge0>;
122 pinctrl-names = "default";
123 status = "okay";
124 phy = <&phy0>;
125 phy-mode = "rgmii-id";
126 };
127 ethernet@74000 {
128 pinctrl-0 = <&pmx_ge1>;
129 pinctrl-names = "default";
130 status = "okay";
131 phy = <&phy1>;
132 phy-mode = "rgmii-id";
133 };
134
135 spi0: spi@10600 {
136 status = "okay";
137 pinctrl-0 = <&pmx_spi>;
138 pinctrl-names = "default";
139
140 spi-flash@0 {
141 #address-cells = <1>;
142 #size-cells = <1>;
143 compatible = "n25q128a13";
144 reg = <0>; /* Chip select 0 */
145 spi-max-frequency = <108000000>;
146 };
147 };
148 };
149 };
150
151 gpio_keys {
152 compatible = "gpio-keys";
153 #address-cells = <1>;
154 #size-cells = <0>;
155 pinctrl-0 = <&pmx_keys>;
156 pinctrl-names = "default";
157
158 button@1 {
159 label = "Factory Reset Button";
160 linux,code = <141>; /* KEY_SETUP */
161 gpios = <&gpio1 1 1>;
162 };
163 };
164};
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts
index e28e68ff864d..bcf6d79a57ec 100644
--- a/arch/arm/boot/dts/armada-xp-db.dts
+++ b/arch/arm/boot/dts/armada-xp-db.dts
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16/dts-v1/; 16/dts-v1/;
17/include/ "armada-xp-mv78460.dtsi" 17#include "armada-xp-mv78460.dtsi"
18 18
19/ { 19/ {
20 model = "Marvell Armada XP Evaluation Board"; 20 model = "Marvell Armada XP Evaluation Board";
@@ -30,9 +30,70 @@
30 }; 30 };
31 31
32 soc { 32 soc {
33 ranges = <0 0 0xd0000000 0x100000 /* Internal registers 1MiB */ 33 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
34 0xe0000000 0 0xe0000000 0x8100000 /* PCIe */ 34 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
35 0xf0000000 0 0xf0000000 0x1000000>; /* Device Bus, NOR 16MiB */ 35 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
36
37 devbus-bootcs {
38 status = "okay";
39
40 /* Device Bus parameters are required */
41
42 /* Read parameters */
43 devbus,bus-width = <8>;
44 devbus,turn-off-ps = <60000>;
45 devbus,badr-skew-ps = <0>;
46 devbus,acc-first-ps = <124000>;
47 devbus,acc-next-ps = <248000>;
48 devbus,rd-setup-ps = <0>;
49 devbus,rd-hold-ps = <0>;
50
51 /* Write parameters */
52 devbus,sync-enable = <0>;
53 devbus,wr-high-ps = <60000>;
54 devbus,wr-low-ps = <60000>;
55 devbus,ale-wr-ps = <60000>;
56
57 /* NOR 16 MiB */
58 nor@0 {
59 compatible = "cfi-flash";
60 reg = <0 0x1000000>;
61 bank-width = <2>;
62 };
63 };
64
65 pcie-controller {
66 status = "okay";
67
68 /*
69 * All 6 slots are physically present as
70 * standard PCIe slots on the board.
71 */
72 pcie@1,0 {
73 /* Port 0, Lane 0 */
74 status = "okay";
75 };
76 pcie@2,0 {
77 /* Port 0, Lane 1 */
78 status = "okay";
79 };
80 pcie@3,0 {
81 /* Port 0, Lane 2 */
82 status = "okay";
83 };
84 pcie@4,0 {
85 /* Port 0, Lane 3 */
86 status = "okay";
87 };
88 pcie@9,0 {
89 /* Port 2, Lane 0 */
90 status = "okay";
91 };
92 pcie@10,0 {
93 /* Port 3, Lane 0 */
94 status = "okay";
95 };
96 };
36 97
37 internal-regs { 98 internal-regs {
38 serial@12000 { 99 serial@12000 {
@@ -127,68 +188,6 @@
127 spi-max-frequency = <20000000>; 188 spi-max-frequency = <20000000>;
128 }; 189 };
129 }; 190 };
130
131 pcie-controller {
132 status = "okay";
133
134 /*
135 * All 6 slots are physically present as
136 * standard PCIe slots on the board.
137 */
138 pcie@1,0 {
139 /* Port 0, Lane 0 */
140 status = "okay";
141 };
142 pcie@2,0 {
143 /* Port 0, Lane 1 */
144 status = "okay";
145 };
146 pcie@3,0 {
147 /* Port 0, Lane 2 */
148 status = "okay";
149 };
150 pcie@4,0 {
151 /* Port 0, Lane 3 */
152 status = "okay";
153 };
154 pcie@9,0 {
155 /* Port 2, Lane 0 */
156 status = "okay";
157 };
158 pcie@10,0 {
159 /* Port 3, Lane 0 */
160 status = "okay";
161 };
162 };
163
164 devbus-bootcs@10400 {
165 status = "okay";
166 ranges = <0 0xf0000000 0x1000000>;
167
168 /* Device Bus parameters are required */
169
170 /* Read parameters */
171 devbus,bus-width = <8>;
172 devbus,turn-off-ps = <60000>;
173 devbus,badr-skew-ps = <0>;
174 devbus,acc-first-ps = <124000>;
175 devbus,acc-next-ps = <248000>;
176 devbus,rd-setup-ps = <0>;
177 devbus,rd-hold-ps = <0>;
178
179 /* Write parameters */
180 devbus,sync-enable = <0>;
181 devbus,wr-high-ps = <60000>;
182 devbus,wr-low-ps = <60000>;
183 devbus,ale-wr-ps = <60000>;
184
185 /* NOR 16 MiB */
186 nor@0 {
187 compatible = "cfi-flash";
188 reg = <0 0x1000000>;
189 bank-width = <2>;
190 };
191 };
192 }; 191 };
193 }; 192 };
194}; 193};
diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts
index c87b2de29c30..2298e4a910e2 100644
--- a/arch/arm/boot/dts/armada-xp-gp.dts
+++ b/arch/arm/boot/dts/armada-xp-gp.dts
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16/dts-v1/; 16/dts-v1/;
17/include/ "armada-xp-mv78460.dtsi" 17#include "armada-xp-mv78460.dtsi"
18 18
19/ { 19/ {
20 model = "Marvell Armada XP Development Board DB-MV784MP-GP"; 20 model = "Marvell Armada XP Development Board DB-MV784MP-GP";
@@ -39,9 +39,58 @@
39 }; 39 };
40 40
41 soc { 41 soc {
42 ranges = <0 0 0xd0000000 0x100000 /* Internal registers 1MiB */ 42 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
43 0xe0000000 0 0xe0000000 0x8100000 /* PCIe */ 43 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
44 0xf0000000 0 0xf0000000 0x1000000 /* Device Bus, NOR 16MiB */>; 44 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x1000000>;
45
46 devbus-bootcs {
47 status = "okay";
48
49 /* Device Bus parameters are required */
50
51 /* Read parameters */
52 devbus,bus-width = <8>;
53 devbus,turn-off-ps = <60000>;
54 devbus,badr-skew-ps = <0>;
55 devbus,acc-first-ps = <124000>;
56 devbus,acc-next-ps = <248000>;
57 devbus,rd-setup-ps = <0>;
58 devbus,rd-hold-ps = <0>;
59
60 /* Write parameters */
61 devbus,sync-enable = <0>;
62 devbus,wr-high-ps = <60000>;
63 devbus,wr-low-ps = <60000>;
64 devbus,ale-wr-ps = <60000>;
65
66 /* NOR 16 MiB */
67 nor@0 {
68 compatible = "cfi-flash";
69 reg = <0 0x1000000>;
70 bank-width = <2>;
71 };
72 };
73
74 pcie-controller {
75 status = "okay";
76
77 /*
78 * The 3 slots are physically present as
79 * standard PCIe slots on the board.
80 */
81 pcie@1,0 {
82 /* Port 0, Lane 0 */
83 status = "okay";
84 };
85 pcie@9,0 {
86 /* Port 2, Lane 0 */
87 status = "okay";
88 };
89 pcie@10,0 {
90 /* Port 3, Lane 0 */
91 status = "okay";
92 };
93 };
45 94
46 internal-regs { 95 internal-regs {
47 serial@12000 { 96 serial@12000 {
@@ -126,56 +175,6 @@
126 spi-max-frequency = <108000000>; 175 spi-max-frequency = <108000000>;
127 }; 176 };
128 }; 177 };
129
130 devbus-bootcs@10400 {
131 status = "okay";
132 ranges = <0 0xf0000000 0x1000000>; /* @addr 0xf000000, size 0x1000000 */
133
134 /* Device Bus parameters are required */
135
136 /* Read parameters */
137 devbus,bus-width = <8>;
138 devbus,turn-off-ps = <60000>;
139 devbus,badr-skew-ps = <0>;
140 devbus,acc-first-ps = <124000>;
141 devbus,acc-next-ps = <248000>;
142 devbus,rd-setup-ps = <0>;
143 devbus,rd-hold-ps = <0>;
144
145 /* Write parameters */
146 devbus,sync-enable = <0>;
147 devbus,wr-high-ps = <60000>;
148 devbus,wr-low-ps = <60000>;
149 devbus,ale-wr-ps = <60000>;
150
151 /* NOR 16 MiB */
152 nor@0 {
153 compatible = "cfi-flash";
154 reg = <0 0x1000000>;
155 bank-width = <2>;
156 };
157 };
158
159 pcie-controller {
160 status = "okay";
161
162 /*
163 * The 3 slots are physically present as
164 * standard PCIe slots on the board.
165 */
166 pcie@1,0 {
167 /* Port 0, Lane 0 */
168 status = "okay";
169 };
170 pcie@9,0 {
171 /* Port 2, Lane 0 */
172 status = "okay";
173 };
174 pcie@10,0 {
175 /* Port 3, Lane 0 */
176 status = "okay";
177 };
178 };
179 }; 178 };
180 }; 179 };
181}; 180};
diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
index f8eaa383e07f..e45e363cc9b9 100644
--- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
@@ -13,7 +13,7 @@
13 * common to all Armada XP SoCs. 13 * common to all Armada XP SoCs.
14 */ 14 */
15 15
16/include/ "armada-xp.dtsi" 16#include "armada-xp.dtsi"
17 17
18/ { 18/ {
19 model = "Marvell Armada XP MV78230 SoC"; 19 model = "Marvell Armada XP MV78230 SoC";
@@ -44,6 +44,124 @@
44 }; 44 };
45 45
46 soc { 46 soc {
47 /*
48 * MV78230 has 2 PCIe units Gen2.0: One unit can be
49 * configured as x4 or quad x1 lanes. One unit is
50 * x4/x1.
51 */
52 pcie-controller {
53 compatible = "marvell,armada-xp-pcie";
54 status = "disabled";
55 device_type = "pci";
56
57 #address-cells = <3>;
58 #size-cells = <2>;
59
60 bus-range = <0x00 0xff>;
61
62 ranges =
63 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
64 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */
65 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */
66 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
67 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
68 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
69 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
70 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
71 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO */
72 0x82000000 0x3 0 MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
73 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */
74 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
75 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */
76 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
77 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */>;
78
79 pcie@1,0 {
80 device_type = "pci";
81 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
82 reg = <0x0800 0 0 0 0>;
83 #address-cells = <3>;
84 #size-cells = <2>;
85 #interrupt-cells = <1>;
86 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
87 0x81000000 0 0 0x81000000 0x1 0 1 0>;
88 interrupt-map-mask = <0 0 0 0>;
89 interrupt-map = <0 0 0 0 &mpic 58>;
90 marvell,pcie-port = <0>;
91 marvell,pcie-lane = <0>;
92 clocks = <&gateclk 5>;
93 status = "disabled";
94 };
95
96 pcie@2,0 {
97 device_type = "pci";
98 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
99 reg = <0x1000 0 0 0 0>;
100 #address-cells = <3>;
101 #size-cells = <2>;
102 #interrupt-cells = <1>;
103 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
104 0x81000000 0 0 0x81000000 0x2 0 1 0>;
105 interrupt-map-mask = <0 0 0 0>;
106 interrupt-map = <0 0 0 0 &mpic 59>;
107 marvell,pcie-port = <0>;
108 marvell,pcie-lane = <1>;
109 clocks = <&gateclk 6>;
110 status = "disabled";
111 };
112
113 pcie@3,0 {
114 device_type = "pci";
115 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
116 reg = <0x1800 0 0 0 0>;
117 #address-cells = <3>;
118 #size-cells = <2>;
119 #interrupt-cells = <1>;
120 ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
121 0x81000000 0 0 0x81000000 0x3 0 1 0>;
122 interrupt-map-mask = <0 0 0 0>;
123 interrupt-map = <0 0 0 0 &mpic 60>;
124 marvell,pcie-port = <0>;
125 marvell,pcie-lane = <2>;
126 clocks = <&gateclk 7>;
127 status = "disabled";
128 };
129
130 pcie@4,0 {
131 device_type = "pci";
132 assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
133 reg = <0x2000 0 0 0 0>;
134 #address-cells = <3>;
135 #size-cells = <2>;
136 #interrupt-cells = <1>;
137 ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
138 0x81000000 0 0 0x81000000 0x4 0 1 0>;
139 interrupt-map-mask = <0 0 0 0>;
140 interrupt-map = <0 0 0 0 &mpic 61>;
141 marvell,pcie-port = <0>;
142 marvell,pcie-lane = <3>;
143 clocks = <&gateclk 8>;
144 status = "disabled";
145 };
146
147 pcie@9,0 {
148 device_type = "pci";
149 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
150 reg = <0x4800 0 0 0 0>;
151 #address-cells = <3>;
152 #size-cells = <2>;
153 #interrupt-cells = <1>;
154 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
155 0x81000000 0 0 0x81000000 0x9 0 1 0>;
156 interrupt-map-mask = <0 0 0 0>;
157 interrupt-map = <0 0 0 0 &mpic 99>;
158 marvell,pcie-port = <2>;
159 marvell,pcie-lane = <0>;
160 clocks = <&gateclk 26>;
161 status = "disabled";
162 };
163 };
164
47 internal-regs { 165 internal-regs {
48 pinctrl { 166 pinctrl {
49 compatible = "marvell,mv78230-pinctrl"; 167 compatible = "marvell,mv78230-pinctrl";
@@ -77,110 +195,6 @@
77 #interrupts-cells = <2>; 195 #interrupts-cells = <2>;
78 interrupts = <87>, <88>, <89>; 196 interrupts = <87>, <88>, <89>;
79 }; 197 };
80
81 /*
82 * MV78230 has 2 PCIe units Gen2.0: One unit can be
83 * configured as x4 or quad x1 lanes. One unit is
84 * x4/x1.
85 */
86 pcie-controller {
87 compatible = "marvell,armada-xp-pcie";
88 status = "disabled";
89 device_type = "pci";
90
91#address-cells = <3>;
92#size-cells = <2>;
93
94 bus-range = <0x00 0xff>;
95
96 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
97 0x82000000 0 0x42000 0x42000 0 0x00002000 /* Port 2.0 registers */
98 0x82000000 0 0x44000 0x44000 0 0x00002000 /* Port 0.1 registers */
99 0x82000000 0 0x48000 0x48000 0 0x00002000 /* Port 0.2 registers */
100 0x82000000 0 0x4c000 0x4c000 0 0x00002000 /* Port 0.3 registers */
101 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
102 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
103
104 pcie@1,0 {
105 device_type = "pci";
106 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
107 reg = <0x0800 0 0 0 0>;
108 #address-cells = <3>;
109 #size-cells = <2>;
110 #interrupt-cells = <1>;
111 ranges;
112 interrupt-map-mask = <0 0 0 0>;
113 interrupt-map = <0 0 0 0 &mpic 58>;
114 marvell,pcie-port = <0>;
115 marvell,pcie-lane = <0>;
116 clocks = <&gateclk 5>;
117 status = "disabled";
118 };
119
120 pcie@2,0 {
121 device_type = "pci";
122 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
123 reg = <0x1000 0 0 0 0>;
124 #address-cells = <3>;
125 #size-cells = <2>;
126 #interrupt-cells = <1>;
127 ranges;
128 interrupt-map-mask = <0 0 0 0>;
129 interrupt-map = <0 0 0 0 &mpic 59>;
130 marvell,pcie-port = <0>;
131 marvell,pcie-lane = <1>;
132 clocks = <&gateclk 6>;
133 status = "disabled";
134 };
135
136 pcie@3,0 {
137 device_type = "pci";
138 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
139 reg = <0x1800 0 0 0 0>;
140 #address-cells = <3>;
141 #size-cells = <2>;
142 #interrupt-cells = <1>;
143 ranges;
144 interrupt-map-mask = <0 0 0 0>;
145 interrupt-map = <0 0 0 0 &mpic 60>;
146 marvell,pcie-port = <0>;
147 marvell,pcie-lane = <2>;
148 clocks = <&gateclk 7>;
149 status = "disabled";
150 };
151
152 pcie@4,0 {
153 device_type = "pci";
154 assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
155 reg = <0x2000 0 0 0 0>;
156 #address-cells = <3>;
157 #size-cells = <2>;
158 #interrupt-cells = <1>;
159 ranges;
160 interrupt-map-mask = <0 0 0 0>;
161 interrupt-map = <0 0 0 0 &mpic 61>;
162 marvell,pcie-port = <0>;
163 marvell,pcie-lane = <3>;
164 clocks = <&gateclk 8>;
165 status = "disabled";
166 };
167
168 pcie@9,0 {
169 device_type = "pci";
170 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
171 reg = <0x4800 0 0 0 0>;
172 #address-cells = <3>;
173 #size-cells = <2>;
174 #interrupt-cells = <1>;
175 ranges;
176 interrupt-map-mask = <0 0 0 0>;
177 interrupt-map = <0 0 0 0 &mpic 99>;
178 marvell,pcie-port = <2>;
179 marvell,pcie-lane = <0>;
180 clocks = <&gateclk 26>;
181 status = "disabled";
182 };
183 };
184 }; 198 };
185 }; 199 };
186}; 200};
diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
index 2d9335da210c..6dc3921df9b3 100644
--- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
@@ -13,7 +13,7 @@
13 * common to all Armada XP SoCs. 13 * common to all Armada XP SoCs.
14 */ 14 */
15 15
16/include/ "armada-xp.dtsi" 16#include "armada-xp.dtsi"
17 17
18/ { 18/ {
19 model = "Marvell Armada XP MV78260 SoC"; 19 model = "Marvell Armada XP MV78260 SoC";
@@ -45,6 +45,145 @@
45 }; 45 };
46 46
47 soc { 47 soc {
48 /*
49 * MV78260 has 3 PCIe units Gen2.0: Two units can be
50 * configured as x4 or quad x1 lanes. One unit is
51 * x4/x1.
52 */
53 pcie-controller {
54 compatible = "marvell,armada-xp-pcie";
55 status = "disabled";
56 device_type = "pci";
57
58 #address-cells = <3>;
59 #size-cells = <2>;
60
61 bus-range = <0x00 0xff>;
62
63 ranges =
64 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
65 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */
66 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */
67 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
68 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
69 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */
70 0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000 /* Port 3.0 registers */
71 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
72 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
73 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
74 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO */
75 0x82000000 0x3 0 MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
76 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */
77 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
78 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */
79 0x82000000 0x9 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
80 0x81000000 0x9 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */
81 0x82000000 0xa 0 MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */
82 0x81000000 0xa 0 MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO */>;
83
84 pcie@1,0 {
85 device_type = "pci";
86 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
87 reg = <0x0800 0 0 0 0>;
88 #address-cells = <3>;
89 #size-cells = <2>;
90 #interrupt-cells = <1>;
91 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
92 0x81000000 0 0 0x81000000 0x1 0 1 0>;
93 interrupt-map-mask = <0 0 0 0>;
94 interrupt-map = <0 0 0 0 &mpic 58>;
95 marvell,pcie-port = <0>;
96 marvell,pcie-lane = <0>;
97 clocks = <&gateclk 5>;
98 status = "disabled";
99 };
100
101 pcie@2,0 {
102 device_type = "pci";
103 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
104 reg = <0x1000 0 0 0 0>;
105 #address-cells = <3>;
106 #size-cells = <2>;
107 #interrupt-cells = <1>;
108 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
109 0x81000000 0 0 0x81000000 0x2 0 1 0>;
110 interrupt-map-mask = <0 0 0 0>;
111 interrupt-map = <0 0 0 0 &mpic 59>;
112 marvell,pcie-port = <0>;
113 marvell,pcie-lane = <1>;
114 clocks = <&gateclk 6>;
115 status = "disabled";
116 };
117
118 pcie@3,0 {
119 device_type = "pci";
120 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
121 reg = <0x1800 0 0 0 0>;
122 #address-cells = <3>;
123 #size-cells = <2>;
124 #interrupt-cells = <1>;
125 ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
126 0x81000000 0 0 0x81000000 0x3 0 1 0>;
127 interrupt-map-mask = <0 0 0 0>;
128 interrupt-map = <0 0 0 0 &mpic 60>;
129 marvell,pcie-port = <0>;
130 marvell,pcie-lane = <2>;
131 clocks = <&gateclk 7>;
132 status = "disabled";
133 };
134
135 pcie@4,0 {
136 device_type = "pci";
137 assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
138 reg = <0x2000 0 0 0 0>;
139 #address-cells = <3>;
140 #size-cells = <2>;
141 #interrupt-cells = <1>;
142 ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
143 0x81000000 0 0 0x81000000 0x4 0 1 0>;
144 interrupt-map-mask = <0 0 0 0>;
145 interrupt-map = <0 0 0 0 &mpic 61>;
146 marvell,pcie-port = <0>;
147 marvell,pcie-lane = <3>;
148 clocks = <&gateclk 8>;
149 status = "disabled";
150 };
151
152 pcie@9,0 {
153 device_type = "pci";
154 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
155 reg = <0x4800 0 0 0 0>;
156 #address-cells = <3>;
157 #size-cells = <2>;
158 #interrupt-cells = <1>;
159 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
160 0x81000000 0 0 0x81000000 0x9 0 1 0>;
161 interrupt-map-mask = <0 0 0 0>;
162 interrupt-map = <0 0 0 0 &mpic 99>;
163 marvell,pcie-port = <2>;
164 marvell,pcie-lane = <0>;
165 clocks = <&gateclk 26>;
166 status = "disabled";
167 };
168
169 pcie@10,0 {
170 device_type = "pci";
171 assigned-addresses = <0x82000800 0 0x82000 0 0x2000>;
172 reg = <0x5000 0 0 0 0>;
173 #address-cells = <3>;
174 #size-cells = <2>;
175 #interrupt-cells = <1>;
176 ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0
177 0x81000000 0 0 0x81000000 0xa 0 1 0>;
178 interrupt-map-mask = <0 0 0 0>;
179 interrupt-map = <0 0 0 0 &mpic 103>;
180 marvell,pcie-port = <3>;
181 marvell,pcie-lane = <0>;
182 clocks = <&gateclk 27>;
183 status = "disabled";
184 };
185 };
186
48 internal-regs { 187 internal-regs {
49 pinctrl { 188 pinctrl {
50 compatible = "marvell,mv78260-pinctrl"; 189 compatible = "marvell,mv78260-pinctrl";
@@ -97,128 +236,6 @@
97 clocks = <&gateclk 1>; 236 clocks = <&gateclk 1>;
98 status = "disabled"; 237 status = "disabled";
99 }; 238 };
100
101 /*
102 * MV78260 has 3 PCIe units Gen2.0: Two units can be
103 * configured as x4 or quad x1 lanes. One unit is
104 * x4/x1.
105 */
106 pcie-controller {
107 compatible = "marvell,armada-xp-pcie";
108 status = "disabled";
109 device_type = "pci";
110
111 #address-cells = <3>;
112 #size-cells = <2>;
113
114 bus-range = <0x00 0xff>;
115
116 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
117 0x82000000 0 0x42000 0x42000 0 0x00002000 /* Port 2.0 registers */
118 0x82000000 0 0x44000 0x44000 0 0x00002000 /* Port 0.1 registers */
119 0x82000000 0 0x48000 0x48000 0 0x00002000 /* Port 0.2 registers */
120 0x82000000 0 0x4c000 0x4c000 0 0x00002000 /* Port 0.3 registers */
121 0x82000000 0 0x80000 0x80000 0 0x00002000 /* Port 1.0 registers */
122 0x82000000 0 0x82000 0x82000 0 0x00002000 /* Port 3.0 registers */
123 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
124 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
125
126 pcie@1,0 {
127 device_type = "pci";
128 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
129 reg = <0x0800 0 0 0 0>;
130 #address-cells = <3>;
131 #size-cells = <2>;
132 #interrupt-cells = <1>;
133 ranges;
134 interrupt-map-mask = <0 0 0 0>;
135 interrupt-map = <0 0 0 0 &mpic 58>;
136 marvell,pcie-port = <0>;
137 marvell,pcie-lane = <0>;
138 clocks = <&gateclk 5>;
139 status = "disabled";
140 };
141
142 pcie@2,0 {
143 device_type = "pci";
144 assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
145 reg = <0x1000 0 0 0 0>;
146 #address-cells = <3>;
147 #size-cells = <2>;
148 #interrupt-cells = <1>;
149 ranges;
150 interrupt-map-mask = <0 0 0 0>;
151 interrupt-map = <0 0 0 0 &mpic 59>;
152 marvell,pcie-port = <0>;
153 marvell,pcie-lane = <1>;
154 clocks = <&gateclk 6>;
155 status = "disabled";
156 };
157
158 pcie@3,0 {
159 device_type = "pci";
160 assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
161 reg = <0x1800 0 0 0 0>;
162 #address-cells = <3>;
163 #size-cells = <2>;
164 #interrupt-cells = <1>;
165 ranges;
166 interrupt-map-mask = <0 0 0 0>;
167 interrupt-map = <0 0 0 0 &mpic 60>;
168 marvell,pcie-port = <0>;
169 marvell,pcie-lane = <2>;
170 clocks = <&gateclk 7>;
171 status = "disabled";
172 };
173
174 pcie@4,0 {
175 device_type = "pci";
176 assigned-addresses = <0x82000800 0 0x4c000 0 0x2000>;
177 reg = <0x2000 0 0 0 0>;
178 #address-cells = <3>;
179 #size-cells = <2>;
180 #interrupt-cells = <1>;
181 ranges;
182 interrupt-map-mask = <0 0 0 0>;
183 interrupt-map = <0 0 0 0 &mpic 61>;
184 marvell,pcie-port = <0>;
185 marvell,pcie-lane = <3>;
186 clocks = <&gateclk 8>;
187 status = "disabled";
188 };
189
190 pcie@9,0 {
191 device_type = "pci";
192 assigned-addresses = <0x82000800 0 0x42000 0 0x2000>;
193 reg = <0x4800 0 0 0 0>;
194 #address-cells = <3>;
195 #size-cells = <2>;
196 #interrupt-cells = <1>;
197 ranges;
198 interrupt-map-mask = <0 0 0 0>;
199 interrupt-map = <0 0 0 0 &mpic 99>;
200 marvell,pcie-port = <2>;
201 marvell,pcie-lane = <0>;
202 clocks = <&gateclk 26>;
203 status = "disabled";
204 };
205
206 pcie@10,0 {
207 device_type = "pci";
208 assigned-addresses = <0x82000800 0 0x82000 0 0x2000>;
209 reg = <0x5000 0 0 0 0>;
210 #address-cells = <3>;
211 #size-cells = <2>;
212 #interrupt-cells = <1>;
213 ranges;
214 interrupt-map-mask = <0 0 0 0>;
215 interrupt-map = <0 0 0 0 &mpic 103>;
216 marvell,pcie-port = <3>;
217 marvell,pcie-lane = <0>;
218 clocks = <&gateclk 27>;
219 status = "disabled";
220 };
221 };
222 }; 239 };
223 }; 240 };
224}; 241};
diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
index c7b1f4d5c1c7..a6661e3aea23 100644
--- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
@@ -13,7 +13,7 @@
13 * common to all Armada XP SoCs. 13 * common to all Armada XP SoCs.
14 */ 14 */
15 15
16/include/ "armada-xp.dtsi" 16#include "armada-xp.dtsi"
17 17
18/ { 18/ {
19 model = "Marvell Armada XP MV78460 SoC"; 19 model = "Marvell Armada XP MV78460 SoC";
@@ -61,6 +61,227 @@
61 }; 61 };
62 62
63 soc { 63 soc {
64 /*
65 * MV78460 has 4 PCIe units Gen2.0: Two units can be
66 * configured as x4 or quad x1 lanes. Two units are
67 * x4/x1.
68 */
69 pcie-controller {
70 compatible = "marvell,armada-xp-pcie";
71 status = "disabled";
72 device_type = "pci";
73
74 #address-cells = <3>;
75 #size-cells = <2>;
76
77 bus-range = <0x00 0xff>;
78
79 ranges =
80 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000 /* Port 0.0 registers */
81 0x82000000 0 0x42000 MBUS_ID(0xf0, 0x01) 0x42000 0 0x00002000 /* Port 2.0 registers */
82 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000 /* Port 0.1 registers */
83 0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000 /* Port 0.2 registers */
84 0x82000000 0 0x4c000 MBUS_ID(0xf0, 0x01) 0x4c000 0 0x00002000 /* Port 0.3 registers */
85 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000 /* Port 1.0 registers */
86 0x82000000 0 0x82000 MBUS_ID(0xf0, 0x01) 0x82000 0 0x00002000 /* Port 3.0 registers */
87 0x82000000 0 0x84000 MBUS_ID(0xf0, 0x01) 0x84000 0 0x00002000 /* Port 1.1 registers */
88 0x82000000 0 0x88000 MBUS_ID(0xf0, 0x01) 0x88000 0 0x00002000 /* Port 1.2 registers */
89 0x82000000 0 0x8c000 MBUS_ID(0xf0, 0x01) 0x8c000 0 0x00002000 /* Port 1.3 registers */
90 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
91 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
92 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 0.1 MEM */
93 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 0.1 IO */
94 0x82000000 0x3 0 MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 0.2 MEM */
95 0x81000000 0x3 0 MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 0.2 IO */
96 0x82000000 0x4 0 MBUS_ID(0x04, 0x78) 0 1 0 /* Port 0.3 MEM */
97 0x81000000 0x4 0 MBUS_ID(0x04, 0x70) 0 1 0 /* Port 0.3 IO */
98
99 0x82000000 0x5 0 MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 1.0 MEM */
100 0x81000000 0x5 0 MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 1.0 IO */
101 0x82000000 0x6 0 MBUS_ID(0x08, 0xd8) 0 1 0 /* Port 1.1 MEM */
102 0x81000000 0x6 0 MBUS_ID(0x08, 0xd0) 0 1 0 /* Port 1.1 IO */
103 0x82000000 0x7 0 MBUS_ID(0x08, 0xb8) 0 1 0 /* Port 1.2 MEM */
104 0x81000000 0x7 0 MBUS_ID(0x08, 0xb0) 0 1 0 /* Port 1.2 IO */
105 0x82000000 0x8 0 MBUS_ID(0x08, 0x78) 0 1 0 /* Port 1.3 MEM */
106 0x81000000 0x8 0 MBUS_ID(0x08, 0x70) 0 1 0 /* Port 1.3 IO */
107
108 0x82000000 0x9 0 MBUS_ID(0x04, 0xf8) 0 1 0 /* Port 2.0 MEM */
109 0x81000000 0x9 0 MBUS_ID(0x04, 0xf0) 0 1 0 /* Port 2.0 IO */
110
111 0x82000000 0xa 0 MBUS_ID(0x08, 0xf8) 0 1 0 /* Port 3.0 MEM */
112 0x81000000 0xa 0 MBUS_ID(0x08, 0xf0) 0 1 0 /* Port 3.0 IO */>;
113
114 pcie@1,0 {
115 device_type = "pci";
116 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
117 reg = <0x0800 0 0 0 0>;
118 #address-cells = <3>;
119 #size-cells = <2>;
120 #interrupt-cells = <1>;
121 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
122 0x81000000 0 0 0x81000000 0x1 0 1 0>;
123 interrupt-map-mask = <0 0 0 0>;
124 interrupt-map = <0 0 0 0 &mpic 58>;
125 marvell,pcie-port = <0>;
126 marvell,pcie-lane = <0>;
127 clocks = <&gateclk 5>;
128 status = "disabled";
129 };
130
131 pcie@2,0 {
132 device_type = "pci";
133 assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
134 reg = <0x1000 0 0 0 0>;
135 #address-cells = <3>;
136 #size-cells = <2>;
137 #interrupt-cells = <1>;
138 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
139 0x81000000 0 0 0x81000000 0x2 0 1 0>;
140 interrupt-map-mask = <0 0 0 0>;
141 interrupt-map = <0 0 0 0 &mpic 59>;
142 marvell,pcie-port = <0>;
143 marvell,pcie-lane = <1>;
144 clocks = <&gateclk 6>;
145 status = "disabled";
146 };
147
148 pcie@3,0 {
149 device_type = "pci";
150 assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
151 reg = <0x1800 0 0 0 0>;
152 #address-cells = <3>;
153 #size-cells = <2>;
154 #interrupt-cells = <1>;
155 ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
156 0x81000000 0 0 0x81000000 0x3 0 1 0>;
157 interrupt-map-mask = <0 0 0 0>;
158 interrupt-map = <0 0 0 0 &mpic 60>;
159 marvell,pcie-port = <0>;
160 marvell,pcie-lane = <2>;
161 clocks = <&gateclk 7>;
162 status = "disabled";
163 };
164
165 pcie@4,0 {
166 device_type = "pci";
167 assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
168 reg = <0x2000 0 0 0 0>;
169 #address-cells = <3>;
170 #size-cells = <2>;
171 #interrupt-cells = <1>;
172 ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
173 0x81000000 0 0 0x81000000 0x4 0 1 0>;
174 interrupt-map-mask = <0 0 0 0>;
175 interrupt-map = <0 0 0 0 &mpic 61>;
176 marvell,pcie-port = <0>;
177 marvell,pcie-lane = <3>;
178 clocks = <&gateclk 8>;
179 status = "disabled";
180 };
181
182 pcie@5,0 {
183 device_type = "pci";
184 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
185 reg = <0x2800 0 0 0 0>;
186 #address-cells = <3>;
187 #size-cells = <2>;
188 #interrupt-cells = <1>;
189 ranges = <0x82000000 0 0 0x82000000 0x5 0 1 0
190 0x81000000 0 0 0x81000000 0x5 0 1 0>;
191 interrupt-map-mask = <0 0 0 0>;
192 interrupt-map = <0 0 0 0 &mpic 62>;
193 marvell,pcie-port = <1>;
194 marvell,pcie-lane = <0>;
195 clocks = <&gateclk 9>;
196 status = "disabled";
197 };
198
199 pcie@6,0 {
200 device_type = "pci";
201 assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
202 reg = <0x3000 0 0 0 0>;
203 #address-cells = <3>;
204 #size-cells = <2>;
205 #interrupt-cells = <1>;
206 ranges = <0x82000000 0 0 0x82000000 0x6 0 1 0
207 0x81000000 0 0 0x81000000 0x6 0 1 0>;
208 interrupt-map-mask = <0 0 0 0>;
209 interrupt-map = <0 0 0 0 &mpic 63>;
210 marvell,pcie-port = <1>;
211 marvell,pcie-lane = <1>;
212 clocks = <&gateclk 10>;
213 status = "disabled";
214 };
215
216 pcie@7,0 {
217 device_type = "pci";
218 assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
219 reg = <0x3800 0 0 0 0>;
220 #address-cells = <3>;
221 #size-cells = <2>;
222 #interrupt-cells = <1>;
223 ranges = <0x82000000 0 0 0x82000000 0x7 0 1 0
224 0x81000000 0 0 0x81000000 0x7 0 1 0>;
225 interrupt-map-mask = <0 0 0 0>;
226 interrupt-map = <0 0 0 0 &mpic 64>;
227 marvell,pcie-port = <1>;
228 marvell,pcie-lane = <2>;
229 clocks = <&gateclk 11>;
230 status = "disabled";
231 };
232
233 pcie@8,0 {
234 device_type = "pci";
235 assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
236 reg = <0x4000 0 0 0 0>;
237 #address-cells = <3>;
238 #size-cells = <2>;
239 #interrupt-cells = <1>;
240 ranges = <0x82000000 0 0 0x82000000 0x8 0 1 0
241 0x81000000 0 0 0x81000000 0x8 0 1 0>;
242 interrupt-map-mask = <0 0 0 0>;
243 interrupt-map = <0 0 0 0 &mpic 65>;
244 marvell,pcie-port = <1>;
245 marvell,pcie-lane = <3>;
246 clocks = <&gateclk 12>;
247 status = "disabled";
248 };
249
250 pcie@9,0 {
251 device_type = "pci";
252 assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
253 reg = <0x4800 0 0 0 0>;
254 #address-cells = <3>;
255 #size-cells = <2>;
256 #interrupt-cells = <1>;
257 ranges = <0x82000000 0 0 0x82000000 0x9 0 1 0
258 0x81000000 0 0 0x81000000 0x9 0 1 0>;
259 interrupt-map-mask = <0 0 0 0>;
260 interrupt-map = <0 0 0 0 &mpic 99>;
261 marvell,pcie-port = <2>;
262 marvell,pcie-lane = <0>;
263 clocks = <&gateclk 26>;
264 status = "disabled";
265 };
266
267 pcie@10,0 {
268 device_type = "pci";
269 assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
270 reg = <0x5000 0 0 0 0>;
271 #address-cells = <3>;
272 #size-cells = <2>;
273 #interrupt-cells = <1>;
274 ranges = <0x82000000 0 0 0x82000000 0xa 0 1 0
275 0x81000000 0 0 0x81000000 0xa 0 1 0>;
276 interrupt-map-mask = <0 0 0 0>;
277 interrupt-map = <0 0 0 0 &mpic 103>;
278 marvell,pcie-port = <3>;
279 marvell,pcie-lane = <0>;
280 clocks = <&gateclk 27>;
281 status = "disabled";
282 };
283 };
284
64 internal-regs { 285 internal-regs {
65 pinctrl { 286 pinctrl {
66 compatible = "marvell,mv78460-pinctrl"; 287 compatible = "marvell,mv78460-pinctrl";
@@ -113,194 +334,6 @@
113 clocks = <&gateclk 1>; 334 clocks = <&gateclk 1>;
114 status = "disabled"; 335 status = "disabled";
115 }; 336 };
116
117 /*
118 * MV78460 has 4 PCIe units Gen2.0: Two units can be
119 * configured as x4 or quad x1 lanes. Two units are
120 * x4/x1.
121 */
122 pcie-controller {
123 compatible = "marvell,armada-xp-pcie";
124 status = "disabled";
125 device_type = "pci";
126
127 #address-cells = <3>;
128 #size-cells = <2>;
129
130 bus-range = <0x00 0xff>;
131
132 ranges = <0x82000000 0 0x40000 0x40000 0 0x00002000 /* Port 0.0 registers */
133 0x82000000 0 0x42000 0x42000 0 0x00002000 /* Port 2.0 registers */
134 0x82000000 0 0x44000 0x44000 0 0x00002000 /* Port 0.1 registers */
135 0x82000000 0 0x48000 0x48000 0 0x00002000 /* Port 0.2 registers */
136 0x82000000 0 0x4c000 0x4c000 0 0x00002000 /* Port 0.3 registers */
137 0x82000000 0 0x80000 0x80000 0 0x00002000 /* Port 1.0 registers */
138 0x82000000 0 0x82000 0x82000 0 0x00002000 /* Port 3.0 registers */
139 0x82000000 0 0x84000 0x84000 0 0x00002000 /* Port 1.1 registers */
140 0x82000000 0 0x88000 0x88000 0 0x00002000 /* Port 1.2 registers */
141 0x82000000 0 0x8c000 0x8c000 0 0x00002000 /* Port 1.3 registers */
142 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
143 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
144
145 pcie@1,0 {
146 device_type = "pci";
147 assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
148 reg = <0x0800 0 0 0 0>;
149 #address-cells = <3>;
150 #size-cells = <2>;
151 #interrupt-cells = <1>;
152 ranges;
153 interrupt-map-mask = <0 0 0 0>;
154 interrupt-map = <0 0 0 0 &mpic 58>;
155 marvell,pcie-port = <0>;
156 marvell,pcie-lane = <0>;
157 clocks = <&gateclk 5>;
158 status = "disabled";
159 };
160
161 pcie@2,0 {
162 device_type = "pci";
163 assigned-addresses = <0x82001000 0 0x44000 0 0x2000>;
164 reg = <0x1000 0 0 0 0>;
165 #address-cells = <3>;
166 #size-cells = <2>;
167 #interrupt-cells = <1>;
168 ranges;
169 interrupt-map-mask = <0 0 0 0>;
170 interrupt-map = <0 0 0 0 &mpic 59>;
171 marvell,pcie-port = <0>;
172 marvell,pcie-lane = <1>;
173 clocks = <&gateclk 6>;
174 status = "disabled";
175 };
176
177 pcie@3,0 {
178 device_type = "pci";
179 assigned-addresses = <0x82001800 0 0x48000 0 0x2000>;
180 reg = <0x1800 0 0 0 0>;
181 #address-cells = <3>;
182 #size-cells = <2>;
183 #interrupt-cells = <1>;
184 ranges;
185 interrupt-map-mask = <0 0 0 0>;
186 interrupt-map = <0 0 0 0 &mpic 60>;
187 marvell,pcie-port = <0>;
188 marvell,pcie-lane = <2>;
189 clocks = <&gateclk 7>;
190 status = "disabled";
191 };
192
193 pcie@4,0 {
194 device_type = "pci";
195 assigned-addresses = <0x82002000 0 0x4c000 0 0x2000>;
196 reg = <0x2000 0 0 0 0>;
197 #address-cells = <3>;
198 #size-cells = <2>;
199 #interrupt-cells = <1>;
200 ranges;
201 interrupt-map-mask = <0 0 0 0>;
202 interrupt-map = <0 0 0 0 &mpic 61>;
203 marvell,pcie-port = <0>;
204 marvell,pcie-lane = <3>;
205 clocks = <&gateclk 8>;
206 status = "disabled";
207 };
208
209 pcie@5,0 {
210 device_type = "pci";
211 assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
212 reg = <0x2800 0 0 0 0>;
213 #address-cells = <3>;
214 #size-cells = <2>;
215 #interrupt-cells = <1>;
216 ranges;
217 interrupt-map-mask = <0 0 0 0>;
218 interrupt-map = <0 0 0 0 &mpic 62>;
219 marvell,pcie-port = <1>;
220 marvell,pcie-lane = <0>;
221 clocks = <&gateclk 9>;
222 status = "disabled";
223 };
224
225 pcie@6,0 {
226 device_type = "pci";
227 assigned-addresses = <0x82003000 0 0x84000 0 0x2000>;
228 reg = <0x3000 0 0 0 0>;
229 #address-cells = <3>;
230 #size-cells = <2>;
231 #interrupt-cells = <1>;
232 ranges;
233 interrupt-map-mask = <0 0 0 0>;
234 interrupt-map = <0 0 0 0 &mpic 63>;
235 marvell,pcie-port = <1>;
236 marvell,pcie-lane = <1>;
237 clocks = <&gateclk 10>;
238 status = "disabled";
239 };
240
241 pcie@7,0 {
242 device_type = "pci";
243 assigned-addresses = <0x82003800 0 0x88000 0 0x2000>;
244 reg = <0x3800 0 0 0 0>;
245 #address-cells = <3>;
246 #size-cells = <2>;
247 #interrupt-cells = <1>;
248 ranges;
249 interrupt-map-mask = <0 0 0 0>;
250 interrupt-map = <0 0 0 0 &mpic 64>;
251 marvell,pcie-port = <1>;
252 marvell,pcie-lane = <2>;
253 clocks = <&gateclk 11>;
254 status = "disabled";
255 };
256
257 pcie@8,0 {
258 device_type = "pci";
259 assigned-addresses = <0x82004000 0 0x8c000 0 0x2000>;
260 reg = <0x4000 0 0 0 0>;
261 #address-cells = <3>;
262 #size-cells = <2>;
263 #interrupt-cells = <1>;
264 ranges;
265 interrupt-map-mask = <0 0 0 0>;
266 interrupt-map = <0 0 0 0 &mpic 65>;
267 marvell,pcie-port = <1>;
268 marvell,pcie-lane = <3>;
269 clocks = <&gateclk 12>;
270 status = "disabled";
271 };
272 pcie@9,0 {
273 device_type = "pci";
274 assigned-addresses = <0x82004800 0 0x42000 0 0x2000>;
275 reg = <0x4800 0 0 0 0>;
276 #address-cells = <3>;
277 #size-cells = <2>;
278 #interrupt-cells = <1>;
279 ranges;
280 interrupt-map-mask = <0 0 0 0>;
281 interrupt-map = <0 0 0 0 &mpic 99>;
282 marvell,pcie-port = <2>;
283 marvell,pcie-lane = <0>;
284 clocks = <&gateclk 26>;
285 status = "disabled";
286 };
287
288 pcie@10,0 {
289 device_type = "pci";
290 assigned-addresses = <0x82005000 0 0x82000 0 0x2000>;
291 reg = <0x5000 0 0 0 0>;
292 #address-cells = <3>;
293 #size-cells = <2>;
294 #interrupt-cells = <1>;
295 ranges;
296 interrupt-map-mask = <0 0 0 0>;
297 interrupt-map = <0 0 0 0 &mpic 103>;
298 marvell,pcie-port = <3>;
299 marvell,pcie-lane = <0>;
300 clocks = <&gateclk 27>;
301 status = "disabled";
302 };
303 };
304 }; 337 };
305 }; 338 };
306}; 339};
diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
index 8f510458ea86..5695afcc04bf 100644
--- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
+++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
@@ -11,7 +11,7 @@
11 */ 11 */
12 12
13/dts-v1/; 13/dts-v1/;
14/include/ "armada-xp-mv78260.dtsi" 14#include "armada-xp-mv78260.dtsi"
15 15
16/ { 16/ {
17 model = "PlatHome OpenBlocks AX3-4 board"; 17 model = "PlatHome OpenBlocks AX3-4 board";
@@ -27,9 +27,46 @@
27 }; 27 };
28 28
29 soc { 29 soc {
30 ranges = <0 0 0xd0000000 0x100000 /* Internal registers 1MiB */ 30 ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000
31 0xe0000000 0 0xe0000000 0x8100000 /* PCIe */ 31 MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000
32 0xf0000000 0 0xf0000000 0x8000000 /* Device Bus, NOR 128MiB */>; 32 MBUS_ID(0x01, 0x2f) 0 0 0xf0000000 0x8000000>;
33
34 devbus-bootcs {
35 status = "okay";
36
37 /* Device Bus parameters are required */
38
39 /* Read parameters */
40 devbus,bus-width = <8>;
41 devbus,turn-off-ps = <60000>;
42 devbus,badr-skew-ps = <0>;
43 devbus,acc-first-ps = <124000>;
44 devbus,acc-next-ps = <248000>;
45 devbus,rd-setup-ps = <0>;
46 devbus,rd-hold-ps = <0>;
47
48 /* Write parameters */
49 devbus,sync-enable = <0>;
50 devbus,wr-high-ps = <60000>;
51 devbus,wr-low-ps = <60000>;
52 devbus,ale-wr-ps = <60000>;
53
54 /* NOR 128 MiB */
55 nor@0 {
56 compatible = "cfi-flash";
57 reg = <0 0x8000000>;
58 bank-width = <2>;
59 };
60 };
61
62 pcie-controller {
63 status = "okay";
64 /* Internal mini-PCIe connector */
65 pcie@1,0 {
66 /* Port 0, Lane 0 */
67 status = "okay";
68 };
69 };
33 70
34 internal-regs { 71 internal-regs {
35 serial@12000 { 72 serial@12000 {
@@ -148,49 +185,6 @@
148 usb@51000 { 185 usb@51000 {
149 status = "okay"; 186 status = "okay";
150 }; 187 };
151
152 /* USB interface in the mini-PCIe connector */
153 usb@52000 {
154 status = "okay";
155 };
156
157 devbus-bootcs@10400 {
158 status = "okay";
159 ranges = <0 0xf0000000 0x8000000>; /* @addr 0xf000000, size 0x8000000 */
160
161 /* Device Bus parameters are required */
162
163 /* Read parameters */
164 devbus,bus-width = <8>;
165 devbus,turn-off-ps = <60000>;
166 devbus,badr-skew-ps = <0>;
167 devbus,acc-first-ps = <124000>;
168 devbus,acc-next-ps = <248000>;
169 devbus,rd-setup-ps = <0>;
170 devbus,rd-hold-ps = <0>;
171
172 /* Write parameters */
173 devbus,sync-enable = <0>;
174 devbus,wr-high-ps = <60000>;
175 devbus,wr-low-ps = <60000>;
176 devbus,ale-wr-ps = <60000>;
177
178 /* NOR 128 MiB */
179 nor@0 {
180 compatible = "cfi-flash";
181 reg = <0 0x8000000>;
182 bank-width = <2>;
183 };
184 };
185
186 pcie-controller {
187 status = "okay";
188 /* Internal mini-PCIe connector */
189 pcie@1,0 {
190 /* Port 0, Lane 0 */
191 status = "okay";
192 };
193 };
194 }; 188 };
195 }; 189 };
196}; 190};
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi
index 416eb9481844..7ba99ce107bb 100644
--- a/arch/arm/boot/dts/armada-xp.dtsi
+++ b/arch/arm/boot/dts/armada-xp.dtsi
@@ -16,7 +16,7 @@
16 * common to all Armada SoCs. 16 * common to all Armada SoCs.
17 */ 17 */
18 18
19/include/ "armada-370-xp.dtsi" 19#include "armada-370-xp.dtsi"
20 20
21/ { 21/ {
22 model = "Marvell Armada XP family SoC"; 22 model = "Marvell Armada XP family SoC";
@@ -27,6 +27,13 @@
27 }; 27 };
28 28
29 soc { 29 soc {
30 compatible = "marvell,armadaxp-mbus", "simple-bus";
31
32 bootrom {
33 compatible = "marvell,bootrom";
34 reg = <MBUS_ID(0x01, 0x1d) 0 0x100000>;
35 };
36
30 internal-regs { 37 internal-regs {
31 L2: l2-cache { 38 L2: l2-cache {
32 compatible = "marvell,aurora-system-cache"; 39 compatible = "marvell,aurora-system-cache";
diff --git a/arch/arm/boot/dts/kirkwood-6281.dtsi b/arch/arm/boot/dts/kirkwood-6281.dtsi
index 1e5bef0bead7..650ef30e1856 100644
--- a/arch/arm/boot/dts/kirkwood-6281.dtsi
+++ b/arch/arm/boot/dts/kirkwood-6281.dtsi
@@ -1,4 +1,39 @@
1/ { 1/ {
2 mbus {
3 pcie-controller {
4 compatible = "marvell,kirkwood-pcie";
5 status = "disabled";
6 device_type = "pci";
7
8 #address-cells = <3>;
9 #size-cells = <2>;
10
11 bus-range = <0x00 0xff>;
12
13 ranges =
14 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
15 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
16 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */>;
17
18 pcie@1,0 {
19 device_type = "pci";
20 assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
21 reg = <0x0800 0 0 0 0>;
22 #address-cells = <3>;
23 #size-cells = <2>;
24 #interrupt-cells = <1>;
25 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
26 0x81000000 0 0 0x81000000 0x1 0 1 0>;
27 interrupt-map-mask = <0 0 0 0>;
28 interrupt-map = <0 0 0 0 &intc 9>;
29 marvell,pcie-port = <0>;
30 marvell,pcie-lane = <0>;
31 clocks = <&gate_clk 2>;
32 status = "disabled";
33 };
34 };
35 };
36
2 ocp@f1000000 { 37 ocp@f1000000 {
3 pinctrl: pinctrl@10000 { 38 pinctrl: pinctrl@10000 {
4 compatible = "marvell,88f6281-pinctrl"; 39 compatible = "marvell,88f6281-pinctrl";
@@ -41,37 +76,6 @@
41 }; 76 };
42 }; 77 };
43 78
44 pcie-controller {
45 compatible = "marvell,kirkwood-pcie";
46 status = "disabled";
47 device_type = "pci";
48
49 #address-cells = <3>;
50 #size-cells = <2>;
51
52 bus-range = <0x00 0xff>;
53
54 ranges = <0x82000000 0 0x00040000 0x00040000 0 0x00002000 /* Port 0.0 registers */
55 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
56 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
57
58 pcie@1,0 {
59 device_type = "pci";
60 assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
61 reg = <0x0800 0 0 0 0>;
62 #address-cells = <3>;
63 #size-cells = <2>;
64 #interrupt-cells = <1>;
65 ranges;
66 interrupt-map-mask = <0 0 0 0>;
67 interrupt-map = <0 0 0 0 &intc 9>;
68 marvell,pcie-port = <0>;
69 marvell,pcie-lane = <0>;
70 clocks = <&gate_clk 2>;
71 status = "disabled";
72 };
73 };
74
75 rtc@10300 { 79 rtc@10300 {
76 compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc"; 80 compatible = "marvell,kirkwood-rtc", "marvell,orion-rtc";
77 reg = <0x10300 0x20>; 81 reg = <0x10300 0x20>;
diff --git a/arch/arm/boot/dts/kirkwood-6282.dtsi b/arch/arm/boot/dts/kirkwood-6282.dtsi
index a63a11137262..3933a331ddc2 100644
--- a/arch/arm/boot/dts/kirkwood-6282.dtsi
+++ b/arch/arm/boot/dts/kirkwood-6282.dtsi
@@ -1,4 +1,59 @@
1/ { 1/ {
2 mbus {
3 pcie-controller {
4 compatible = "marvell,kirkwood-pcie";
5 status = "disabled";
6 device_type = "pci";
7
8 #address-cells = <3>;
9 #size-cells = <2>;
10
11 bus-range = <0x00 0xff>;
12
13 ranges =
14 <0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
15 0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000
16 0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
17 0x82000000 0x1 0 MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 0.0 MEM */
18 0x81000000 0x1 0 MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 0.0 IO */
19 0x82000000 0x2 0 MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 1.0 MEM */
20 0x81000000 0x2 0 MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 1.0 IO */>;
21
22 pcie@1,0 {
23 device_type = "pci";
24 assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
25 reg = <0x0800 0 0 0 0>;
26 #address-cells = <3>;
27 #size-cells = <2>;
28 #interrupt-cells = <1>;
29 ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
30 0x81000000 0 0 0x81000000 0x1 0 1 0>;
31 interrupt-map-mask = <0 0 0 0>;
32 interrupt-map = <0 0 0 0 &intc 9>;
33 marvell,pcie-port = <0>;
34 marvell,pcie-lane = <0>;
35 clocks = <&gate_clk 2>;
36 status = "disabled";
37 };
38
39 pcie@2,0 {
40 device_type = "pci";
41 assigned-addresses = <0x82001000 0 0x00044000 0 0x2000>;
42 reg = <0x1000 0 0 0 0>;
43 #address-cells = <3>;
44 #size-cells = <2>;
45 #interrupt-cells = <1>;
46 ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
47 0x81000000 0 0 0x81000000 0x2 0 1 0>;
48 interrupt-map-mask = <0 0 0 0>;
49 interrupt-map = <0 0 0 0 &intc 10>;
50 marvell,pcie-port = <1>;
51 marvell,pcie-lane = <0>;
52 clocks = <&gate_clk 18>;
53 status = "disabled";
54 };
55 };
56 };
2 ocp@f1000000 { 57 ocp@f1000000 {
3 58
4 pinctrl: pinctrl@10000 { 59 pinctrl: pinctrl@10000 {
@@ -94,52 +149,5 @@
94 status = "disabled"; 149 status = "disabled";
95 }; 150 };
96 151
97 pcie-controller {
98 compatible = "marvell,kirkwood-pcie";
99 status = "disabled";
100 device_type = "pci";
101
102 #address-cells = <3>;
103 #size-cells = <2>;
104
105 bus-range = <0x00 0xff>;
106
107 ranges = <0x82000000 0 0x00040000 0x00040000 0 0x00002000 /* Port 0.0 registers */
108 0x82000000 0 0x00044000 0x00044000 0 0x00002000 /* Port 1.0 registers */
109 0x82000000 0 0xe0000000 0xe0000000 0 0x08000000 /* non-prefetchable memory */
110 0x81000000 0 0 0xe8000000 0 0x00100000>; /* downstream I/O */
111
112 pcie@1,0 {
113 device_type = "pci";
114 assigned-addresses = <0x82000800 0 0x00040000 0 0x2000>;
115 reg = <0x0800 0 0 0 0>;
116 #address-cells = <3>;
117 #size-cells = <2>;
118 #interrupt-cells = <1>;
119 ranges;
120 interrupt-map-mask = <0 0 0 0>;
121 interrupt-map = <0 0 0 0 &intc 9>;
122 marvell,pcie-port = <0>;
123 marvell,pcie-lane = <0>;
124 clocks = <&gate_clk 2>;
125 status = "disabled";
126 };
127
128 pcie@2,0 {
129 device_type = "pci";
130 assigned-addresses = <0x82001000 0 0x00044000 0 0x2000>;
131 reg = <0x1000 0 0 0 0>;
132 #address-cells = <3>;
133 #size-cells = <2>;
134 #interrupt-cells = <1>;
135 ranges;
136 interrupt-map-mask = <0 0 0 0>;
137 interrupt-map = <0 0 0 0 &intc 10>;
138 marvell,pcie-port = <1>;
139 marvell,pcie-lane = <0>;
140 clocks = <&gate_clk 18>;
141 status = "disabled";
142 };
143 };
144 }; 152 };
145}; 153};
diff --git a/arch/arm/boot/dts/kirkwood-cloudbox.dts b/arch/arm/boot/dts/kirkwood-cloudbox.dts
index 00c48d26de68..9bf139c5a34d 100644
--- a/arch/arm/boot/dts/kirkwood-cloudbox.dts
+++ b/arch/arm/boot/dts/kirkwood-cloudbox.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "LaCie CloudBox"; 7 model = "LaCie CloudBox";
diff --git a/arch/arm/boot/dts/kirkwood-db-88f6281.dts b/arch/arm/boot/dts/kirkwood-db-88f6281.dts
index 9d777edd1f36..72c4b0a0366f 100644
--- a/arch/arm/boot/dts/kirkwood-db-88f6281.dts
+++ b/arch/arm/boot/dts/kirkwood-db-88f6281.dts
@@ -11,14 +11,15 @@
11 11
12/dts-v1/; 12/dts-v1/;
13 13
14/include/ "kirkwood-db.dtsi" 14#include "kirkwood-db.dtsi"
15/include/ "kirkwood-6281.dtsi" 15#include "kirkwood-6281.dtsi"
16 16
17/ { 17/ {
18 model = "Marvell DB-88F6281-BP Development Board"; 18 model = "Marvell DB-88F6281-BP Development Board";
19 compatible = "marvell,db-88f6281-bp", "marvell,kirkwood-88f6281", "marvell,kirkwood"; 19 compatible = "marvell,db-88f6281-bp", "marvell,kirkwood-88f6281", "marvell,kirkwood";
20 20
21 ocp@f1000000 { 21 mbus {
22 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
22 pcie-controller { 23 pcie-controller {
23 status = "okay"; 24 status = "okay";
24 25
diff --git a/arch/arm/boot/dts/kirkwood-db-88f6282.dts b/arch/arm/boot/dts/kirkwood-db-88f6282.dts
index f4c852886d23..36c411d34926 100644
--- a/arch/arm/boot/dts/kirkwood-db-88f6282.dts
+++ b/arch/arm/boot/dts/kirkwood-db-88f6282.dts
@@ -11,14 +11,15 @@
11 11
12/dts-v1/; 12/dts-v1/;
13 13
14/include/ "kirkwood-db.dtsi" 14#include "kirkwood-db.dtsi"
15/include/ "kirkwood-6282.dtsi" 15#include "kirkwood-6282.dtsi"
16 16
17/ { 17/ {
18 model = "Marvell DB-88F6282-BP Development Board"; 18 model = "Marvell DB-88F6282-BP Development Board";
19 compatible = "marvell,db-88f6282-bp", "marvell,kirkwood-88f6282", "marvell,kirkwood"; 19 compatible = "marvell,db-88f6282-bp", "marvell,kirkwood-88f6282", "marvell,kirkwood";
20 20
21 ocp@f1000000 { 21 mbus {
22 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
22 pcie-controller { 23 pcie-controller {
23 status = "okay"; 24 status = "okay";
24 25
diff --git a/arch/arm/boot/dts/kirkwood-db.dtsi b/arch/arm/boot/dts/kirkwood-db.dtsi
index c87cfb816120..45c1bf74ac00 100644
--- a/arch/arm/boot/dts/kirkwood-db.dtsi
+++ b/arch/arm/boot/dts/kirkwood-db.dtsi
@@ -12,7 +12,7 @@
12 * and 6282 variants of the Marvell Kirkwood Development Board. 12 * and 6282 variants of the Marvell Kirkwood Development Board.
13 */ 13 */
14 14
15/include/ "kirkwood.dtsi" 15#include "kirkwood.dtsi"
16 16
17/ { 17/ {
18 memory { 18 memory {
@@ -77,13 +77,5 @@
77 cd-gpios = <&gpio1 6 0>; 77 cd-gpios = <&gpio1 6 0>;
78 status = "okay"; 78 status = "okay";
79 }; 79 };
80
81 pcie-controller {
82 status = "okay";
83
84 pcie@1,0 {
85 status = "okay";
86 };
87 };
88 }; 80 };
89}; 81};
diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
index 14d4ceea3057..e112ca62d978 100644
--- a/arch/arm/boot/dts/kirkwood-dns320.dts
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-dnskw.dtsi" 3#include "kirkwood-dnskw.dtsi"
4 4
5/ { 5/ {
6 model = "D-Link DNS-320 NAS (Rev A1)"; 6 model = "D-Link DNS-320 NAS (Rev A1)";
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
index 63872570e6ce..5119fb8a8eb6 100644
--- a/arch/arm/boot/dts/kirkwood-dns325.dts
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-dnskw.dtsi" 3#include "kirkwood-dnskw.dtsi"
4 4
5/ { 5/ {
6 model = "D-Link DNS-325 NAS (Rev A1)"; 6 model = "D-Link DNS-325 NAS (Rev A1)";
diff --git a/arch/arm/boot/dts/kirkwood-dnskw.dtsi b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
index 0afe1d07c803..2e04284846a0 100644
--- a/arch/arm/boot/dts/kirkwood-dnskw.dtsi
+++ b/arch/arm/boot/dts/kirkwood-dnskw.dtsi
@@ -1,5 +1,5 @@
1/include/ "kirkwood.dtsi" 1#include "kirkwood.dtsi"
2/include/ "kirkwood-6281.dtsi" 2#include "kirkwood-6281.dtsi"
3 3
4/ { 4/ {
5 model = "D-Link DNS NASes (kirkwood-based)"; 5 model = "D-Link DNS NASes (kirkwood-based)";
diff --git a/arch/arm/boot/dts/kirkwood-dockstar.dts b/arch/arm/boot/dts/kirkwood-dockstar.dts
index 7714742bb8d8..4387ae8e93fe 100644
--- a/arch/arm/boot/dts/kirkwood-dockstar.dts
+++ b/arch/arm/boot/dts/kirkwood-dockstar.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "Seagate FreeAgent Dockstar"; 7 model = "Seagate FreeAgent Dockstar";
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts
index 36c7ba38d500..c62837837246 100644
--- a/arch/arm/boot/dts/kirkwood-dreamplug.dts
+++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "Globalscale Technologies Dreamplug"; 7 model = "Globalscale Technologies Dreamplug";
diff --git a/arch/arm/boot/dts/kirkwood-goflexnet.dts b/arch/arm/boot/dts/kirkwood-goflexnet.dts
index 31caa6405065..e57118039277 100644
--- a/arch/arm/boot/dts/kirkwood-goflexnet.dts
+++ b/arch/arm/boot/dts/kirkwood-goflexnet.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "Seagate GoFlex Net"; 7 model = "Seagate GoFlex Net";
diff --git a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
index 1e642f39b154..2c5673adb4bd 100644
--- a/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
+++ b/arch/arm/boot/dts/kirkwood-guruplug-server-plus.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "Globalscale Technologies Guruplug Server Plus"; 7 model = "Globalscale Technologies Guruplug Server Plus";
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
index 20c4b081f420..158161ff6826 100644
--- a/arch/arm/boot/dts/kirkwood-ib62x0.dts
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; 7 model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)";
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
index 441204e8abc6..8314118b6b8a 100644
--- a/arch/arm/boot/dts/kirkwood-iconnect.dts
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "Iomega Iconnect"; 7 model = "Iomega Iconnect";
@@ -18,6 +18,17 @@
18 linux,initrd-end = <0x4800000>; 18 linux,initrd-end = <0x4800000>;
19 }; 19 };
20 20
21 mbus {
22 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
23 pcie-controller {
24 status = "okay";
25
26 pcie@1,0 {
27 status = "okay";
28 };
29 };
30 };
31
21 ocp@f1000000 { 32 ocp@f1000000 {
22 pinctrl: pinctrl@10000 { 33 pinctrl: pinctrl@10000 {
23 pmx_button_reset: pmx-button-reset { 34 pmx_button_reset: pmx-button-reset {
@@ -101,14 +112,6 @@
101 reg = <0x980000 0x1f400000>; 112 reg = <0x980000 0x1f400000>;
102 }; 113 };
103 }; 114 };
104
105 pcie-controller {
106 status = "okay";
107
108 pcie@1,0 {
109 status = "okay";
110 };
111 };
112 }; 115 };
113 116
114 gpio-leds { 117 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
index 00a7bfe5e83b..fd7f053e9c96 100644
--- a/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
+++ b/arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "Iomega StorCenter ix2-200"; 7 model = "Iomega StorCenter ix2-200";
diff --git a/arch/arm/boot/dts/kirkwood-is2.dts b/arch/arm/boot/dts/kirkwood-is2.dts
index c3f036b86cca..bd88a236f729 100644
--- a/arch/arm/boot/dts/kirkwood-is2.dts
+++ b/arch/arm/boot/dts/kirkwood-is2.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-ns2-common.dtsi" 3#include "kirkwood-ns2-common.dtsi"
4 4
5/ { 5/ {
6 model = "LaCie Internet Space v2"; 6 model = "LaCie Internet Space v2";
diff --git a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
index 5d9f5ea78700..b071d37cc291 100644
--- a/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
+++ b/arch/arm/boot/dts/kirkwood-km_kirkwood.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-98dx4122.dtsi" 4#include "kirkwood-98dx4122.dtsi"
5 5
6/ { 6/ {
7 model = "Keymile Kirkwood Reference Design"; 7 model = "Keymile Kirkwood Reference Design";
diff --git a/arch/arm/boot/dts/kirkwood-lschlv2.dts b/arch/arm/boot/dts/kirkwood-lschlv2.dts
index 9f55d95f35f5..e2fa368aef25 100644
--- a/arch/arm/boot/dts/kirkwood-lschlv2.dts
+++ b/arch/arm/boot/dts/kirkwood-lschlv2.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-lsxl.dtsi" 3#include "kirkwood-lsxl.dtsi"
4 4
5/ { 5/ {
6 model = "Buffalo Linkstation LS-CHLv2"; 6 model = "Buffalo Linkstation LS-CHLv2";
diff --git a/arch/arm/boot/dts/kirkwood-lsxhl.dts b/arch/arm/boot/dts/kirkwood-lsxhl.dts
index 5c84c118ed8d..8d89cdf8d6bf 100644
--- a/arch/arm/boot/dts/kirkwood-lsxhl.dts
+++ b/arch/arm/boot/dts/kirkwood-lsxhl.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-lsxl.dtsi" 3#include "kirkwood-lsxl.dtsi"
4 4
5/ { 5/ {
6 model = "Buffalo Linkstation LS-XHL"; 6 model = "Buffalo Linkstation LS-XHL";
diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
index 31b17f5b9d28..f7e247cc925a 100644
--- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi
+++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi
@@ -1,5 +1,5 @@
1/include/ "kirkwood.dtsi" 1#include "kirkwood.dtsi"
2/include/ "kirkwood-6281.dtsi" 2#include "kirkwood-6281.dtsi"
3 3
4/ { 4/ {
5 chosen { 5 chosen {
diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts
index 6179333fd71f..21f1954c9e54 100644
--- a/arch/arm/boot/dts/kirkwood-mplcec4.dts
+++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "MPL CEC4"; 7 model = "MPL CEC4";
@@ -16,6 +16,17 @@
16 bootargs = "console=ttyS0,115200n8 earlyprintk"; 16 bootargs = "console=ttyS0,115200n8 earlyprintk";
17 }; 17 };
18 18
19 mbus {
20 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
21 pcie-controller {
22 status = "okay";
23
24 pcie@1,0 {
25 status = "okay";
26 };
27 };
28 };
29
19 ocp@f1000000 { 30 ocp@f1000000 {
20 pinctrl: pinctrl@10000 { 31 pinctrl: pinctrl@10000 {
21 pmx_led_health: pmx-led-health { 32 pmx_led_health: pmx-led-health {
@@ -134,14 +145,6 @@
134 cd-gpios = <&gpio1 15 1>; 145 cd-gpios = <&gpio1 15 1>;
135 /* No WP GPIO */ 146 /* No WP GPIO */
136 }; 147 };
137
138 pcie-controller {
139 status = "okay";
140
141 pcie@1,0 {
142 status = "okay";
143 };
144 };
145 }; 148 };
146 149
147 gpio-leds { 150 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
index ad6ade7d9191..84ff31cfbcdc 100644
--- a/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
+++ b/arch/arm/boot/dts/kirkwood-netgear_readynas_duo_v2.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6282.dtsi" 4#include "kirkwood-6282.dtsi"
5 5
6/ { 6/ {
7 model = "NETGEAR ReadyNAS Duo v2"; 7 model = "NETGEAR ReadyNAS Duo v2";
@@ -16,6 +16,17 @@
16 bootargs = "console=ttyS0,115200n8 earlyprintk"; 16 bootargs = "console=ttyS0,115200n8 earlyprintk";
17 }; 17 };
18 18
19 mbus {
20 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
21 pcie-controller {
22 status = "okay";
23
24 pcie@1,0 {
25 status = "okay";
26 };
27 };
28 };
29
19 ocp@f1000000 { 30 ocp@f1000000 {
20 pinctrl: pinctrl@10000 { 31 pinctrl: pinctrl@10000 {
21 pmx_button_power: pmx-button-power { 32 pmx_button_power: pmx-button-power {
@@ -101,14 +112,6 @@
101 status = "okay"; 112 status = "okay";
102 nr-ports = <2>; 113 nr-ports = <2>;
103 }; 114 };
104
105 pcie-controller {
106 status = "okay";
107
108 pcie@1,0 {
109 status = "okay";
110 };
111 };
112 }; 115 };
113 116
114 gpio-leds { 117 gpio-leds {
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
index 2afac0405816..d0fb34dc1667 100644
--- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi
@@ -1,5 +1,5 @@
1/include/ "kirkwood.dtsi" 1#include "kirkwood.dtsi"
2/include/ "kirkwood-6281.dtsi" 2#include "kirkwood-6281.dtsi"
3 3
4/ { 4/ {
5 chosen { 5 chosen {
diff --git a/arch/arm/boot/dts/kirkwood-ns2.dts b/arch/arm/boot/dts/kirkwood-ns2.dts
index b50e93d7796c..0599f3cb844e 100644
--- a/arch/arm/boot/dts/kirkwood-ns2.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-ns2-common.dtsi" 3#include "kirkwood-ns2-common.dtsi"
4 4
5/ { 5/ {
6 model = "LaCie Network Space v2"; 6 model = "LaCie Network Space v2";
diff --git a/arch/arm/boot/dts/kirkwood-ns2lite.dts b/arch/arm/boot/dts/kirkwood-ns2lite.dts
index af8259fe8955..b0e17984aea0 100644
--- a/arch/arm/boot/dts/kirkwood-ns2lite.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2lite.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-ns2-common.dtsi" 3#include "kirkwood-ns2-common.dtsi"
4 4
5/ { 5/ {
6 model = "LaCie Network Space Lite v2"; 6 model = "LaCie Network Space Lite v2";
diff --git a/arch/arm/boot/dts/kirkwood-ns2max.dts b/arch/arm/boot/dts/kirkwood-ns2max.dts
index 85f24d227e17..d4f6a586d553 100644
--- a/arch/arm/boot/dts/kirkwood-ns2max.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2max.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-ns2-common.dtsi" 3#include "kirkwood-ns2-common.dtsi"
4 4
5/ { 5/ {
6 model = "LaCie Network Space Max v2"; 6 model = "LaCie Network Space Max v2";
diff --git a/arch/arm/boot/dts/kirkwood-ns2mini.dts b/arch/arm/boot/dts/kirkwood-ns2mini.dts
index 329e530bffe7..f30e05af6473 100644
--- a/arch/arm/boot/dts/kirkwood-ns2mini.dts
+++ b/arch/arm/boot/dts/kirkwood-ns2mini.dts
@@ -1,6 +1,6 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood-ns2-common.dtsi" 3#include "kirkwood-ns2-common.dtsi"
4 4
5/ { 5/ {
6 /* This machine is embedded in the first LaCie CloudBox product. */ 6 /* This machine is embedded in the first LaCie CloudBox product. */
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts
index 69003598f5fa..bd7f05f6aa96 100644
--- a/arch/arm/boot/dts/kirkwood-nsa310.dts
+++ b/arch/arm/boot/dts/kirkwood-nsa310.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5 5
6/ { 6/ {
7 model = "ZyXEL NSA310"; 7 model = "ZyXEL NSA310";
@@ -16,6 +16,17 @@
16 bootargs = "console=ttyS0,115200"; 16 bootargs = "console=ttyS0,115200";
17 }; 17 };
18 18
19 mbus {
20 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
21 pcie-controller {
22 status = "okay";
23
24 pcie@1,0 {
25 status = "okay";
26 };
27 };
28 };
29
19 ocp@f1000000 { 30 ocp@f1000000 {
20 pinctrl: pinctrl@10000 { 31 pinctrl: pinctrl@10000 {
21 pinctrl-0 = <&pmx_unknown>; 32 pinctrl-0 = <&pmx_unknown>;
@@ -162,14 +173,6 @@
162 reg = <0x5040000 0x2fc0000>; 173 reg = <0x5040000 0x2fc0000>;
163 }; 174 };
164 }; 175 };
165
166 pcie-controller {
167 status = "okay";
168
169 pcie@1,0 {
170 status = "okay";
171 };
172 };
173 }; 176 };
174 177
175 gpio_keys { 178 gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
index 38dc8517d777..365b792b23a7 100644
--- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
+++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6282.dtsi" 4#include "kirkwood-6282.dtsi"
5 5
6/ { 6/ {
7 model = "Plat'Home OpenBlocksA6"; 7 model = "Plat'Home OpenBlocksA6";
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
index f7143f128504..0cc5f26bbbb6 100644
--- a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
@@ -6,8 +6,8 @@
6 * Licensed under GPLv2 6 * Licensed under GPLv2
7 */ 7 */
8 8
9/include/ "kirkwood.dtsi" 9#include "kirkwood.dtsi"
10/include/ "kirkwood-6281.dtsi" 10#include "kirkwood-6281.dtsi"
11 11
12/ { 12/ {
13 memory { 13 memory {
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts b/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
index f620ce48de97..eac6a21f3b1f 100644
--- a/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug-esata.dts
@@ -8,7 +8,7 @@
8 8
9/dts-v1/; 9/dts-v1/;
10 10
11/include/ "kirkwood-sheevaplug-common.dtsi" 11#include "kirkwood-sheevaplug-common.dtsi"
12 12
13/ { 13/ {
14 model = "Globalscale Technologies eSATA SheevaPlug"; 14 model = "Globalscale Technologies eSATA SheevaPlug";
diff --git a/arch/arm/boot/dts/kirkwood-sheevaplug.dts b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
index bf1dff251432..bb61918313db 100644
--- a/arch/arm/boot/dts/kirkwood-sheevaplug.dts
+++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
@@ -8,7 +8,7 @@
8 8
9/dts-v1/; 9/dts-v1/;
10 10
11/include/ "kirkwood-sheevaplug-common.dtsi" 11#include "kirkwood-sheevaplug-common.dtsi"
12 12
13/ { 13/ {
14 model = "Globalscale Technologies SheevaPlug"; 14 model = "Globalscale Technologies SheevaPlug";
diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts
index f2052d7bc10f..974f1e0f09b2 100644
--- a/arch/arm/boot/dts/kirkwood-topkick.dts
+++ b/arch/arm/boot/dts/kirkwood-topkick.dts
@@ -1,7 +1,7 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6282.dtsi" 4#include "kirkwood-6282.dtsi"
5 5
6/ { 6/ {
7 model = "Univeral Scientific Industrial Co. Topkick-1281P2"; 7 model = "Univeral Scientific Industrial Co. Topkick-1281P2";
diff --git a/arch/arm/boot/dts/kirkwood-ts219-6281.dts b/arch/arm/boot/dts/kirkwood-ts219-6281.dts
index 6dd1038e4de4..3867ae3030be 100644
--- a/arch/arm/boot/dts/kirkwood-ts219-6281.dts
+++ b/arch/arm/boot/dts/kirkwood-ts219-6281.dts
@@ -1,8 +1,8 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6281.dtsi" 4#include "kirkwood-6281.dtsi"
5/include/ "kirkwood-ts219.dtsi" 5#include "kirkwood-ts219.dtsi"
6 6
7/ { 7/ {
8 ocp@f1000000 { 8 ocp@f1000000 {
diff --git a/arch/arm/boot/dts/kirkwood-ts219-6282.dts b/arch/arm/boot/dts/kirkwood-ts219-6282.dts
index 6fdc5ffcaae5..04f6fe106bb5 100644
--- a/arch/arm/boot/dts/kirkwood-ts219-6282.dts
+++ b/arch/arm/boot/dts/kirkwood-ts219-6282.dts
@@ -1,10 +1,21 @@
1/dts-v1/; 1/dts-v1/;
2 2
3/include/ "kirkwood.dtsi" 3#include "kirkwood.dtsi"
4/include/ "kirkwood-6282.dtsi" 4#include "kirkwood-6282.dtsi"
5/include/ "kirkwood-ts219.dtsi" 5#include "kirkwood-ts219.dtsi"
6 6
7/ { 7/ {
8 mbus {
9 ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>;
10 pcie-controller {
11 status = "okay";
12
13 pcie@2,0 {
14 status = "okay";
15 };
16 };
17 };
18
8 ocp@f1000000 { 19 ocp@f1000000 {
9 pinctrl: pinctrl@10000 { 20 pinctrl: pinctrl@10000 {
10 21
@@ -30,14 +41,6 @@
30 marvell,function = "gpio"; 41 marvell,function = "gpio";
31 }; 42 };
32 }; 43 };
33 pcie-controller {
34 status = "okay";
35
36 pcie@2,0 {
37 status = "okay";
38 };
39 };
40
41 }; 44 };
42 45
43 gpio_keys { 46 gpio_keys {
diff --git a/arch/arm/boot/dts/kirkwood-ts219.dtsi b/arch/arm/boot/dts/kirkwood-ts219.dtsi
index 0c9a94cd666c..7019cf675df2 100644
--- a/arch/arm/boot/dts/kirkwood-ts219.dtsi
+++ b/arch/arm/boot/dts/kirkwood-ts219.dtsi
@@ -11,6 +11,16 @@
11 bootargs = "console=ttyS0,115200n8"; 11 bootargs = "console=ttyS0,115200n8";
12 }; 12 };
13 13
14 mbus {
15 pcie-controller {
16 status = "okay";
17
18 pcie@1,0 {
19 status = "okay";
20 };
21 };
22 };
23
14 ocp@f1000000 { 24 ocp@f1000000 {
15 i2c@11000 { 25 i2c@11000 {
16 status = "okay"; 26 status = "okay";
@@ -87,12 +97,5 @@
87 status = "okay"; 97 status = "okay";
88 nr-ports = <2>; 98 nr-ports = <2>;
89 }; 99 };
90 pcie-controller {
91 status = "okay";
92
93 pcie@1,0 {
94 status = "okay";
95 };
96 };
97 }; 100 };
98}; 101};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 9809fc1f105c..70f414d9bd9a 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -1,5 +1,7 @@
1/include/ "skeleton.dtsi" 1/include/ "skeleton.dtsi"
2 2
3#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
4
3/ { 5/ {
4 compatible = "marvell,kirkwood"; 6 compatible = "marvell,kirkwood";
5 interrupt-parent = <&intc>; 7 interrupt-parent = <&intc>;
@@ -28,15 +30,28 @@
28 <0xf1020214 0x04>; 30 <0xf1020214 0x04>;
29 }; 31 };
30 32
33 mbus {
34 compatible = "marvell,kirkwood-mbus", "simple-bus";
35 #address-cells = <2>;
36 #size-cells = <1>;
37 controller = <&mbusc>;
38 pcie-mem-aperture = <0xe0000000 0x10000000>; /* 256 MiB memory space */
39 pcie-io-aperture = <0xf2000000 0x100000>; /* 1 MiB I/O space */
40 };
41
31 ocp@f1000000 { 42 ocp@f1000000 {
32 compatible = "simple-bus"; 43 compatible = "simple-bus";
33 ranges = <0x00000000 0xf1000000 0x0100000 44 ranges = <0x00000000 0xf1000000 0x0100000
34 0xe0000000 0xe0000000 0x8100000 /* PCIE */
35 0xf4000000 0xf4000000 0x0000400 45 0xf4000000 0xf4000000 0x0000400
36 0xf5000000 0xf5000000 0x0000400>; 46 0xf5000000 0xf5000000 0x0000400>;
37 #address-cells = <1>; 47 #address-cells = <1>;
38 #size-cells = <1>; 48 #size-cells = <1>;
39 49
50 mbusc: mbus-controller@20000 {
51 compatible = "marvell,mbus-controller";
52 reg = <0x20000 0x80>, <0x1500 0x20>;
53 };
54
40 core_clk: core-clocks@10030 { 55 core_clk: core-clocks@10030 {
41 compatible = "marvell,kirkwood-core-clock"; 56 compatible = "marvell,kirkwood-core-clock";
42 reg = <0x10030 0x4>; 57 reg = <0x10030 0x4>;
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 00247c771313..bc22056200ae 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -27,6 +27,22 @@
27#include <plat/time.h> 27#include <plat/time.h>
28#include "common.h" 28#include "common.h"
29 29
30/* These can go away once Dove uses the mvebu-mbus DT binding */
31#define DOVE_MBUS_PCIE0_MEM_TARGET 0x4
32#define DOVE_MBUS_PCIE0_MEM_ATTR 0xe8
33#define DOVE_MBUS_PCIE0_IO_TARGET 0x4
34#define DOVE_MBUS_PCIE0_IO_ATTR 0xe0
35#define DOVE_MBUS_PCIE1_MEM_TARGET 0x8
36#define DOVE_MBUS_PCIE1_MEM_ATTR 0xe8
37#define DOVE_MBUS_PCIE1_IO_TARGET 0x8
38#define DOVE_MBUS_PCIE1_IO_ATTR 0xe0
39#define DOVE_MBUS_CESA_TARGET 0x3
40#define DOVE_MBUS_CESA_ATTR 0x1
41#define DOVE_MBUS_BOOTROM_TARGET 0x1
42#define DOVE_MBUS_BOOTROM_ATTR 0xfd
43#define DOVE_MBUS_SCRATCHPAD_TARGET 0xd
44#define DOVE_MBUS_SCRATCHPAD_ATTR 0x0
45
30/***************************************************************************** 46/*****************************************************************************
31 * I/O Address Mapping 47 * I/O Address Mapping
32 ****************************************************************************/ 48 ****************************************************************************/
@@ -332,34 +348,40 @@ void __init dove_setup_cpu_wins(void)
332{ 348{
333 /* 349 /*
334 * The PCIe windows will no longer be statically allocated 350 * The PCIe windows will no longer be statically allocated
335 * here once Dove is migrated to the pci-mvebu driver. 351 * here once Dove is migrated to the pci-mvebu driver. The
352 * non-PCIe windows will no longer be created here once Dove
353 * fully moves to DT.
336 */ 354 */
337 mvebu_mbus_add_window_remap_flags("pcie0.0", 355 mvebu_mbus_add_window_remap_by_id(DOVE_MBUS_PCIE0_IO_TARGET,
356 DOVE_MBUS_PCIE0_IO_ATTR,
338 DOVE_PCIE0_IO_PHYS_BASE, 357 DOVE_PCIE0_IO_PHYS_BASE,
339 DOVE_PCIE0_IO_SIZE, 358 DOVE_PCIE0_IO_SIZE,
340 DOVE_PCIE0_IO_BUS_BASE, 359 DOVE_PCIE0_IO_BUS_BASE);
341 MVEBU_MBUS_PCI_IO); 360 mvebu_mbus_add_window_remap_by_id(DOVE_MBUS_PCIE1_IO_TARGET,
342 mvebu_mbus_add_window_remap_flags("pcie1.0", 361 DOVE_MBUS_PCIE1_IO_ATTR,
343 DOVE_PCIE1_IO_PHYS_BASE, 362 DOVE_PCIE1_IO_PHYS_BASE,
344 DOVE_PCIE1_IO_SIZE, 363 DOVE_PCIE1_IO_SIZE,
345 DOVE_PCIE1_IO_BUS_BASE, 364 DOVE_PCIE1_IO_BUS_BASE);
346 MVEBU_MBUS_PCI_IO); 365 mvebu_mbus_add_window_by_id(DOVE_MBUS_PCIE0_MEM_TARGET,
347 mvebu_mbus_add_window_remap_flags("pcie0.0", 366 DOVE_MBUS_PCIE0_MEM_ATTR,
348 DOVE_PCIE0_MEM_PHYS_BASE, 367 DOVE_PCIE0_MEM_PHYS_BASE,
349 DOVE_PCIE0_MEM_SIZE, 368 DOVE_PCIE0_MEM_SIZE);
350 MVEBU_MBUS_NO_REMAP, 369 mvebu_mbus_add_window_by_id(DOVE_MBUS_PCIE1_MEM_TARGET,
351 MVEBU_MBUS_PCI_MEM); 370 DOVE_MBUS_PCIE1_MEM_ATTR,
352 mvebu_mbus_add_window_remap_flags("pcie1.0", 371 DOVE_PCIE1_MEM_PHYS_BASE,
353 DOVE_PCIE1_MEM_PHYS_BASE, 372 DOVE_PCIE1_MEM_SIZE);
354 DOVE_PCIE1_MEM_SIZE, 373 mvebu_mbus_add_window_by_id(DOVE_MBUS_CESA_TARGET,
355 MVEBU_MBUS_NO_REMAP, 374 DOVE_MBUS_CESA_ATTR,
356 MVEBU_MBUS_PCI_MEM); 375 DOVE_CESA_PHYS_BASE,
357 mvebu_mbus_add_window("cesa", DOVE_CESA_PHYS_BASE, 376 DOVE_CESA_SIZE);
358 DOVE_CESA_SIZE); 377 mvebu_mbus_add_window_by_id(DOVE_MBUS_BOOTROM_TARGET,
359 mvebu_mbus_add_window("bootrom", DOVE_BOOTROM_PHYS_BASE, 378 DOVE_MBUS_BOOTROM_ATTR,
360 DOVE_BOOTROM_SIZE); 379 DOVE_BOOTROM_PHYS_BASE,
361 mvebu_mbus_add_window("scratchpad", DOVE_SCRATCHPAD_PHYS_BASE, 380 DOVE_BOOTROM_SIZE);
362 DOVE_SCRATCHPAD_SIZE); 381 mvebu_mbus_add_window_by_id(DOVE_MBUS_SCRATCHPAD_TARGET,
382 DOVE_MBUS_SCRATCHPAD_ATTR,
383 DOVE_SCRATCHPAD_PHYS_BASE,
384 DOVE_SCRATCHPAD_SIZE);
363} 385}
364 386
365void __init dove_init(void) 387void __init dove_init(void)
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 6e122ed3282f..682b7ac8deb8 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -87,6 +87,7 @@ static void __init kirkwood_dt_init(void)
87 */ 87 */
88 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); 88 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
89 89
90 BUG_ON(mvebu_mbus_dt_init());
90 kirkwood_setup_wins(); 91 kirkwood_setup_wins();
91 92
92 kirkwood_l2_init(); 93 kirkwood_l2_init();
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index e9238b5567ee..15b7e72e890b 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -37,6 +37,12 @@
37#include <linux/platform_data/dma-mv_xor.h> 37#include <linux/platform_data/dma-mv_xor.h>
38#include "common.h" 38#include "common.h"
39 39
40/* These can go away once Kirkwood uses the mvebu-mbus DT binding */
41#define KIRKWOOD_MBUS_NAND_TARGET 0x01
42#define KIRKWOOD_MBUS_NAND_ATTR 0x2f
43#define KIRKWOOD_MBUS_SRAM_TARGET 0x03
44#define KIRKWOOD_MBUS_SRAM_ATTR 0x01
45
40/***************************************************************************** 46/*****************************************************************************
41 * I/O Address Mapping 47 * I/O Address Mapping
42 ****************************************************************************/ 48 ****************************************************************************/
@@ -528,10 +534,6 @@ void __init kirkwood_cpuidle_init(void)
528void __init kirkwood_init_early(void) 534void __init kirkwood_init_early(void)
529{ 535{
530 orion_time_set_base(TIMER_VIRT_BASE); 536 orion_time_set_base(TIMER_VIRT_BASE);
531
532 mvebu_mbus_init("marvell,kirkwood-mbus",
533 BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
534 DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ);
535} 537}
536 538
537int kirkwood_tclk; 539int kirkwood_tclk;
@@ -672,10 +674,14 @@ char * __init kirkwood_id(void)
672 674
673void __init kirkwood_setup_wins(void) 675void __init kirkwood_setup_wins(void)
674{ 676{
675 mvebu_mbus_add_window("nand", KIRKWOOD_NAND_MEM_PHYS_BASE, 677 mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_NAND_TARGET,
676 KIRKWOOD_NAND_MEM_SIZE); 678 KIRKWOOD_MBUS_NAND_ATTR,
677 mvebu_mbus_add_window("sram", KIRKWOOD_SRAM_PHYS_BASE, 679 KIRKWOOD_NAND_MEM_PHYS_BASE,
678 KIRKWOOD_SRAM_SIZE); 680 KIRKWOOD_NAND_MEM_SIZE);
681 mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_SRAM_TARGET,
682 KIRKWOOD_MBUS_SRAM_ATTR,
683 KIRKWOOD_SRAM_PHYS_BASE,
684 KIRKWOOD_SRAM_SIZE);
679} 685}
680 686
681void __init kirkwood_l2_init(void) 687void __init kirkwood_l2_init(void)
@@ -703,6 +709,10 @@ void __init kirkwood_init(void)
703 */ 709 */
704 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG); 710 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
705 711
712 BUG_ON(mvebu_mbus_init("marvell,kirkwood-mbus",
713 BRIDGE_WINS_BASE, BRIDGE_WINS_SZ,
714 DDR_WINDOW_CPU_BASE, DDR_WINDOW_CPU_SZ));
715
706 kirkwood_setup_wins(); 716 kirkwood_setup_wins();
707 717
708 kirkwood_l2_init(); 718 kirkwood_l2_init();
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index ddcb09f5bdd3..12d86f39f380 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -20,6 +20,16 @@
20#include <mach/bridge-regs.h> 20#include <mach/bridge-regs.h>
21#include "common.h" 21#include "common.h"
22 22
23/* These can go away once Kirkwood uses the mvebu-mbus DT binding */
24#define KIRKWOOD_MBUS_PCIE0_MEM_TARGET 0x4
25#define KIRKWOOD_MBUS_PCIE0_MEM_ATTR 0xe8
26#define KIRKWOOD_MBUS_PCIE0_IO_TARGET 0x4
27#define KIRKWOOD_MBUS_PCIE0_IO_ATTR 0xe0
28#define KIRKWOOD_MBUS_PCIE1_MEM_TARGET 0x4
29#define KIRKWOOD_MBUS_PCIE1_MEM_ATTR 0xd8
30#define KIRKWOOD_MBUS_PCIE1_IO_TARGET 0x4
31#define KIRKWOOD_MBUS_PCIE1_IO_ATTR 0xd0
32
23static void kirkwood_enable_pcie_clk(const char *port) 33static void kirkwood_enable_pcie_clk(const char *port)
24{ 34{
25 struct clk *clk; 35 struct clk *clk;
@@ -254,26 +264,24 @@ static void __init add_pcie_port(int index, void __iomem *base)
254 264
255void __init kirkwood_pcie_init(unsigned int portmask) 265void __init kirkwood_pcie_init(unsigned int portmask)
256{ 266{
257 mvebu_mbus_add_window_remap_flags("pcie0.0", 267 mvebu_mbus_add_window_remap_by_id(KIRKWOOD_MBUS_PCIE0_IO_TARGET,
268 KIRKWOOD_MBUS_PCIE0_IO_ATTR,
258 KIRKWOOD_PCIE_IO_PHYS_BASE, 269 KIRKWOOD_PCIE_IO_PHYS_BASE,
259 KIRKWOOD_PCIE_IO_SIZE, 270 KIRKWOOD_PCIE_IO_SIZE,
260 KIRKWOOD_PCIE_IO_BUS_BASE, 271 KIRKWOOD_PCIE_IO_BUS_BASE);
261 MVEBU_MBUS_PCI_IO); 272 mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_PCIE0_MEM_TARGET,
262 mvebu_mbus_add_window_remap_flags("pcie0.0", 273 KIRKWOOD_MBUS_PCIE0_MEM_ATTR,
263 KIRKWOOD_PCIE_MEM_PHYS_BASE, 274 KIRKWOOD_PCIE_MEM_PHYS_BASE,
264 KIRKWOOD_PCIE_MEM_SIZE, 275 KIRKWOOD_PCIE_MEM_SIZE);
265 MVEBU_MBUS_NO_REMAP, 276 mvebu_mbus_add_window_remap_by_id(KIRKWOOD_MBUS_PCIE1_IO_TARGET,
266 MVEBU_MBUS_PCI_MEM); 277 KIRKWOOD_MBUS_PCIE1_IO_ATTR,
267 mvebu_mbus_add_window_remap_flags("pcie1.0",
268 KIRKWOOD_PCIE1_IO_PHYS_BASE, 278 KIRKWOOD_PCIE1_IO_PHYS_BASE,
269 KIRKWOOD_PCIE1_IO_SIZE, 279 KIRKWOOD_PCIE1_IO_SIZE,
270 KIRKWOOD_PCIE1_IO_BUS_BASE, 280 KIRKWOOD_PCIE1_IO_BUS_BASE);
271 MVEBU_MBUS_PCI_IO); 281 mvebu_mbus_add_window_by_id(KIRKWOOD_MBUS_PCIE1_MEM_TARGET,
272 mvebu_mbus_add_window_remap_flags("pcie1.0", 282 KIRKWOOD_MBUS_PCIE1_MEM_ATTR,
273 KIRKWOOD_PCIE1_MEM_PHYS_BASE, 283 KIRKWOOD_PCIE1_MEM_PHYS_BASE,
274 KIRKWOOD_PCIE1_MEM_SIZE, 284 KIRKWOOD_PCIE1_MEM_SIZE);
275 MVEBU_MBUS_NO_REMAP,
276 MVEBU_MBUS_PCI_MEM);
277 285
278 vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE; 286 vga_base = KIRKWOOD_PCIE_MEM_PHYS_BASE;
279 287
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index dc26a654c496..445e553f4a28 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -18,6 +18,11 @@
18#include <mach/mv78xx0.h> 18#include <mach/mv78xx0.h>
19#include "common.h" 19#include "common.h"
20 20
21#define MV78XX0_MBUS_PCIE_MEM_TARGET(port, lane) ((port) ? 8 : 4)
22#define MV78XX0_MBUS_PCIE_MEM_ATTR(port, lane) (0xf8 & ~(0x10 << (lane)))
23#define MV78XX0_MBUS_PCIE_IO_TARGET(port, lane) ((port) ? 8 : 4)
24#define MV78XX0_MBUS_PCIE_IO_ATTR(port, lane) (0xf0 & ~(0x10 << (lane)))
25
21struct pcie_port { 26struct pcie_port {
22 u8 maj; 27 u8 maj;
23 u8 min; 28 u8 min;
@@ -71,7 +76,6 @@ static void __init mv78xx0_pcie_preinit(void)
71 start = MV78XX0_PCIE_MEM_PHYS_BASE; 76 start = MV78XX0_PCIE_MEM_PHYS_BASE;
72 for (i = 0; i < num_pcie_ports; i++) { 77 for (i = 0; i < num_pcie_ports; i++) {
73 struct pcie_port *pp = pcie_port + i; 78 struct pcie_port *pp = pcie_port + i;
74 char winname[MVEBU_MBUS_MAX_WINNAME_SZ];
75 79
76 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name), 80 snprintf(pp->mem_space_name, sizeof(pp->mem_space_name),
77 "PCIe %d.%d MEM", pp->maj, pp->min); 81 "PCIe %d.%d MEM", pp->maj, pp->min);
@@ -85,17 +89,12 @@ static void __init mv78xx0_pcie_preinit(void)
85 if (request_resource(&iomem_resource, &pp->res)) 89 if (request_resource(&iomem_resource, &pp->res))
86 panic("can't allocate PCIe MEM sub-space"); 90 panic("can't allocate PCIe MEM sub-space");
87 91
88 snprintf(winname, sizeof(winname), "pcie%d.%d", 92 mvebu_mbus_add_window_by_id(MV78XX0_MBUS_PCIE_MEM_TARGET(pp->maj, pp->min),
89 pp->maj, pp->min); 93 MV78XX0_MBUS_PCIE_MEM_ATTR(pp->maj, pp->min),
90 94 pp->res.start, resource_size(&pp->res));
91 mvebu_mbus_add_window_remap_flags(winname, 95 mvebu_mbus_add_window_remap_by_id(MV78XX0_MBUS_PCIE_IO_TARGET(pp->maj, pp->min),
92 pp->res.start, 96 MV78XX0_MBUS_PCIE_IO_ATTR(pp->maj, pp->min),
93 resource_size(&pp->res), 97 i * SZ_64K, SZ_64K, 0);
94 MVEBU_MBUS_NO_REMAP,
95 MVEBU_MBUS_PCI_MEM);
96 mvebu_mbus_add_window_remap_flags(winname,
97 i * SZ_64K, SZ_64K,
98 0, MVEBU_MBUS_PCI_IO);
99 } 98 }
100} 99}
101 100
diff --git a/arch/arm/mach-mvebu/armada-370-xp.c b/arch/arm/mach-mvebu/armada-370-xp.c
index 97cbb8021919..829b57306328 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.c
+++ b/arch/arm/mach-mvebu/armada-370-xp.c
@@ -34,44 +34,12 @@ static void __init armada_370_xp_map_io(void)
34 debug_ll_io_init(); 34 debug_ll_io_init();
35} 35}
36 36
37/*
38 * This initialization will be replaced by a DT-based
39 * initialization once the mvebu-mbus driver gains DT support.
40 */
41
42#define ARMADA_370_XP_MBUS_WINS_OFFS 0x20000
43#define ARMADA_370_XP_MBUS_WINS_SIZE 0x100
44#define ARMADA_370_XP_SDRAM_WINS_OFFS 0x20180
45#define ARMADA_370_XP_SDRAM_WINS_SIZE 0x20
46
47static void __init armada_370_xp_mbus_init(void)
48{
49 char *mbus_soc_name;
50 struct device_node *dn;
51 const __be32 mbus_wins_offs = cpu_to_be32(ARMADA_370_XP_MBUS_WINS_OFFS);
52 const __be32 sdram_wins_offs = cpu_to_be32(ARMADA_370_XP_SDRAM_WINS_OFFS);
53
54 if (of_machine_is_compatible("marvell,armada370"))
55 mbus_soc_name = "marvell,armada370-mbus";
56 else
57 mbus_soc_name = "marvell,armadaxp-mbus";
58
59 dn = of_find_node_by_name(NULL, "internal-regs");
60 BUG_ON(!dn);
61
62 mvebu_mbus_init(mbus_soc_name,
63 of_translate_address(dn, &mbus_wins_offs),
64 ARMADA_370_XP_MBUS_WINS_SIZE,
65 of_translate_address(dn, &sdram_wins_offs),
66 ARMADA_370_XP_SDRAM_WINS_SIZE);
67}
68
69static void __init armada_370_xp_timer_and_clk_init(void) 37static void __init armada_370_xp_timer_and_clk_init(void)
70{ 38{
71 of_clk_init(NULL); 39 of_clk_init(NULL);
72 armada_370_xp_timer_init(); 40 armada_370_xp_timer_init();
73 coherency_init(); 41 coherency_init();
74 armada_370_xp_mbus_init(); 42 BUG_ON(mvebu_mbus_dt_init());
75#ifdef CONFIG_CACHE_L2X0 43#ifdef CONFIG_CACHE_L2X0
76 l2x0_of_init(0, ~0UL); 44 l2x0_of_init(0, ~0UL);
77#endif 45#endif
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index ce81d3031405..c6b00fce6d8d 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -21,6 +21,7 @@
21#include <linux/smp.h> 21#include <linux/smp.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/of_address.h>
24#include <linux/mbus.h> 25#include <linux/mbus.h>
25#include <asm/cacheflush.h> 26#include <asm/cacheflush.h>
26#include <asm/smp_plat.h> 27#include <asm/smp_plat.h>
@@ -29,6 +30,9 @@
29#include "pmsu.h" 30#include "pmsu.h"
30#include "coherency.h" 31#include "coherency.h"
31 32
33#define AXP_BOOTROM_BASE 0xfff00000
34#define AXP_BOOTROM_SIZE 0x100000
35
32void __init set_secondary_cpus_clock(void) 36void __init set_secondary_cpus_clock(void)
33{ 37{
34 int thiscpu; 38 int thiscpu;
@@ -114,10 +118,29 @@ static void __init armada_xp_smp_init_cpus(void)
114 118
115void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus) 119void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus)
116{ 120{
121 struct device_node *node;
122 struct resource res;
123 int err;
124
117 set_secondary_cpus_clock(); 125 set_secondary_cpus_clock();
118 flush_cache_all(); 126 flush_cache_all();
119 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); 127 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
120 mvebu_mbus_add_window("bootrom", 0xfff00000, SZ_1M); 128
129 /*
130 * In order to boot the secondary CPUs we need to ensure
131 * the bootROM is mapped at the correct address.
132 */
133 node = of_find_compatible_node(NULL, NULL, "marvell,bootrom");
134 if (!node)
135 panic("Cannot find 'marvell,bootrom' compatible node");
136
137 err = of_address_to_resource(node, 0, &res);
138 if (err < 0)
139 panic("Cannot get 'bootrom' node address");
140
141 if (res.start != AXP_BOOTROM_BASE ||
142 resource_size(&res) != AXP_BOOTROM_SIZE)
143 panic("The address for the BootROM is incorrect");
121} 144}
122 145
123struct smp_operations armada_xp_smp_ops __initdata = { 146struct smp_operations armada_xp_smp_ops __initdata = {
diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c
index b41599f98a8e..91a5852b44f3 100644
--- a/arch/arm/mach-orion5x/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -174,8 +174,10 @@ void __init orion5x_xor_init(void)
174 ****************************************************************************/ 174 ****************************************************************************/
175static void __init orion5x_crypto_init(void) 175static void __init orion5x_crypto_init(void)
176{ 176{
177 mvebu_mbus_add_window("sram", ORION5X_SRAM_PHYS_BASE, 177 mvebu_mbus_add_window_by_id(ORION_MBUS_SRAM_TARGET,
178 ORION5X_SRAM_SIZE); 178 ORION_MBUS_SRAM_ATTR,
179 ORION5X_SRAM_PHYS_BASE,
180 ORION5X_SRAM_SIZE);
179 orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE, 181 orion_crypto_init(ORION5X_CRYPTO_PHYS_BASE, ORION5X_SRAM_PHYS_BASE,
180 SZ_8K, IRQ_ORION5X_CESA); 182 SZ_8K, IRQ_ORION5X_CESA);
181} 183}
@@ -222,22 +224,24 @@ void orion5x_setup_wins(void)
222 * The PCIe windows will no longer be statically allocated 224 * The PCIe windows will no longer be statically allocated
223 * here once Orion5x is migrated to the pci-mvebu driver. 225 * here once Orion5x is migrated to the pci-mvebu driver.
224 */ 226 */
225 mvebu_mbus_add_window_remap_flags("pcie0.0", ORION5X_PCIE_IO_PHYS_BASE, 227 mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCIE_IO_TARGET,
228 ORION_MBUS_PCIE_IO_ATTR,
229 ORION5X_PCIE_IO_PHYS_BASE,
226 ORION5X_PCIE_IO_SIZE, 230 ORION5X_PCIE_IO_SIZE,
227 ORION5X_PCIE_IO_BUS_BASE, 231 ORION5X_PCIE_IO_BUS_BASE);
228 MVEBU_MBUS_PCI_IO); 232 mvebu_mbus_add_window_by_id(ORION_MBUS_PCIE_MEM_TARGET,
229 mvebu_mbus_add_window_remap_flags("pcie0.0", ORION5X_PCIE_MEM_PHYS_BASE, 233 ORION_MBUS_PCIE_MEM_ATTR,
230 ORION5X_PCIE_MEM_SIZE, 234 ORION5X_PCIE_MEM_PHYS_BASE,
231 MVEBU_MBUS_NO_REMAP, 235 ORION5X_PCIE_MEM_SIZE);
232 MVEBU_MBUS_PCI_MEM); 236 mvebu_mbus_add_window_remap_by_id(ORION_MBUS_PCI_IO_TARGET,
233 mvebu_mbus_add_window_remap_flags("pci0.0", ORION5X_PCI_IO_PHYS_BASE, 237 ORION_MBUS_PCI_IO_ATTR,
238 ORION5X_PCI_IO_PHYS_BASE,
234 ORION5X_PCI_IO_SIZE, 239 ORION5X_PCI_IO_SIZE,
235 ORION5X_PCI_IO_BUS_BASE, 240 ORION5X_PCI_IO_BUS_BASE);
236 MVEBU_MBUS_PCI_IO); 241 mvebu_mbus_add_window_by_id(ORION_MBUS_PCI_MEM_TARGET,
237 mvebu_mbus_add_window_remap_flags("pci0.0", ORION5X_PCI_MEM_PHYS_BASE, 242 ORION_MBUS_PCI_MEM_ATTR,
238 ORION5X_PCI_MEM_SIZE, 243 ORION5X_PCI_MEM_PHYS_BASE,
239 MVEBU_MBUS_NO_REMAP, 244 ORION5X_PCI_MEM_SIZE);
240 MVEBU_MBUS_PCI_MEM);
241} 245}
242 246
243int orion5x_tclk; 247int orion5x_tclk;
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
index a909afb384fb..f565f9944af2 100644
--- a/arch/arm/mach-orion5x/common.h
+++ b/arch/arm/mach-orion5x/common.h
@@ -7,6 +7,23 @@ struct dsa_platform_data;
7struct mv643xx_eth_platform_data; 7struct mv643xx_eth_platform_data;
8struct mv_sata_platform_data; 8struct mv_sata_platform_data;
9 9
10#define ORION_MBUS_PCIE_MEM_TARGET 0x04
11#define ORION_MBUS_PCIE_MEM_ATTR 0x59
12#define ORION_MBUS_PCIE_IO_TARGET 0x04
13#define ORION_MBUS_PCIE_IO_ATTR 0x51
14#define ORION_MBUS_PCIE_WA_TARGET 0x04
15#define ORION_MBUS_PCIE_WA_ATTR 0x79
16#define ORION_MBUS_PCI_MEM_TARGET 0x03
17#define ORION_MBUS_PCI_MEM_ATTR 0x59
18#define ORION_MBUS_PCI_IO_TARGET 0x03
19#define ORION_MBUS_PCI_IO_ATTR 0x51
20#define ORION_MBUS_DEVBUS_BOOT_TARGET 0x01
21#define ORION_MBUS_DEVBUS_BOOT_ATTR 0x0f
22#define ORION_MBUS_DEVBUS_TARGET(cs) 0x01
23#define ORION_MBUS_DEVBUS_ATTR(cs) (~(1 << cs))
24#define ORION_MBUS_SRAM_TARGET 0x00
25#define ORION_MBUS_SRAM_ATTR 0x00
26
10/* 27/*
11 * Basic Orion init functions used early by machine-setup. 28 * Basic Orion init functions used early by machine-setup.
12 */ 29 */
diff --git a/arch/arm/mach-orion5x/d2net-setup.c b/arch/arm/mach-orion5x/d2net-setup.c
index 16c88bbabc98..8f68b745c1d5 100644
--- a/arch/arm/mach-orion5x/d2net-setup.c
+++ b/arch/arm/mach-orion5x/d2net-setup.c
@@ -317,8 +317,10 @@ static void __init d2net_init(void)
317 d2net_sata_power_init(); 317 d2net_sata_power_init();
318 orion5x_sata_init(&d2net_sata_data); 318 orion5x_sata_init(&d2net_sata_data);
319 319
320 mvebu_mbus_add_window("devbus-boot", D2NET_NOR_BOOT_BASE, 320 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
321 D2NET_NOR_BOOT_SIZE); 321 ORION_MBUS_DEVBUS_BOOT_ATTR,
322 D2NET_NOR_BOOT_BASE,
323 D2NET_NOR_BOOT_SIZE);
322 platform_device_register(&d2net_nor_flash); 324 platform_device_register(&d2net_nor_flash);
323 325
324 platform_device_register(&d2net_gpio_buttons); 326 platform_device_register(&d2net_gpio_buttons);
diff --git a/arch/arm/mach-orion5x/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index 4e1263da38bb..4b2aefd1d961 100644
--- a/arch/arm/mach-orion5x/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -340,19 +340,27 @@ static void __init db88f5281_init(void)
340 orion5x_uart0_init(); 340 orion5x_uart0_init();
341 orion5x_uart1_init(); 341 orion5x_uart1_init();
342 342
343 mvebu_mbus_add_window("devbus-boot", DB88F5281_NOR_BOOT_BASE, 343 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
344 DB88F5281_NOR_BOOT_SIZE); 344 ORION_MBUS_DEVBUS_BOOT_ATTR,
345 DB88F5281_NOR_BOOT_BASE,
346 DB88F5281_NOR_BOOT_SIZE);
345 platform_device_register(&db88f5281_boot_flash); 347 platform_device_register(&db88f5281_boot_flash);
346 348
347 mvebu_mbus_add_window("devbus-cs0", DB88F5281_7SEG_BASE, 349 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0),
348 DB88F5281_7SEG_SIZE); 350 ORION_MBUS_DEVBUS_ATTR(0),
351 DB88F5281_7SEG_BASE,
352 DB88F5281_7SEG_SIZE);
349 353
350 mvebu_mbus_add_window("devbus-cs1", DB88F5281_NOR_BASE, 354 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(1),
351 DB88F5281_NOR_SIZE); 355 ORION_MBUS_DEVBUS_ATTR(1),
356 DB88F5281_NOR_BASE,
357 DB88F5281_NOR_SIZE);
352 platform_device_register(&db88f5281_nor_flash); 358 platform_device_register(&db88f5281_nor_flash);
353 359
354 mvebu_mbus_add_window("devbus-cs2", DB88F5281_NAND_BASE, 360 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(2),
355 DB88F5281_NAND_SIZE); 361 ORION_MBUS_DEVBUS_ATTR(2),
362 DB88F5281_NAND_BASE,
363 DB88F5281_NAND_SIZE);
356 platform_device_register(&db88f5281_nand_flash); 364 platform_device_register(&db88f5281_nand_flash);
357 365
358 i2c_register_board_info(0, &db88f5281_i2c_rtc, 1); 366 i2c_register_board_info(0, &db88f5281_i2c_rtc, 1);
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 9e6baf581ed3..70974732cbf0 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -611,8 +611,10 @@ static void __init dns323_init(void)
611 /* setup flash mapping 611 /* setup flash mapping
612 * CS3 holds a 8 MB Spansion S29GL064M90TFIR4 612 * CS3 holds a 8 MB Spansion S29GL064M90TFIR4
613 */ 613 */
614 mvebu_mbus_add_window("devbus-boot", DNS323_NOR_BOOT_BASE, 614 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
615 DNS323_NOR_BOOT_SIZE); 615 ORION_MBUS_DEVBUS_BOOT_ATTR,
616 DNS323_NOR_BOOT_BASE,
617 DNS323_NOR_BOOT_SIZE);
616 platform_device_register(&dns323_nor_flash); 618 platform_device_register(&dns323_nor_flash);
617 619
618 /* Sort out LEDs, Buttons and i2c devices */ 620 /* Sort out LEDs, Buttons and i2c devices */
diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c
index 147615510dd0..0fc33c56cbb7 100644
--- a/arch/arm/mach-orion5x/edmini_v2-setup.c
+++ b/arch/arm/mach-orion5x/edmini_v2-setup.c
@@ -154,8 +154,10 @@ void __init edmini_v2_init(void)
154 orion5x_ehci0_init(); 154 orion5x_ehci0_init();
155 orion5x_eth_init(&edmini_v2_eth_data); 155 orion5x_eth_init(&edmini_v2_eth_data);
156 156
157 mvebu_mbus_add_window("devbus-boot", EDMINI_V2_NOR_BOOT_BASE, 157 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
158 EDMINI_V2_NOR_BOOT_SIZE); 158 ORION_MBUS_DEVBUS_BOOT_ATTR,
159 EDMINI_V2_NOR_BOOT_BASE,
160 EDMINI_V2_NOR_BOOT_SIZE);
159 platform_device_register(&edmini_v2_nor_flash); 161 platform_device_register(&edmini_v2_nor_flash);
160 162
161 pr_notice("edmini_v2: USB device port, flash write and power-off " 163 pr_notice("edmini_v2: USB device port, flash write and power-off "
diff --git a/arch/arm/mach-orion5x/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index aae10e4a917c..fe6a48a325e8 100644
--- a/arch/arm/mach-orion5x/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -359,13 +359,17 @@ static void __init kurobox_pro_init(void)
359 orion5x_uart1_init(); 359 orion5x_uart1_init();
360 orion5x_xor_init(); 360 orion5x_xor_init();
361 361
362 mvebu_mbus_add_window("devbus-boot", KUROBOX_PRO_NOR_BOOT_BASE, 362 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
363 KUROBOX_PRO_NOR_BOOT_SIZE); 363 ORION_MBUS_DEVBUS_BOOT_ATTR,
364 KUROBOX_PRO_NOR_BOOT_BASE,
365 KUROBOX_PRO_NOR_BOOT_SIZE);
364 platform_device_register(&kurobox_pro_nor_flash); 366 platform_device_register(&kurobox_pro_nor_flash);
365 367
366 if (machine_is_kurobox_pro()) { 368 if (machine_is_kurobox_pro()) {
367 mvebu_mbus_add_window("devbus-cs0", KUROBOX_PRO_NAND_BASE, 369 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0),
368 KUROBOX_PRO_NAND_SIZE); 370 ORION_MBUS_DEVBUS_ATTR(0),
371 KUROBOX_PRO_NAND_BASE,
372 KUROBOX_PRO_NAND_SIZE);
369 platform_device_register(&kurobox_pro_nand_flash); 373 platform_device_register(&kurobox_pro_nand_flash);
370 } 374 }
371 375
diff --git a/arch/arm/mach-orion5x/ls-chl-setup.c b/arch/arm/mach-orion5x/ls-chl-setup.c
index 6234977b5aea..028ea038d404 100644
--- a/arch/arm/mach-orion5x/ls-chl-setup.c
+++ b/arch/arm/mach-orion5x/ls-chl-setup.c
@@ -294,8 +294,10 @@ static void __init lschl_init(void)
294 orion5x_uart0_init(); 294 orion5x_uart0_init();
295 orion5x_xor_init(); 295 orion5x_xor_init();
296 296
297 mvebu_mbus_add_window("devbus-boot", LSCHL_NOR_BOOT_BASE, 297 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
298 LSCHL_NOR_BOOT_SIZE); 298 ORION_MBUS_DEVBUS_BOOT_ATTR,
299 LSCHL_NOR_BOOT_BASE,
300 LSCHL_NOR_BOOT_SIZE);
299 platform_device_register(&lschl_nor_flash); 301 platform_device_register(&lschl_nor_flash);
300 302
301 platform_device_register(&lschl_leds); 303 platform_device_register(&lschl_leds);
diff --git a/arch/arm/mach-orion5x/ls_hgl-setup.c b/arch/arm/mach-orion5x/ls_hgl-setup.c
index fe04c4b64569..32b7129b767d 100644
--- a/arch/arm/mach-orion5x/ls_hgl-setup.c
+++ b/arch/arm/mach-orion5x/ls_hgl-setup.c
@@ -243,8 +243,10 @@ static void __init ls_hgl_init(void)
243 orion5x_uart0_init(); 243 orion5x_uart0_init();
244 orion5x_xor_init(); 244 orion5x_xor_init();
245 245
246 mvebu_mbus_add_window("devbus-boot", LS_HGL_NOR_BOOT_BASE, 246 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
247 LS_HGL_NOR_BOOT_SIZE); 247 ORION_MBUS_DEVBUS_BOOT_ATTR,
248 LS_HGL_NOR_BOOT_BASE,
249 LS_HGL_NOR_BOOT_SIZE);
248 platform_device_register(&ls_hgl_nor_flash); 250 platform_device_register(&ls_hgl_nor_flash);
249 251
250 platform_device_register(&ls_hgl_button_device); 252 platform_device_register(&ls_hgl_button_device);
diff --git a/arch/arm/mach-orion5x/lsmini-setup.c b/arch/arm/mach-orion5x/lsmini-setup.c
index ca4dbe973daf..a6493e76f96d 100644
--- a/arch/arm/mach-orion5x/lsmini-setup.c
+++ b/arch/arm/mach-orion5x/lsmini-setup.c
@@ -244,8 +244,10 @@ static void __init lsmini_init(void)
244 orion5x_uart0_init(); 244 orion5x_uart0_init();
245 orion5x_xor_init(); 245 orion5x_xor_init();
246 246
247 mvebu_mbus_add_window("devbus-boot", LSMINI_NOR_BOOT_BASE, 247 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
248 LSMINI_NOR_BOOT_SIZE); 248 ORION_MBUS_DEVBUS_BOOT_ATTR,
249 LSMINI_NOR_BOOT_BASE,
250 LSMINI_NOR_BOOT_SIZE);
249 platform_device_register(&lsmini_nor_flash); 251 platform_device_register(&lsmini_nor_flash);
250 252
251 platform_device_register(&lsmini_button_device); 253 platform_device_register(&lsmini_button_device);
diff --git a/arch/arm/mach-orion5x/mss2-setup.c b/arch/arm/mach-orion5x/mss2-setup.c
index 827acbafc9dc..e105130ba51c 100644
--- a/arch/arm/mach-orion5x/mss2-setup.c
+++ b/arch/arm/mach-orion5x/mss2-setup.c
@@ -241,8 +241,10 @@ static void __init mss2_init(void)
241 orion5x_uart0_init(); 241 orion5x_uart0_init();
242 orion5x_xor_init(); 242 orion5x_xor_init();
243 243
244 mvebu_mbus_add_window("devbus-boot", MSS2_NOR_BOOT_BASE, 244 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
245 MSS2_NOR_BOOT_SIZE); 245 ORION_MBUS_DEVBUS_BOOT_ATTR,
246 MSS2_NOR_BOOT_BASE,
247 MSS2_NOR_BOOT_SIZE);
246 platform_device_register(&mss2_nor_flash); 248 platform_device_register(&mss2_nor_flash);
247 249
248 platform_device_register(&mss2_button_device); 250 platform_device_register(&mss2_button_device);
diff --git a/arch/arm/mach-orion5x/mv2120-setup.c b/arch/arm/mach-orion5x/mv2120-setup.c
index 92600ae2b4b6..e032f01da49e 100644
--- a/arch/arm/mach-orion5x/mv2120-setup.c
+++ b/arch/arm/mach-orion5x/mv2120-setup.c
@@ -204,8 +204,10 @@ static void __init mv2120_init(void)
204 orion5x_uart0_init(); 204 orion5x_uart0_init();
205 orion5x_xor_init(); 205 orion5x_xor_init();
206 206
207 mvebu_mbus_add_window("devbus-boot", MV2120_NOR_BOOT_BASE, 207 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
208 MV2120_NOR_BOOT_SIZE); 208 ORION_MBUS_DEVBUS_BOOT_ATTR,
209 MV2120_NOR_BOOT_BASE,
210 MV2120_NOR_BOOT_SIZE);
209 platform_device_register(&mv2120_nor_flash); 211 platform_device_register(&mv2120_nor_flash);
210 212
211 platform_device_register(&mv2120_button_device); 213 platform_device_register(&mv2120_button_device);
diff --git a/arch/arm/mach-orion5x/net2big-setup.c b/arch/arm/mach-orion5x/net2big-setup.c
index dd0641a0d074..ba73dc7ffb9e 100644
--- a/arch/arm/mach-orion5x/net2big-setup.c
+++ b/arch/arm/mach-orion5x/net2big-setup.c
@@ -397,8 +397,10 @@ static void __init net2big_init(void)
397 net2big_sata_power_init(); 397 net2big_sata_power_init();
398 orion5x_sata_init(&net2big_sata_data); 398 orion5x_sata_init(&net2big_sata_data);
399 399
400 mvebu_mbus_add_window("devbus-boot", NET2BIG_NOR_BOOT_BASE, 400 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
401 NET2BIG_NOR_BOOT_SIZE); 401 ORION_MBUS_DEVBUS_BOOT_ATTR,
402 NET2BIG_NOR_BOOT_BASE,
403 NET2BIG_NOR_BOOT_SIZE);
402 platform_device_register(&net2big_nor_flash); 404 platform_device_register(&net2big_nor_flash);
403 405
404 platform_device_register(&net2big_gpio_buttons); 406 platform_device_register(&net2big_gpio_buttons);
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index 503368023bb1..7fab67053030 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -157,11 +157,10 @@ static int __init pcie_setup(struct pci_sys_data *sys)
157 if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) { 157 if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
158 printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config " 158 printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
159 "read transaction workaround\n"); 159 "read transaction workaround\n");
160 mvebu_mbus_add_window_remap_flags("pcie0.0", 160 mvebu_mbus_add_window_by_id(ORION_MBUS_PCIE_WA_TARGET,
161 ORION5X_PCIE_WA_PHYS_BASE, 161 ORION_MBUS_PCIE_WA_ATTR,
162 ORION5X_PCIE_WA_SIZE, 162 ORION5X_PCIE_WA_PHYS_BASE,
163 MVEBU_MBUS_NO_REMAP, 163 ORION5X_PCIE_WA_SIZE);
164 MVEBU_MBUS_PCI_WA);
165 pcie_ops.read = pcie_rd_conf_wa; 164 pcie_ops.read = pcie_rd_conf_wa;
166 } 165 }
167 166
diff --git a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
index 1c4498bf650a..213b3e143c57 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-fxo-setup.c
@@ -123,8 +123,10 @@ static void __init rd88f5181l_fxo_init(void)
123 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ); 123 orion5x_eth_switch_init(&rd88f5181l_fxo_switch_plat_data, NO_IRQ);
124 orion5x_uart0_init(); 124 orion5x_uart0_init();
125 125
126 mvebu_mbus_add_window("devbus-boot", RD88F5181L_FXO_NOR_BOOT_BASE, 126 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
127 RD88F5181L_FXO_NOR_BOOT_SIZE); 127 ORION_MBUS_DEVBUS_BOOT_ATTR,
128 RD88F5181L_FXO_NOR_BOOT_BASE,
129 RD88F5181L_FXO_NOR_BOOT_SIZE);
128 platform_device_register(&rd88f5181l_fxo_nor_boot_flash); 130 platform_device_register(&rd88f5181l_fxo_nor_boot_flash);
129} 131}
130 132
diff --git a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
index adabe34c4fc6..594800e1d691 100644
--- a/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5181l-ge-setup.c
@@ -130,8 +130,10 @@ static void __init rd88f5181l_ge_init(void)
130 orion5x_i2c_init(); 130 orion5x_i2c_init();
131 orion5x_uart0_init(); 131 orion5x_uart0_init();
132 132
133 mvebu_mbus_add_window("devbus-boot", RD88F5181L_GE_NOR_BOOT_BASE, 133 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
134 RD88F5181L_GE_NOR_BOOT_SIZE); 134 ORION_MBUS_DEVBUS_BOOT_ATTR,
135 RD88F5181L_GE_NOR_BOOT_BASE,
136 RD88F5181L_GE_NOR_BOOT_SIZE);
135 platform_device_register(&rd88f5181l_ge_nor_boot_flash); 137 platform_device_register(&rd88f5181l_ge_nor_boot_flash);
136 138
137 i2c_register_board_info(0, &rd88f5181l_ge_i2c_rtc, 1); 139 i2c_register_board_info(0, &rd88f5181l_ge_i2c_rtc, 1);
diff --git a/arch/arm/mach-orion5x/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index 66e77ec91532..b1cf68493ffc 100644
--- a/arch/arm/mach-orion5x/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -264,11 +264,14 @@ static void __init rd88f5182_init(void)
264 orion5x_uart0_init(); 264 orion5x_uart0_init();
265 orion5x_xor_init(); 265 orion5x_xor_init();
266 266
267 mvebu_mbus_add_window("devbus-boot", RD88F5182_NOR_BOOT_BASE, 267 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
268 RD88F5182_NOR_BOOT_SIZE); 268 ORION_MBUS_DEVBUS_BOOT_ATTR,
269 269 RD88F5182_NOR_BOOT_BASE,
270 mvebu_mbus_add_window("devbus-cs1", RD88F5182_NOR_BASE, 270 RD88F5182_NOR_BOOT_SIZE);
271 RD88F5182_NOR_SIZE); 271 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(1),
272 ORION_MBUS_DEVBUS_ATTR(1),
273 RD88F5182_NOR_BASE,
274 RD88F5182_NOR_SIZE);
272 platform_device_register(&rd88f5182_nor_flash); 275 platform_device_register(&rd88f5182_nor_flash);
273 platform_device_register(&rd88f5182_gpio_leds); 276 platform_device_register(&rd88f5182_gpio_leds);
274 277
diff --git a/arch/arm/mach-orion5x/terastation_pro2-setup.c b/arch/arm/mach-orion5x/terastation_pro2-setup.c
index a0bfa53e7556..7e9064844698 100644
--- a/arch/arm/mach-orion5x/terastation_pro2-setup.c
+++ b/arch/arm/mach-orion5x/terastation_pro2-setup.c
@@ -329,8 +329,10 @@ static void __init tsp2_init(void)
329 /* 329 /*
330 * Configure peripherals. 330 * Configure peripherals.
331 */ 331 */
332 mvebu_mbus_add_window("devbus-boot", TSP2_NOR_BOOT_BASE, 332 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
333 TSP2_NOR_BOOT_SIZE); 333 ORION_MBUS_DEVBUS_BOOT_ATTR,
334 TSP2_NOR_BOOT_BASE,
335 TSP2_NOR_BOOT_SIZE);
334 platform_device_register(&tsp2_nor_flash); 336 platform_device_register(&tsp2_nor_flash);
335 337
336 orion5x_ehci0_init(); 338 orion5x_ehci0_init();
diff --git a/arch/arm/mach-orion5x/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 80174f0f168e..e90c0618fdad 100644
--- a/arch/arm/mach-orion5x/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -286,8 +286,10 @@ static void __init qnap_ts209_init(void)
286 /* 286 /*
287 * Configure peripherals. 287 * Configure peripherals.
288 */ 288 */
289 mvebu_mbus_add_window("devbus-boot", QNAP_TS209_NOR_BOOT_BASE, 289 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
290 QNAP_TS209_NOR_BOOT_SIZE); 290 ORION_MBUS_DEVBUS_BOOT_ATTR,
291 QNAP_TS209_NOR_BOOT_BASE,
292 QNAP_TS209_NOR_BOOT_SIZE);
291 platform_device_register(&qnap_ts209_nor_flash); 293 platform_device_register(&qnap_ts209_nor_flash);
292 294
293 orion5x_ehci0_init(); 295 orion5x_ehci0_init();
diff --git a/arch/arm/mach-orion5x/ts409-setup.c b/arch/arm/mach-orion5x/ts409-setup.c
index 92592790d6da..5c079d312015 100644
--- a/arch/arm/mach-orion5x/ts409-setup.c
+++ b/arch/arm/mach-orion5x/ts409-setup.c
@@ -277,8 +277,10 @@ static void __init qnap_ts409_init(void)
277 /* 277 /*
278 * Configure peripherals. 278 * Configure peripherals.
279 */ 279 */
280 mvebu_mbus_add_window("devbus-boot", QNAP_TS409_NOR_BOOT_BASE, 280 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
281 QNAP_TS409_NOR_BOOT_SIZE); 281 ORION_MBUS_DEVBUS_BOOT_ATTR,
282 QNAP_TS409_NOR_BOOT_BASE,
283 QNAP_TS409_NOR_BOOT_SIZE);
282 platform_device_register(&qnap_ts409_nor_flash); 284 platform_device_register(&qnap_ts409_nor_flash);
283 285
284 orion5x_ehci0_init(); 286 orion5x_ehci0_init();
diff --git a/arch/arm/mach-orion5x/wnr854t-setup.c b/arch/arm/mach-orion5x/wnr854t-setup.c
index 6b84863c018d..80a56ee245b3 100644
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -127,8 +127,10 @@ static void __init wnr854t_init(void)
127 orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ); 127 orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
128 orion5x_uart0_init(); 128 orion5x_uart0_init();
129 129
130 mvebu_mbus_add_window("devbus-boot", WNR854T_NOR_BOOT_BASE, 130 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
131 WNR854T_NOR_BOOT_SIZE); 131 ORION_MBUS_DEVBUS_BOOT_ATTR,
132 WNR854T_NOR_BOOT_BASE,
133 WNR854T_NOR_BOOT_SIZE);
132 platform_device_register(&wnr854t_nor_flash); 134 platform_device_register(&wnr854t_nor_flash);
133} 135}
134 136
diff --git a/arch/arm/mach-orion5x/wrt350n-v2-setup.c b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
index fae684bc54f2..670e30dc0d1b 100644
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -213,8 +213,10 @@ static void __init wrt350n_v2_init(void)
213 orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ); 213 orion5x_eth_switch_init(&wrt350n_v2_switch_plat_data, NO_IRQ);
214 orion5x_uart0_init(); 214 orion5x_uart0_init();
215 215
216 mvebu_mbus_add_window("devbus-boot", WRT350N_V2_NOR_BOOT_BASE, 216 mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
217 WRT350N_V2_NOR_BOOT_SIZE); 217 ORION_MBUS_DEVBUS_BOOT_ATTR,
218 WRT350N_V2_NOR_BOOT_BASE,
219 WRT350N_V2_NOR_BOOT_SIZE);
218 platform_device_register(&wrt350n_v2_nor_flash); 220 platform_device_register(&wrt350n_v2_nor_flash);
219 platform_device_register(&wrt350n_v2_leds); 221 platform_device_register(&wrt350n_v2_leds);
220 platform_device_register(&wrt350n_v2_button_device); 222 platform_device_register(&wrt350n_v2_button_device);
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 33c6947eebec..19ab6ff53d59 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -35,13 +35,9 @@
35 * 35 *
36 * - Provides an API for platform code or device drivers to 36 * - Provides an API for platform code or device drivers to
37 * dynamically add or remove address decoding windows for the CPU -> 37 * dynamically add or remove address decoding windows for the CPU ->
38 * device accesses. This API is mvebu_mbus_add_window(), 38 * device accesses. This API is mvebu_mbus_add_window_by_id(),
39 * mvebu_mbus_add_window_remap_flags() and 39 * mvebu_mbus_add_window_remap_by_id() and
40 * mvebu_mbus_del_window(). Since the (target, attribute) values 40 * mvebu_mbus_del_window().
41 * differ from one SoC family to another, the API uses a 'const char
42 * *' string to identify devices, and this driver is responsible for
43 * knowing the mapping between the name of a device and its
44 * corresponding (target, attribute) in the current SoC family.
45 * 41 *
46 * - Provides a debugfs interface in /sys/kernel/debug/mvebu-mbus/ to 42 * - Provides a debugfs interface in /sys/kernel/debug/mvebu-mbus/ to
47 * see the list of CPU -> SDRAM windows and their configuration 43 * see the list of CPU -> SDRAM windows and their configuration
@@ -97,33 +93,6 @@
97 93
98#define DOVE_DDR_BASE_CS_OFF(n) ((n) << 4) 94#define DOVE_DDR_BASE_CS_OFF(n) ((n) << 4)
99 95
100struct mvebu_mbus_mapping {
101 const char *name;
102 u8 target;
103 u8 attr;
104 u8 attrmask;
105};
106
107/*
108 * Masks used for the 'attrmask' field of mvebu_mbus_mapping. They
109 * allow to get the real attribute value, discarding the special bits
110 * used to select a PCI MEM region or a PCI WA region. This allows the
111 * debugfs code to reverse-match the name of a device from its
112 * target/attr values.
113 *
114 * For all devices except PCI, all bits of 'attr' must be
115 * considered. For most SoCs, only bit 3 should be ignored (it allows
116 * to select between PCI MEM and PCI I/O). On Orion5x however, there
117 * is the special bit 5 to select a PCI WA region.
118 */
119#define MAPDEF_NOMASK 0xff
120#define MAPDEF_PCIMASK 0xf7
121#define MAPDEF_ORIONPCIMASK 0xd7
122
123/* Macro used to define one mvebu_mbus_mapping entry */
124#define MAPDEF(__n, __t, __a, __m) \
125 { .name = __n, .target = __t, .attr = __a, .attrmask = __m }
126
127struct mvebu_mbus_state; 96struct mvebu_mbus_state;
128 97
129struct mvebu_mbus_soc_data { 98struct mvebu_mbus_soc_data {
@@ -133,7 +102,6 @@ struct mvebu_mbus_soc_data {
133 void (*setup_cpu_target)(struct mvebu_mbus_state *s); 102 void (*setup_cpu_target)(struct mvebu_mbus_state *s);
134 int (*show_cpu_target)(struct mvebu_mbus_state *s, 103 int (*show_cpu_target)(struct mvebu_mbus_state *s,
135 struct seq_file *seq, void *v); 104 struct seq_file *seq, void *v);
136 const struct mvebu_mbus_mapping *map;
137}; 105};
138 106
139struct mvebu_mbus_state { 107struct mvebu_mbus_state {
@@ -142,6 +110,8 @@ struct mvebu_mbus_state {
142 struct dentry *debugfs_root; 110 struct dentry *debugfs_root;
143 struct dentry *debugfs_sdram; 111 struct dentry *debugfs_sdram;
144 struct dentry *debugfs_devs; 112 struct dentry *debugfs_devs;
113 struct resource pcie_mem_aperture;
114 struct resource pcie_io_aperture;
145 const struct mvebu_mbus_soc_data *soc; 115 const struct mvebu_mbus_soc_data *soc;
146 int hw_io_coherency; 116 int hw_io_coherency;
147}; 117};
@@ -428,8 +398,7 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
428 u64 wbase, wremap; 398 u64 wbase, wremap;
429 u32 wsize; 399 u32 wsize;
430 u8 wtarget, wattr; 400 u8 wtarget, wattr;
431 int enabled, i; 401 int enabled;
432 const char *name;
433 402
434 mvebu_mbus_read_window(mbus, win, 403 mvebu_mbus_read_window(mbus, win,
435 &enabled, &wbase, &wsize, 404 &enabled, &wbase, &wsize,
@@ -440,18 +409,9 @@ static int mvebu_devs_debug_show(struct seq_file *seq, void *v)
440 continue; 409 continue;
441 } 410 }
442 411
443 412 seq_printf(seq, "[%02d] %016llx - %016llx : %04x:%04x",
444 for (i = 0; mbus->soc->map[i].name; i++)
445 if (mbus->soc->map[i].target == wtarget &&
446 mbus->soc->map[i].attr ==
447 (wattr & mbus->soc->map[i].attrmask))
448 break;
449
450 name = mbus->soc->map[i].name ?: "unknown";
451
452 seq_printf(seq, "[%02d] %016llx - %016llx : %s",
453 win, (unsigned long long)wbase, 413 win, (unsigned long long)wbase,
454 (unsigned long long)(wbase + wsize), name); 414 (unsigned long long)(wbase + wsize), wtarget, wattr);
455 415
456 if (win < mbus->soc->num_remappable_wins) { 416 if (win < mbus->soc->num_remappable_wins) {
457 seq_printf(seq, " (remap %016llx)\n", 417 seq_printf(seq, " (remap %016llx)\n",
@@ -576,62 +536,12 @@ mvebu_mbus_dove_setup_cpu_target(struct mvebu_mbus_state *mbus)
576 mvebu_mbus_dram_info.num_cs = cs; 536 mvebu_mbus_dram_info.num_cs = cs;
577} 537}
578 538
579static const struct mvebu_mbus_mapping armada_370_map[] = { 539static const struct mvebu_mbus_soc_data armada_370_xp_mbus_data = {
580 MAPDEF("bootrom", 1, 0xe0, MAPDEF_NOMASK),
581 MAPDEF("devbus-boot", 1, 0x2f, MAPDEF_NOMASK),
582 MAPDEF("devbus-cs0", 1, 0x3e, MAPDEF_NOMASK),
583 MAPDEF("devbus-cs1", 1, 0x3d, MAPDEF_NOMASK),
584 MAPDEF("devbus-cs2", 1, 0x3b, MAPDEF_NOMASK),
585 MAPDEF("devbus-cs3", 1, 0x37, MAPDEF_NOMASK),
586 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
587 MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
588 {},
589};
590
591static const struct mvebu_mbus_soc_data armada_370_mbus_data = {
592 .num_wins = 20, 540 .num_wins = 20,
593 .num_remappable_wins = 8, 541 .num_remappable_wins = 8,
594 .win_cfg_offset = armada_370_xp_mbus_win_offset, 542 .win_cfg_offset = armada_370_xp_mbus_win_offset,
595 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target, 543 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
596 .show_cpu_target = mvebu_sdram_debug_show_orion, 544 .show_cpu_target = mvebu_sdram_debug_show_orion,
597 .map = armada_370_map,
598};
599
600static const struct mvebu_mbus_mapping armada_xp_map[] = {
601 MAPDEF("bootrom", 1, 0x1d, MAPDEF_NOMASK),
602 MAPDEF("devbus-boot", 1, 0x2f, MAPDEF_NOMASK),
603 MAPDEF("devbus-cs0", 1, 0x3e, MAPDEF_NOMASK),
604 MAPDEF("devbus-cs1", 1, 0x3d, MAPDEF_NOMASK),
605 MAPDEF("devbus-cs2", 1, 0x3b, MAPDEF_NOMASK),
606 MAPDEF("devbus-cs3", 1, 0x37, MAPDEF_NOMASK),
607 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
608 MAPDEF("pcie0.1", 4, 0xd0, MAPDEF_PCIMASK),
609 MAPDEF("pcie0.2", 4, 0xb0, MAPDEF_PCIMASK),
610 MAPDEF("pcie0.3", 4, 0x70, MAPDEF_PCIMASK),
611 MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
612 MAPDEF("pcie1.1", 8, 0xd0, MAPDEF_PCIMASK),
613 MAPDEF("pcie1.2", 8, 0xb0, MAPDEF_PCIMASK),
614 MAPDEF("pcie1.3", 8, 0x70, MAPDEF_PCIMASK),
615 MAPDEF("pcie2.0", 4, 0xf0, MAPDEF_PCIMASK),
616 MAPDEF("pcie3.0", 8, 0xf0, MAPDEF_PCIMASK),
617 {},
618};
619
620static const struct mvebu_mbus_soc_data armada_xp_mbus_data = {
621 .num_wins = 20,
622 .num_remappable_wins = 8,
623 .win_cfg_offset = armada_370_xp_mbus_win_offset,
624 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
625 .show_cpu_target = mvebu_sdram_debug_show_orion,
626 .map = armada_xp_map,
627};
628
629static const struct mvebu_mbus_mapping kirkwood_map[] = {
630 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
631 MAPDEF("pcie1.0", 4, 0xd0, MAPDEF_PCIMASK),
632 MAPDEF("sram", 3, 0x01, MAPDEF_NOMASK),
633 MAPDEF("nand", 1, 0x2f, MAPDEF_NOMASK),
634 {},
635}; 545};
636 546
637static const struct mvebu_mbus_soc_data kirkwood_mbus_data = { 547static const struct mvebu_mbus_soc_data kirkwood_mbus_data = {
@@ -640,16 +550,6 @@ static const struct mvebu_mbus_soc_data kirkwood_mbus_data = {
640 .win_cfg_offset = orion_mbus_win_offset, 550 .win_cfg_offset = orion_mbus_win_offset,
641 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target, 551 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
642 .show_cpu_target = mvebu_sdram_debug_show_orion, 552 .show_cpu_target = mvebu_sdram_debug_show_orion,
643 .map = kirkwood_map,
644};
645
646static const struct mvebu_mbus_mapping dove_map[] = {
647 MAPDEF("pcie0.0", 0x4, 0xe0, MAPDEF_PCIMASK),
648 MAPDEF("pcie1.0", 0x8, 0xe0, MAPDEF_PCIMASK),
649 MAPDEF("cesa", 0x3, 0x01, MAPDEF_NOMASK),
650 MAPDEF("bootrom", 0x1, 0xfd, MAPDEF_NOMASK),
651 MAPDEF("scratchpad", 0xd, 0x0, MAPDEF_NOMASK),
652 {},
653}; 553};
654 554
655static const struct mvebu_mbus_soc_data dove_mbus_data = { 555static const struct mvebu_mbus_soc_data dove_mbus_data = {
@@ -658,18 +558,6 @@ static const struct mvebu_mbus_soc_data dove_mbus_data = {
658 .win_cfg_offset = orion_mbus_win_offset, 558 .win_cfg_offset = orion_mbus_win_offset,
659 .setup_cpu_target = mvebu_mbus_dove_setup_cpu_target, 559 .setup_cpu_target = mvebu_mbus_dove_setup_cpu_target,
660 .show_cpu_target = mvebu_sdram_debug_show_dove, 560 .show_cpu_target = mvebu_sdram_debug_show_dove,
661 .map = dove_map,
662};
663
664static const struct mvebu_mbus_mapping orion5x_map[] = {
665 MAPDEF("pcie0.0", 4, 0x51, MAPDEF_ORIONPCIMASK),
666 MAPDEF("pci0.0", 3, 0x51, MAPDEF_ORIONPCIMASK),
667 MAPDEF("devbus-boot", 1, 0x0f, MAPDEF_NOMASK),
668 MAPDEF("devbus-cs0", 1, 0x1e, MAPDEF_NOMASK),
669 MAPDEF("devbus-cs1", 1, 0x1d, MAPDEF_NOMASK),
670 MAPDEF("devbus-cs2", 1, 0x1b, MAPDEF_NOMASK),
671 MAPDEF("sram", 0, 0x00, MAPDEF_NOMASK),
672 {},
673}; 561};
674 562
675/* 563/*
@@ -682,7 +570,6 @@ static const struct mvebu_mbus_soc_data orion5x_4win_mbus_data = {
682 .win_cfg_offset = orion_mbus_win_offset, 570 .win_cfg_offset = orion_mbus_win_offset,
683 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target, 571 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
684 .show_cpu_target = mvebu_sdram_debug_show_orion, 572 .show_cpu_target = mvebu_sdram_debug_show_orion,
685 .map = orion5x_map,
686}; 573};
687 574
688static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = { 575static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = {
@@ -691,21 +578,6 @@ static const struct mvebu_mbus_soc_data orion5x_2win_mbus_data = {
691 .win_cfg_offset = orion_mbus_win_offset, 578 .win_cfg_offset = orion_mbus_win_offset,
692 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target, 579 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
693 .show_cpu_target = mvebu_sdram_debug_show_orion, 580 .show_cpu_target = mvebu_sdram_debug_show_orion,
694 .map = orion5x_map,
695};
696
697static const struct mvebu_mbus_mapping mv78xx0_map[] = {
698 MAPDEF("pcie0.0", 4, 0xe0, MAPDEF_PCIMASK),
699 MAPDEF("pcie0.1", 4, 0xd0, MAPDEF_PCIMASK),
700 MAPDEF("pcie0.2", 4, 0xb0, MAPDEF_PCIMASK),
701 MAPDEF("pcie0.3", 4, 0x70, MAPDEF_PCIMASK),
702 MAPDEF("pcie1.0", 8, 0xe0, MAPDEF_PCIMASK),
703 MAPDEF("pcie1.1", 8, 0xd0, MAPDEF_PCIMASK),
704 MAPDEF("pcie1.2", 8, 0xb0, MAPDEF_PCIMASK),
705 MAPDEF("pcie1.3", 8, 0x70, MAPDEF_PCIMASK),
706 MAPDEF("pcie2.0", 4, 0xf0, MAPDEF_PCIMASK),
707 MAPDEF("pcie3.0", 8, 0xf0, MAPDEF_PCIMASK),
708 {},
709}; 581};
710 582
711static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = { 583static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
@@ -714,7 +586,6 @@ static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
714 .win_cfg_offset = mv78xx0_mbus_win_offset, 586 .win_cfg_offset = mv78xx0_mbus_win_offset,
715 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target, 587 .setup_cpu_target = mvebu_mbus_default_setup_cpu_target,
716 .show_cpu_target = mvebu_sdram_debug_show_orion, 588 .show_cpu_target = mvebu_sdram_debug_show_orion,
717 .map = mv78xx0_map,
718}; 589};
719 590
720/* 591/*
@@ -725,9 +596,9 @@ static const struct mvebu_mbus_soc_data mv78xx0_mbus_data = {
725 */ 596 */
726static const struct of_device_id of_mvebu_mbus_ids[] = { 597static const struct of_device_id of_mvebu_mbus_ids[] = {
727 { .compatible = "marvell,armada370-mbus", 598 { .compatible = "marvell,armada370-mbus",
728 .data = &armada_370_mbus_data, }, 599 .data = &armada_370_xp_mbus_data, },
729 { .compatible = "marvell,armadaxp-mbus", 600 { .compatible = "marvell,armadaxp-mbus",
730 .data = &armada_xp_mbus_data, }, 601 .data = &armada_370_xp_mbus_data, },
731 { .compatible = "marvell,kirkwood-mbus", 602 { .compatible = "marvell,kirkwood-mbus",
732 .data = &kirkwood_mbus_data, }, 603 .data = &kirkwood_mbus_data, },
733 { .compatible = "marvell,dove-mbus", 604 { .compatible = "marvell,dove-mbus",
@@ -748,48 +619,27 @@ static const struct of_device_id of_mvebu_mbus_ids[] = {
748/* 619/*
749 * Public API of the driver 620 * Public API of the driver
750 */ 621 */
751int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base, 622int mvebu_mbus_add_window_remap_by_id(unsigned int target,
752 size_t size, phys_addr_t remap, 623 unsigned int attribute,
753 unsigned int flags) 624 phys_addr_t base, size_t size,
625 phys_addr_t remap)
754{ 626{
755 struct mvebu_mbus_state *s = &mbus_state; 627 struct mvebu_mbus_state *s = &mbus_state;
756 u8 target, attr;
757 int i;
758
759 if (!s->soc->map)
760 return -ENODEV;
761
762 for (i = 0; s->soc->map[i].name; i++)
763 if (!strcmp(s->soc->map[i].name, devname))
764 break;
765
766 if (!s->soc->map[i].name) {
767 pr_err("unknown device '%s'\n", devname);
768 return -ENODEV;
769 }
770
771 target = s->soc->map[i].target;
772 attr = s->soc->map[i].attr;
773
774 if (flags == MVEBU_MBUS_PCI_MEM)
775 attr |= 0x8;
776 else if (flags == MVEBU_MBUS_PCI_WA)
777 attr |= 0x28;
778 628
779 if (!mvebu_mbus_window_conflicts(s, base, size, target, attr)) { 629 if (!mvebu_mbus_window_conflicts(s, base, size, target, attribute)) {
780 pr_err("cannot add window '%s', conflicts with another window\n", 630 pr_err("cannot add window '%x:%x', conflicts with another window\n",
781 devname); 631 target, attribute);
782 return -EINVAL; 632 return -EINVAL;
783 } 633 }
784 634
785 return mvebu_mbus_alloc_window(s, base, size, remap, target, attr); 635 return mvebu_mbus_alloc_window(s, base, size, remap, target, attribute);
786
787} 636}
788 637
789int mvebu_mbus_add_window(const char *devname, phys_addr_t base, size_t size) 638int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute,
639 phys_addr_t base, size_t size)
790{ 640{
791 return mvebu_mbus_add_window_remap_flags(devname, base, size, 641 return mvebu_mbus_add_window_remap_by_id(target, attribute, base,
792 MVEBU_MBUS_NO_REMAP, 0); 642 size, MVEBU_MBUS_NO_REMAP);
793} 643}
794 644
795int mvebu_mbus_del_window(phys_addr_t base, size_t size) 645int mvebu_mbus_del_window(phys_addr_t base, size_t size)
@@ -804,6 +654,20 @@ int mvebu_mbus_del_window(phys_addr_t base, size_t size)
804 return 0; 654 return 0;
805} 655}
806 656
657void mvebu_mbus_get_pcie_mem_aperture(struct resource *res)
658{
659 if (!res)
660 return;
661 *res = mbus_state.pcie_mem_aperture;
662}
663
664void mvebu_mbus_get_pcie_io_aperture(struct resource *res)
665{
666 if (!res)
667 return;
668 *res = mbus_state.pcie_io_aperture;
669}
670
807static __init int mvebu_mbus_debugfs_init(void) 671static __init int mvebu_mbus_debugfs_init(void)
808{ 672{
809 struct mvebu_mbus_state *s = &mbus_state; 673 struct mvebu_mbus_state *s = &mbus_state;
@@ -830,14 +694,41 @@ static __init int mvebu_mbus_debugfs_init(void)
830} 694}
831fs_initcall(mvebu_mbus_debugfs_init); 695fs_initcall(mvebu_mbus_debugfs_init);
832 696
697static int __init mvebu_mbus_common_init(struct mvebu_mbus_state *mbus,
698 phys_addr_t mbuswins_phys_base,
699 size_t mbuswins_size,
700 phys_addr_t sdramwins_phys_base,
701 size_t sdramwins_size)
702{
703 int win;
704
705 mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size);
706 if (!mbus->mbuswins_base)
707 return -ENOMEM;
708
709 mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size);
710 if (!mbus->sdramwins_base) {
711 iounmap(mbus_state.mbuswins_base);
712 return -ENOMEM;
713 }
714
715 if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"))
716 mbus->hw_io_coherency = 1;
717
718 for (win = 0; win < mbus->soc->num_wins; win++)
719 mvebu_mbus_disable_window(mbus, win);
720
721 mbus->soc->setup_cpu_target(mbus);
722
723 return 0;
724}
725
833int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base, 726int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base,
834 size_t mbuswins_size, 727 size_t mbuswins_size,
835 phys_addr_t sdramwins_phys_base, 728 phys_addr_t sdramwins_phys_base,
836 size_t sdramwins_size) 729 size_t sdramwins_size)
837{ 730{
838 struct mvebu_mbus_state *mbus = &mbus_state;
839 const struct of_device_id *of_id; 731 const struct of_device_id *of_id;
840 int win;
841 732
842 for (of_id = of_mvebu_mbus_ids; of_id->compatible; of_id++) 733 for (of_id = of_mvebu_mbus_ids; of_id->compatible; of_id++)
843 if (!strcmp(of_id->compatible, soc)) 734 if (!strcmp(of_id->compatible, soc))
@@ -848,25 +739,201 @@ int __init mvebu_mbus_init(const char *soc, phys_addr_t mbuswins_phys_base,
848 return -ENODEV; 739 return -ENODEV;
849 } 740 }
850 741
851 mbus->soc = of_id->data; 742 mbus_state.soc = of_id->data;
852 743
853 mbus->mbuswins_base = ioremap(mbuswins_phys_base, mbuswins_size); 744 return mvebu_mbus_common_init(&mbus_state,
854 if (!mbus->mbuswins_base) 745 mbuswins_phys_base,
855 return -ENOMEM; 746 mbuswins_size,
747 sdramwins_phys_base,
748 sdramwins_size);
749}
856 750
857 mbus->sdramwins_base = ioremap(sdramwins_phys_base, sdramwins_size); 751#ifdef CONFIG_OF
858 if (!mbus->sdramwins_base) { 752/*
859 iounmap(mbus_state.mbuswins_base); 753 * The window IDs in the ranges DT property have the following format:
754 * - bits 28 to 31: MBus custom field
755 * - bits 24 to 27: window target ID
756 * - bits 16 to 23: window attribute ID
757 * - bits 0 to 15: unused
758 */
759#define CUSTOM(id) (((id) & 0xF0000000) >> 24)
760#define TARGET(id) (((id) & 0x0F000000) >> 24)
761#define ATTR(id) (((id) & 0x00FF0000) >> 16)
762
763static int __init mbus_dt_setup_win(struct mvebu_mbus_state *mbus,
764 u32 base, u32 size,
765 u8 target, u8 attr)
766{
767 if (!mvebu_mbus_window_conflicts(mbus, base, size, target, attr)) {
768 pr_err("cannot add window '%04x:%04x', conflicts with another window\n",
769 target, attr);
770 return -EBUSY;
771 }
772
773 if (mvebu_mbus_alloc_window(mbus, base, size, MVEBU_MBUS_NO_REMAP,
774 target, attr)) {
775 pr_err("cannot add window '%04x:%04x', too many windows\n",
776 target, attr);
860 return -ENOMEM; 777 return -ENOMEM;
861 } 778 }
779 return 0;
780}
862 781
863 if (of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric")) 782static int __init
864 mbus->hw_io_coherency = 1; 783mbus_parse_ranges(struct device_node *node,
784 int *addr_cells, int *c_addr_cells, int *c_size_cells,
785 int *cell_count, const __be32 **ranges_start,
786 const __be32 **ranges_end)
787{
788 const __be32 *prop;
789 int ranges_len, tuple_len;
790
791 /* Allow a node with no 'ranges' property */
792 *ranges_start = of_get_property(node, "ranges", &ranges_len);
793 if (*ranges_start == NULL) {
794 *addr_cells = *c_addr_cells = *c_size_cells = *cell_count = 0;
795 *ranges_start = *ranges_end = NULL;
796 return 0;
797 }
798 *ranges_end = *ranges_start + ranges_len / sizeof(__be32);
865 799
866 for (win = 0; win < mbus->soc->num_wins; win++) 800 *addr_cells = of_n_addr_cells(node);
867 mvebu_mbus_disable_window(mbus, win);
868 801
869 mbus->soc->setup_cpu_target(mbus); 802 prop = of_get_property(node, "#address-cells", NULL);
803 *c_addr_cells = be32_to_cpup(prop);
804
805 prop = of_get_property(node, "#size-cells", NULL);
806 *c_size_cells = be32_to_cpup(prop);
807
808 *cell_count = *addr_cells + *c_addr_cells + *c_size_cells;
809 tuple_len = (*cell_count) * sizeof(__be32);
810
811 if (ranges_len % tuple_len) {
812 pr_warn("malformed ranges entry '%s'\n", node->name);
813 return -EINVAL;
814 }
815 return 0;
816}
817
818static int __init mbus_dt_setup(struct mvebu_mbus_state *mbus,
819 struct device_node *np)
820{
821 int addr_cells, c_addr_cells, c_size_cells;
822 int i, ret, cell_count;
823 const __be32 *r, *ranges_start, *ranges_end;
824
825 ret = mbus_parse_ranges(np, &addr_cells, &c_addr_cells,
826 &c_size_cells, &cell_count,
827 &ranges_start, &ranges_end);
828 if (ret < 0)
829 return ret;
830
831 for (i = 0, r = ranges_start; r < ranges_end; r += cell_count, i++) {
832 u32 windowid, base, size;
833 u8 target, attr;
834
835 /*
836 * An entry with a non-zero custom field do not
837 * correspond to a static window, so skip it.
838 */
839 windowid = of_read_number(r, 1);
840 if (CUSTOM(windowid))
841 continue;
842
843 target = TARGET(windowid);
844 attr = ATTR(windowid);
870 845
846 base = of_read_number(r + c_addr_cells, addr_cells);
847 size = of_read_number(r + c_addr_cells + addr_cells,
848 c_size_cells);
849 ret = mbus_dt_setup_win(mbus, base, size, target, attr);
850 if (ret < 0)
851 return ret;
852 }
871 return 0; 853 return 0;
872} 854}
855
856static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
857 struct resource *mem,
858 struct resource *io)
859{
860 u32 reg[2];
861 int ret;
862
863 /*
864 * These are optional, so we clear them and they'll
865 * be zero if they are missing from the DT.
866 */
867 memset(mem, 0, sizeof(struct resource));
868 memset(io, 0, sizeof(struct resource));
869
870 ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
871 if (!ret) {
872 mem->start = reg[0];
873 mem->end = mem->start + reg[1];
874 mem->flags = IORESOURCE_MEM;
875 }
876
877 ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg));
878 if (!ret) {
879 io->start = reg[0];
880 io->end = io->start + reg[1];
881 io->flags = IORESOURCE_IO;
882 }
883}
884
885int __init mvebu_mbus_dt_init(void)
886{
887 struct resource mbuswins_res, sdramwins_res;
888 struct device_node *np, *controller;
889 const struct of_device_id *of_id;
890 const __be32 *prop;
891 int ret;
892
893 np = of_find_matching_node(NULL, of_mvebu_mbus_ids);
894 if (!np) {
895 pr_err("could not find a matching SoC family\n");
896 return -ENODEV;
897 }
898
899 of_id = of_match_node(of_mvebu_mbus_ids, np);
900 mbus_state.soc = of_id->data;
901
902 prop = of_get_property(np, "controller", NULL);
903 if (!prop) {
904 pr_err("required 'controller' property missing\n");
905 return -EINVAL;
906 }
907
908 controller = of_find_node_by_phandle(be32_to_cpup(prop));
909 if (!controller) {
910 pr_err("could not find an 'mbus-controller' node\n");
911 return -ENODEV;
912 }
913
914 if (of_address_to_resource(controller, 0, &mbuswins_res)) {
915 pr_err("cannot get MBUS register address\n");
916 return -EINVAL;
917 }
918
919 if (of_address_to_resource(controller, 1, &sdramwins_res)) {
920 pr_err("cannot get SDRAM register address\n");
921 return -EINVAL;
922 }
923
924 /* Get optional pcie-{mem,io}-aperture properties */
925 mvebu_mbus_get_pcie_resources(np, &mbus_state.pcie_mem_aperture,
926 &mbus_state.pcie_io_aperture);
927
928 ret = mvebu_mbus_common_init(&mbus_state,
929 mbuswins_res.start,
930 resource_size(&mbuswins_res),
931 sdramwins_res.start,
932 resource_size(&sdramwins_res));
933 if (ret)
934 return ret;
935
936 /* Setup statically declared windows in the DT */
937 return mbus_dt_setup(&mbus_state, np);
938}
939#endif
diff --git a/drivers/memory/mvebu-devbus.c b/drivers/memory/mvebu-devbus.c
index 978e8e3abc5c..110c03627051 100644
--- a/drivers/memory/mvebu-devbus.c
+++ b/drivers/memory/mvebu-devbus.c
@@ -44,14 +44,6 @@
44#define READ_PARAM_OFFSET 0x0 44#define READ_PARAM_OFFSET 0x0
45#define WRITE_PARAM_OFFSET 0x4 45#define WRITE_PARAM_OFFSET 0x4
46 46
47static const char * const devbus_wins[] = {
48 "devbus-boot",
49 "devbus-cs0",
50 "devbus-cs1",
51 "devbus-cs2",
52 "devbus-cs3",
53};
54
55struct devbus_read_params { 47struct devbus_read_params {
56 u32 bus_width; 48 u32 bus_width;
57 u32 badr_skew; 49 u32 badr_skew;
@@ -208,16 +200,11 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
208{ 200{
209 struct device *dev = &pdev->dev; 201 struct device *dev = &pdev->dev;
210 struct device_node *node = pdev->dev.of_node; 202 struct device_node *node = pdev->dev.of_node;
211 struct device_node *parent;
212 struct devbus *devbus; 203 struct devbus *devbus;
213 struct resource *res; 204 struct resource *res;
214 struct clk *clk; 205 struct clk *clk;
215 unsigned long rate; 206 unsigned long rate;
216 const __be32 *ranges; 207 int err;
217 int err, cs;
218 int addr_cells, p_addr_cells, size_cells;
219 int ranges_len, tuple_len;
220 u32 base, size;
221 208
222 devbus = devm_kzalloc(&pdev->dev, sizeof(struct devbus), GFP_KERNEL); 209 devbus = devm_kzalloc(&pdev->dev, sizeof(struct devbus), GFP_KERNEL);
223 if (!devbus) 210 if (!devbus)
@@ -248,68 +235,13 @@ static int mvebu_devbus_probe(struct platform_device *pdev)
248 return err; 235 return err;
249 236
250 /* 237 /*
251 * Allocate an address window for this device.
252 * If the device probing fails, then we won't be able to
253 * remove the allocated address decoding window.
254 *
255 * FIXME: This is only a temporary hack! We need to do this here
256 * because we still don't have device tree bindings for mbus.
257 * Once that support is added, we will declare these address windows
258 * statically in the device tree, and remove the window configuration
259 * from here.
260 */
261
262 /*
263 * Get the CS to choose the window string.
264 * This is a bit hacky, but it will be removed once the
265 * address windows are declared in the device tree.
266 */
267 cs = (((unsigned long)devbus->base) % 0x400) / 8;
268
269 /*
270 * Parse 'ranges' property to obtain a (base,size) window tuple.
271 * This will be removed once the address windows
272 * are declared in the device tree.
273 */
274 parent = of_get_parent(node);
275 if (!parent)
276 return -EINVAL;
277
278 p_addr_cells = of_n_addr_cells(parent);
279 of_node_put(parent);
280
281 addr_cells = of_n_addr_cells(node);
282 size_cells = of_n_size_cells(node);
283 tuple_len = (p_addr_cells + addr_cells + size_cells) * sizeof(__be32);
284
285 ranges = of_get_property(node, "ranges", &ranges_len);
286 if (ranges == NULL || ranges_len != tuple_len)
287 return -EINVAL;
288
289 base = of_translate_address(node, ranges + addr_cells);
290 if (base == OF_BAD_ADDR)
291 return -EINVAL;
292 size = of_read_number(ranges + addr_cells + p_addr_cells, size_cells);
293
294 /*
295 * Create an mbus address windows.
296 * FIXME: Remove this, together with the above code, once the
297 * address windows are declared in the device tree.
298 */
299 err = mvebu_mbus_add_window(devbus_wins[cs], base, size);
300 if (err < 0)
301 return err;
302
303 /*
304 * We need to create a child device explicitly from here to 238 * We need to create a child device explicitly from here to
305 * guarantee that the child will be probed after the timing 239 * guarantee that the child will be probed after the timing
306 * parameters for the bus are written. 240 * parameters for the bus are written.
307 */ 241 */
308 err = of_platform_populate(node, NULL, NULL, dev); 242 err = of_platform_populate(node, NULL, NULL, dev);
309 if (err < 0) { 243 if (err < 0)
310 mvebu_mbus_del_window(base, size);
311 return err; 244 return err;
312 }
313 245
314 return 0; 246 return 0;
315} 247}
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 13a633b1612e..338691b616d9 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -123,6 +123,10 @@ struct mvebu_pcie_port {
123 u32 port; 123 u32 port;
124 u32 lane; 124 u32 lane;
125 int devfn; 125 int devfn;
126 unsigned int mem_target;
127 unsigned int mem_attr;
128 unsigned int io_target;
129 unsigned int io_attr;
126 struct clk *clk; 130 struct clk *clk;
127 struct mvebu_sw_pci_bridge bridge; 131 struct mvebu_sw_pci_bridge bridge;
128 struct device_node *dn; 132 struct device_node *dn;
@@ -307,10 +311,9 @@ static void mvebu_pcie_handle_iobase_change(struct mvebu_pcie_port *port)
307 (port->bridge.iolimitupper << 16)) - 311 (port->bridge.iolimitupper << 16)) -
308 iobase); 312 iobase);
309 313
310 mvebu_mbus_add_window_remap_flags(port->name, port->iowin_base, 314 mvebu_mbus_add_window_remap_by_id(port->io_target, port->io_attr,
311 port->iowin_size, 315 port->iowin_base, port->iowin_size,
312 iobase, 316 iobase);
313 MVEBU_MBUS_PCI_IO);
314 317
315 pci_ioremap_io(iobase, port->iowin_base); 318 pci_ioremap_io(iobase, port->iowin_base);
316} 319}
@@ -342,10 +345,8 @@ static void mvebu_pcie_handle_membase_change(struct mvebu_pcie_port *port)
342 (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) - 345 (((port->bridge.memlimit & 0xFFF0) << 16) | 0xFFFFF) -
343 port->memwin_base; 346 port->memwin_base;
344 347
345 mvebu_mbus_add_window_remap_flags(port->name, port->memwin_base, 348 mvebu_mbus_add_window_by_id(port->mem_target, port->mem_attr,
346 port->memwin_size, 349 port->memwin_base, port->memwin_size);
347 MVEBU_MBUS_NO_REMAP,
348 MVEBU_MBUS_PCI_MEM);
349} 350}
350 351
351/* 352/*
@@ -661,6 +662,8 @@ static int __init mvebu_pcie_setup(int nr, struct pci_sys_data *sys)
661 662
662 for (i = 0; i < pcie->nports; i++) { 663 for (i = 0; i < pcie->nports; i++) {
663 struct mvebu_pcie_port *port = &pcie->ports[i]; 664 struct mvebu_pcie_port *port = &pcie->ports[i];
665 if (!port->base)
666 continue;
664 mvebu_pcie_setup_hw(port); 667 mvebu_pcie_setup_hw(port);
665 } 668 }
666 669
@@ -755,12 +758,54 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
755 return devm_request_and_ioremap(&pdev->dev, &regs); 758 return devm_request_and_ioremap(&pdev->dev, &regs);
756} 759}
757 760
761#define DT_FLAGS_TO_TYPE(flags) (((flags) >> 24) & 0x03)
762#define DT_TYPE_IO 0x1
763#define DT_TYPE_MEM32 0x2
764#define DT_CPUADDR_TO_TARGET(cpuaddr) (((cpuaddr) >> 56) & 0xFF)
765#define DT_CPUADDR_TO_ATTR(cpuaddr) (((cpuaddr) >> 48) & 0xFF)
766
767static int mvebu_get_tgt_attr(struct device_node *np, int devfn,
768 unsigned long type, int *tgt, int *attr)
769{
770 const int na = 3, ns = 2;
771 const __be32 *range;
772 int rlen, nranges, rangesz, pna, i;
773
774 range = of_get_property(np, "ranges", &rlen);
775 if (!range)
776 return -EINVAL;
777
778 pna = of_n_addr_cells(np);
779 rangesz = pna + na + ns;
780 nranges = rlen / sizeof(__be32) / rangesz;
781
782 for (i = 0; i < nranges; i++) {
783 u32 flags = of_read_number(range, 1);
784 u32 slot = of_read_number(range, 2);
785 u64 cpuaddr = of_read_number(range + na, pna);
786 unsigned long rtype;
787
788 if (DT_FLAGS_TO_TYPE(flags) == DT_TYPE_IO)
789 rtype = IORESOURCE_IO;
790 else if (DT_FLAGS_TO_TYPE(flags) == DT_TYPE_MEM32)
791 rtype = IORESOURCE_MEM;
792
793 if (slot == PCI_SLOT(devfn) && type == rtype) {
794 *tgt = DT_CPUADDR_TO_TARGET(cpuaddr);
795 *attr = DT_CPUADDR_TO_ATTR(cpuaddr);
796 return 0;
797 }
798
799 range += rangesz;
800 }
801
802 return -ENOENT;
803}
804
758static int __init mvebu_pcie_probe(struct platform_device *pdev) 805static int __init mvebu_pcie_probe(struct platform_device *pdev)
759{ 806{
760 struct mvebu_pcie *pcie; 807 struct mvebu_pcie *pcie;
761 struct device_node *np = pdev->dev.of_node; 808 struct device_node *np = pdev->dev.of_node;
762 struct of_pci_range range;
763 struct of_pci_range_parser parser;
764 struct device_node *child; 809 struct device_node *child;
765 int i, ret; 810 int i, ret;
766 811
@@ -771,29 +816,25 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
771 816
772 pcie->pdev = pdev; 817 pcie->pdev = pdev;
773 818
774 if (of_pci_range_parser_init(&parser, np)) 819 /* Get the PCIe memory and I/O aperture */
820 mvebu_mbus_get_pcie_mem_aperture(&pcie->mem);
821 if (resource_size(&pcie->mem) == 0) {
822 dev_err(&pdev->dev, "invalid memory aperture size\n");
775 return -EINVAL; 823 return -EINVAL;
824 }
776 825
777 /* Get the I/O and memory ranges from DT */ 826 mvebu_mbus_get_pcie_io_aperture(&pcie->io);
778 for_each_of_pci_range(&parser, &range) { 827 if (resource_size(&pcie->io) == 0) {
779 unsigned long restype = range.flags & IORESOURCE_TYPE_BITS; 828 dev_err(&pdev->dev, "invalid I/O aperture size\n");
780 if (restype == IORESOURCE_IO) { 829 return -EINVAL;
781 of_pci_range_to_resource(&range, np, &pcie->io);
782 of_pci_range_to_resource(&range, np, &pcie->realio);
783 pcie->io.name = "I/O";
784 pcie->realio.start = max_t(resource_size_t,
785 PCIBIOS_MIN_IO,
786 range.pci_addr);
787 pcie->realio.end = min_t(resource_size_t,
788 IO_SPACE_LIMIT,
789 range.pci_addr + range.size);
790 }
791 if (restype == IORESOURCE_MEM) {
792 of_pci_range_to_resource(&range, np, &pcie->mem);
793 pcie->mem.name = "MEM";
794 }
795 } 830 }
796 831
832 pcie->realio.flags = pcie->io.flags;
833 pcie->realio.start = PCIBIOS_MIN_IO;
834 pcie->realio.end = min_t(resource_size_t,
835 IO_SPACE_LIMIT,
836 resource_size(&pcie->io));
837
797 /* Get the bus range */ 838 /* Get the bus range */
798 ret = of_pci_parse_bus_range(np, &pcie->busn); 839 ret = of_pci_parse_bus_range(np, &pcie->busn);
799 if (ret) { 840 if (ret) {
@@ -841,6 +882,22 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
841 if (port->devfn < 0) 882 if (port->devfn < 0)
842 continue; 883 continue;
843 884
885 ret = mvebu_get_tgt_attr(np, port->devfn, IORESOURCE_MEM,
886 &port->mem_target, &port->mem_attr);
887 if (ret < 0) {
888 dev_err(&pdev->dev, "PCIe%d.%d: cannot get tgt/attr for mem window\n",
889 port->port, port->lane);
890 continue;
891 }
892
893 ret = mvebu_get_tgt_attr(np, port->devfn, IORESOURCE_IO,
894 &port->io_target, &port->io_attr);
895 if (ret < 0) {
896 dev_err(&pdev->dev, "PCIe%d.%d: cannot get tgt/attr for io window\n",
897 port->port, port->lane);
898 continue;
899 }
900
844 port->base = mvebu_pcie_map_registers(pdev, child, port); 901 port->base = mvebu_pcie_map_registers(pdev, child, port);
845 if (!port->base) { 902 if (!port->base) {
846 dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n", 903 dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index dba482e31a13..345b8c53b897 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -11,6 +11,8 @@
11#ifndef __LINUX_MBUS_H 11#ifndef __LINUX_MBUS_H
12#define __LINUX_MBUS_H 12#define __LINUX_MBUS_H
13 13
14struct resource;
15
14struct mbus_dram_target_info 16struct mbus_dram_target_info
15{ 17{
16 /* 18 /*
@@ -59,14 +61,18 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
59} 61}
60#endif 62#endif
61 63
62int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base, 64void mvebu_mbus_get_pcie_mem_aperture(struct resource *res);
63 size_t size, phys_addr_t remap, 65void mvebu_mbus_get_pcie_io_aperture(struct resource *res);
64 unsigned int flags); 66int mvebu_mbus_add_window_remap_by_id(unsigned int target,
65int mvebu_mbus_add_window(const char *devname, phys_addr_t base, 67 unsigned int attribute,
66 size_t size); 68 phys_addr_t base, size_t size,
69 phys_addr_t remap);
70int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute,
71 phys_addr_t base, size_t size);
67int mvebu_mbus_del_window(phys_addr_t base, size_t size); 72int mvebu_mbus_del_window(phys_addr_t base, size_t size);
68int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base, 73int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base,
69 size_t mbus_size, phys_addr_t sdram_phys_base, 74 size_t mbus_size, phys_addr_t sdram_phys_base,
70 size_t sdram_size); 75 size_t sdram_size);
76int mvebu_mbus_dt_init(void);
71 77
72#endif /* __LINUX_MBUS_H */ 78#endif /* __LINUX_MBUS_H */