base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0056-ARM-mvebu-Add-MBus-to-Armada-370-XP-device-tree.patch
1 From 8298866bfa7fe9c1e33055322c415f612c16a477 Mon Sep 17 00:00:00 2001
2 From: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
3 Date: Tue, 28 May 2013 08:56:04 -0300
4 Subject: [PATCH 056/203] ARM: mvebu: Add MBus to Armada 370/XP device tree
5
6 The Armada 370/XP SoC family has a completely configurable address
7 space handled by the MBus controller.
8
9 This patch introduces the device tree layout of MBus, making the
10 'soc' node as mbus-compatible.
11 Since every peripheral/controller is a child of this 'soc' node,
12 this makes all of them sit behind the mbus, thus describing the
13 hardware accurately.
14
15 A translation entry has been added for the internal-regs mapping.
16 This can't be done in the common armada-370-xp.dtsi because A370
17 and AXP have different addressing width.
18
19 Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
20 Tested-by: Andrew Lunn <andrew@lunn.ch>
21 Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
22 ---
23  arch/arm/boot/dts/armada-370-db.dts              |  2 ++
24  arch/arm/boot/dts/armada-370-mirabox.dts         |  2 ++
25  arch/arm/boot/dts/armada-370-rd.dts              |  2 ++
26  arch/arm/boot/dts/armada-370-xp.dtsi             | 15 ++++++++++-----
27  arch/arm/boot/dts/armada-370.dtsi                |  4 ++--
28  arch/arm/boot/dts/armada-xp-db.dts               |  4 +---
29  arch/arm/boot/dts/armada-xp-gp.dts               |  4 +---
30  arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts |  4 +---
31  arch/arm/boot/dts/armada-xp.dtsi                 |  2 ++
32  9 files changed, 23 insertions(+), 16 deletions(-)
33
34 --- a/arch/arm/boot/dts/armada-370-db.dts
35 +++ b/arch/arm/boot/dts/armada-370-db.dts
36 @@ -30,6 +30,8 @@
37         };
38  
39         soc {
40 +               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000>;
41 +
42                 internal-regs {
43                         serial@12000 {
44                                 clock-frequency = <200000000>;
45 --- a/arch/arm/boot/dts/armada-370-mirabox.dts
46 +++ b/arch/arm/boot/dts/armada-370-mirabox.dts
47 @@ -25,6 +25,8 @@
48         };
49  
50         soc {
51 +               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000>;
52 +
53                 internal-regs {
54                         serial@12000 {
55                                 clock-frequency = <200000000>;
56 --- a/arch/arm/boot/dts/armada-370-rd.dts
57 +++ b/arch/arm/boot/dts/armada-370-rd.dts
58 @@ -28,6 +28,8 @@
59         };
60  
61         soc {
62 +               ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000>;
63 +
64                 internal-regs {
65                         serial@12000 {
66                                 clock-frequency = <200000000>;
67 --- a/arch/arm/boot/dts/armada-370-xp.dtsi
68 +++ b/arch/arm/boot/dts/armada-370-xp.dtsi
69 @@ -18,6 +18,8 @@
70  
71  /include/ "skeleton64.dtsi"
72  
73 +#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
74 +
75  / {
76         model = "Marvell Armada 370 and XP SoC";
77         compatible = "marvell,armada-370-xp";
78 @@ -29,18 +31,21 @@
79         };
80  
81         soc {
82 -               #address-cells = <1>;
83 +               #address-cells = <2>;
84                 #size-cells = <1>;
85 -               compatible = "simple-bus";
86 +               controller = <&mbusc>;
87                 interrupt-parent = <&mpic>;
88 -               ranges = <0          0 0xd0000000 0x0100000 /* internal registers */
89 -                         0xe0000000 0 0xe0000000 0x8100000 /* PCIe */>;
90  
91                 internal-regs {
92                         compatible = "simple-bus";
93                         #address-cells = <1>;
94                         #size-cells = <1>;
95 -                       ranges;
96 +                       ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
97 +
98 +                       mbusc: mbus-controller@20000 {
99 +                               compatible = "marvell,mbus-controller";
100 +                               reg = <0x20000 0x100>, <0x20180 0x20>;
101 +                       };
102  
103                         mpic: interrupt-controller@20000 {
104                                 compatible = "marvell,mpic";
105 --- a/arch/arm/boot/dts/armada-370.dtsi
106 +++ b/arch/arm/boot/dts/armada-370.dtsi
107 @@ -29,8 +29,8 @@
108         };
109  
110         soc {
111 -               ranges = <0          0xd0000000 0x0100000 /* internal registers */
112 -                         0xe0000000 0xe0000000 0x8100000 /* PCIe */>;
113 +               compatible = "marvell,armada370-mbus", "simple-bus";
114 +
115                 internal-regs {
116                         system-controller@18200 {
117                                 compatible = "marvell,armada-370-xp-system-controller";
118 --- a/arch/arm/boot/dts/armada-xp-db.dts
119 +++ b/arch/arm/boot/dts/armada-xp-db.dts
120 @@ -30,9 +30,7 @@
121         };
122  
123         soc {
124 -               ranges = <0          0 0xd0000000 0x100000      /* Internal registers 1MiB */
125 -                         0xe0000000 0 0xe0000000 0x8100000     /* PCIe */
126 -                         0xf0000000 0 0xf0000000 0x1000000>;   /* Device Bus, NOR 16MiB   */
127 +               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000>;
128  
129                 internal-regs {
130                         serial@12000 {
131 --- a/arch/arm/boot/dts/armada-xp-gp.dts
132 +++ b/arch/arm/boot/dts/armada-xp-gp.dts
133 @@ -39,9 +39,7 @@
134         };
135  
136         soc {
137 -               ranges = <0          0 0xd0000000 0x100000  /* Internal registers 1MiB */
138 -                         0xe0000000 0 0xe0000000 0x8100000 /* PCIe */
139 -                         0xf0000000 0 0xf0000000 0x1000000 /* Device Bus, NOR 16MiB  */>;
140 +               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000>;
141  
142                 internal-regs {
143                         serial@12000 {
144 --- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
145 +++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
146 @@ -27,9 +27,7 @@
147         };
148  
149         soc {
150 -               ranges = <0          0 0xd0000000 0x100000      /* Internal registers 1MiB */
151 -                         0xe0000000 0 0xe0000000 0x8100000     /* PCIe */
152 -                         0xf0000000 0 0xf0000000 0x8000000     /* Device Bus, NOR 128MiB   */>;
153 +               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xd0000000 0x100000>;
154  
155                 internal-regs {
156                         serial@12000 {
157 --- a/arch/arm/boot/dts/armada-xp.dtsi
158 +++ b/arch/arm/boot/dts/armada-xp.dtsi
159 @@ -23,6 +23,8 @@
160         compatible = "marvell,armadaxp", "marvell,armada-370-xp";
161  
162         soc {
163 +               compatible = "marvell,armadaxp-mbus", "simple-bus";
164 +
165                 internal-regs {
166                         L2: l2-cache {
167                                 compatible = "marvell,aurora-system-cache";