aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Moll <pawel.moll@arm.com>2012-10-16 10:27:12 -0400
committerPawel Moll <pawel.moll@arm.com>2012-11-05 12:09:52 -0500
commit433683a66401adb0150792e725cc4f631c94de46 (patch)
treea820c2b4faddc6109e449a21b551b4a18339c287
parent38669e045dbf8f62a008898a7fb1e93975b3817c (diff)
ARM: vexpress: Remove motherboard dependencies in the DTS files
The way the VE motherboard Device Trees were constructed enforced naming and structure of daughterboard files. This patch makes it possible to simply include the motherboard description anywhere in the main Device Tree and retires the "arm,v2m-timer" alias - any of the motherboard SP804 timers will be used instead. Signed-off-by: Pawel Moll <pawel.moll@arm.com>
-rw-r--r--Documentation/devicetree/bindings/arm/vexpress.txt32
-rw-r--r--arch/arm/boot/dts/vexpress-v2m-rs1.dtsi11
-rw-r--r--arch/arm/boot/dts/vexpress-v2m.dtsi11
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts11
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts11
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca5s.dts11
-rw-r--r--arch/arm/boot/dts/vexpress-v2p-ca9.dts11
-rw-r--r--arch/arm/mach-vexpress/v2m.c19
8 files changed, 73 insertions, 44 deletions
diff --git a/Documentation/devicetree/bindings/arm/vexpress.txt b/Documentation/devicetree/bindings/arm/vexpress.txt
index 5d9996b9eabf..ae49161e478a 100644
--- a/Documentation/devicetree/bindings/arm/vexpress.txt
+++ b/Documentation/devicetree/bindings/arm/vexpress.txt
@@ -141,14 +141,19 @@ can be used to obtain required phandle in the tile's "aliases" node:
141- SP804 timers: 141- SP804 timers:
142 v2m_timer01 and v2m_timer23 142 v2m_timer01 and v2m_timer23
143 143
144Current Linux implementation requires a "arm,v2m_timer" alias 144The tile description should define a "smb" node, describing the
145pointing at one of the motherboard's SP804 timers, if it is to be 145Static Memory Bus between the tile and motherboard. It must define
146used as the system timer. This alias should be defined in the 146the following properties:
147motherboard files. 147- "simple-bus" compatible value (to ensure creation of the children)
148 148 compatible = "simple-bus";
149The tile description must define "ranges", "interrupt-map-mask" and 149- mapping of the SMB CS/offset addresses into main address space:
150"interrupt-map" properties to translate the motherboard's address 150 #address-cells = <2>;
151and interrupt space into one used by the tile's processor. 151 #size-cells = <1>;
152 ranges = <...>;
153- interrupts mapping:
154 #interrupt-cells = <1>;
155 interrupt-map-mask = <0 0 63>;
156 interrupt-map = <...>;
152 157
153 158
154Example of a VE tile description (simplified) 159Example of a VE tile description (simplified)
@@ -200,13 +205,20 @@ Example of a VE tile description (simplified)
200 }; 205 };
201 }; 206 };
202 207
203 motherboard { 208 smb {
209 compatible = "simple-bus";
210
211 #address-cells = <2>;
212 #size-cells = <1>;
204 /* CS0 is visible at 0x08000000 */ 213 /* CS0 is visible at 0x08000000 */
205 ranges = <0 0 0x08000000 0x04000000>; 214 ranges = <0 0 0x08000000 0x04000000>;
215
216 #interrupt-cells = <1>;
206 interrupt-map-mask = <0 0 63>; 217 interrupt-map-mask = <0 0 63>;
207 /* Active high IRQ 0 is connected to GIC's SPI0 */ 218 /* Active high IRQ 0 is connected to GIC's SPI0 */
208 interrupt-map = <0 0 0 &gic 0 0 4>; 219 interrupt-map = <0 0 0 &gic 0 0 4>;
220
221 /include/ "vexpress-v2m-rs1.dtsi"
209 }; 222 };
210}; 223};
211 224
212/include/ "vexpress-v2m-rs1.dtsi"
diff --git a/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi b/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
index 9a7b6922f83b..ac870fb3fa0d 100644
--- a/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
+++ b/arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
@@ -17,18 +17,16 @@
17 * CHANGES TO vexpress-v2m.dtsi! 17 * CHANGES TO vexpress-v2m.dtsi!
18 */ 18 */
19 19
20/ {
21 aliases {
22 arm,v2m_timer = &v2m_timer01;
23 };
24
25 motherboard { 20 motherboard {
26 compatible = "simple-bus"; 21 model = "V2M-P1";
22 arm,hbi = <0x190>;
27 arm,vexpress,site = <0>; 23 arm,vexpress,site = <0>;
28 arm,v2m-memory-map = "rs1"; 24 arm,v2m-memory-map = "rs1";
25 compatible = "arm,vexpress,v2m-p1", "simple-bus";
29 #address-cells = <2>; /* SMB chipselect number and offset */ 26 #address-cells = <2>; /* SMB chipselect number and offset */
30 #size-cells = <1>; 27 #size-cells = <1>;
31 #interrupt-cells = <1>; 28 #interrupt-cells = <1>;
29 ranges;
32 30
33 flash@0,00000000 { 31 flash@0,00000000 {
34 compatible = "arm,vexpress-flash", "cfi-flash"; 32 compatible = "arm,vexpress-flash", "cfi-flash";
@@ -340,4 +338,3 @@
340 }; 338 };
341 }; 339 };
342 }; 340 };
343};
diff --git a/arch/arm/boot/dts/vexpress-v2m.dtsi b/arch/arm/boot/dts/vexpress-v2m.dtsi
index 4d321a832dbd..f1420368355b 100644
--- a/arch/arm/boot/dts/vexpress-v2m.dtsi
+++ b/arch/arm/boot/dts/vexpress-v2m.dtsi
@@ -17,17 +17,15 @@
17 * CHANGES TO vexpress-v2m-rs1.dtsi! 17 * CHANGES TO vexpress-v2m-rs1.dtsi!
18 */ 18 */
19 19
20/ {
21 aliases {
22 arm,v2m_timer = &v2m_timer01;
23 };
24
25 motherboard { 20 motherboard {
26 compatible = "simple-bus"; 21 model = "V2M-P1";
22 arm,hbi = <0x190>;
27 arm,vexpress,site = <0>; 23 arm,vexpress,site = <0>;
24 compatible = "arm,vexpress,v2m-p1", "simple-bus";
28 #address-cells = <2>; /* SMB chipselect number and offset */ 25 #address-cells = <2>; /* SMB chipselect number and offset */
29 #size-cells = <1>; 26 #size-cells = <1>;
30 #interrupt-cells = <1>; 27 #interrupt-cells = <1>;
28 ranges;
31 29
32 flash@0,00000000 { 30 flash@0,00000000 {
33 compatible = "arm,vexpress-flash", "cfi-flash"; 31 compatible = "arm,vexpress-flash", "cfi-flash";
@@ -339,4 +337,3 @@
339 }; 337 };
340 }; 338 };
341 }; 339 };
342};
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
index 4bbed10de45b..a3d37ec2655d 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
@@ -220,7 +220,11 @@
220 }; 220 };
221 }; 221 };
222 222
223 motherboard { 223 smb {
224 compatible = "simple-bus";
225
226 #address-cells = <2>;
227 #size-cells = <1>;
224 ranges = <0 0 0 0x08000000 0x04000000>, 228 ranges = <0 0 0 0x08000000 0x04000000>,
225 <1 0 0 0x14000000 0x04000000>, 229 <1 0 0 0x14000000 0x04000000>,
226 <2 0 0 0x18000000 0x04000000>, 230 <2 0 0 0x18000000 0x04000000>,
@@ -228,6 +232,7 @@
228 <4 0 0 0x0c000000 0x04000000>, 232 <4 0 0 0x0c000000 0x04000000>,
229 <5 0 0 0x10000000 0x04000000>; 233 <5 0 0 0x10000000 0x04000000>;
230 234
235 #interrupt-cells = <1>;
231 interrupt-map-mask = <0 0 63>; 236 interrupt-map-mask = <0 0 63>;
232 interrupt-map = <0 0 0 &gic 0 0 4>, 237 interrupt-map = <0 0 0 &gic 0 0 4>,
233 <0 0 1 &gic 0 1 4>, 238 <0 0 1 &gic 0 1 4>,
@@ -272,7 +277,7 @@
272 <0 0 40 &gic 0 40 4>, 277 <0 0 40 &gic 0 40 4>,
273 <0 0 41 &gic 0 41 4>, 278 <0 0 41 &gic 0 41 4>,
274 <0 0 42 &gic 0 42 4>; 279 <0 0 42 &gic 0 42 4>;
280
281 /include/ "vexpress-v2m-rs1.dtsi"
275 }; 282 };
276}; 283};
277
278/include/ "vexpress-v2m-rs1.dtsi"
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
index 3f4e1d00f4be..1fc405a9ecfb 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
@@ -305,7 +305,11 @@
305 }; 305 };
306 }; 306 };
307 307
308 motherboard { 308 smb {
309 compatible = "simple-bus";
310
311 #address-cells = <2>;
312 #size-cells = <1>;
309 ranges = <0 0 0 0x08000000 0x04000000>, 313 ranges = <0 0 0 0x08000000 0x04000000>,
310 <1 0 0 0x14000000 0x04000000>, 314 <1 0 0 0x14000000 0x04000000>,
311 <2 0 0 0x18000000 0x04000000>, 315 <2 0 0 0x18000000 0x04000000>,
@@ -313,6 +317,7 @@
313 <4 0 0 0x0c000000 0x04000000>, 317 <4 0 0 0x0c000000 0x04000000>,
314 <5 0 0 0x10000000 0x04000000>; 318 <5 0 0 0x10000000 0x04000000>;
315 319
320 #interrupt-cells = <1>;
316 interrupt-map-mask = <0 0 63>; 321 interrupt-map-mask = <0 0 63>;
317 interrupt-map = <0 0 0 &gic 0 0 4>, 322 interrupt-map = <0 0 0 &gic 0 0 4>,
318 <0 0 1 &gic 0 1 4>, 323 <0 0 1 &gic 0 1 4>,
@@ -357,7 +362,7 @@
357 <0 0 40 &gic 0 40 4>, 362 <0 0 40 &gic 0 40 4>,
358 <0 0 41 &gic 0 41 4>, 363 <0 0 41 &gic 0 41 4>,
359 <0 0 42 &gic 0 42 4>; 364 <0 0 42 &gic 0 42 4>;
365
366 /include/ "vexpress-v2m-rs1.dtsi"
360 }; 367 };
361}; 368};
362
363/include/ "vexpress-v2m-rs1.dtsi"
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
index f3c1f2a44072..6328cbc71d30 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca5s.dts
@@ -182,7 +182,11 @@
182 }; 182 };
183 }; 183 };
184 184
185 motherboard { 185 smb {
186 compatible = "simple-bus";
187
188 #address-cells = <2>;
189 #size-cells = <1>;
186 ranges = <0 0 0x08000000 0x04000000>, 190 ranges = <0 0 0x08000000 0x04000000>,
187 <1 0 0x14000000 0x04000000>, 191 <1 0 0x14000000 0x04000000>,
188 <2 0 0x18000000 0x04000000>, 192 <2 0 0x18000000 0x04000000>,
@@ -190,6 +194,7 @@
190 <4 0 0x0c000000 0x04000000>, 194 <4 0 0x0c000000 0x04000000>,
191 <5 0 0x10000000 0x04000000>; 195 <5 0 0x10000000 0x04000000>;
192 196
197 #interrupt-cells = <1>;
193 interrupt-map-mask = <0 0 63>; 198 interrupt-map-mask = <0 0 63>;
194 interrupt-map = <0 0 0 &gic 0 0 4>, 199 interrupt-map = <0 0 0 &gic 0 0 4>,
195 <0 0 1 &gic 0 1 4>, 200 <0 0 1 &gic 0 1 4>,
@@ -234,7 +239,7 @@
234 <0 0 40 &gic 0 40 4>, 239 <0 0 40 &gic 0 40 4>,
235 <0 0 41 &gic 0 41 4>, 240 <0 0 41 &gic 0 41 4>,
236 <0 0 42 &gic 0 42 4>; 241 <0 0 42 &gic 0 42 4>;
242
243 /include/ "vexpress-v2m-rs1.dtsi"
237 }; 244 };
238}; 245};
239
240/include/ "vexpress-v2m-rs1.dtsi"
diff --git a/arch/arm/boot/dts/vexpress-v2p-ca9.dts b/arch/arm/boot/dts/vexpress-v2p-ca9.dts
index 005259db541d..1420bb14d95c 100644
--- a/arch/arm/boot/dts/vexpress-v2p-ca9.dts
+++ b/arch/arm/boot/dts/vexpress-v2p-ca9.dts
@@ -265,13 +265,18 @@
265 }; 265 };
266 }; 266 };
267 267
268 motherboard { 268 smb {
269 compatible = "simple-bus";
270
271 #address-cells = <2>;
272 #size-cells = <1>;
269 ranges = <0 0 0x40000000 0x04000000>, 273 ranges = <0 0 0x40000000 0x04000000>,
270 <1 0 0x44000000 0x04000000>, 274 <1 0 0x44000000 0x04000000>,
271 <2 0 0x48000000 0x04000000>, 275 <2 0 0x48000000 0x04000000>,
272 <3 0 0x4c000000 0x04000000>, 276 <3 0 0x4c000000 0x04000000>,
273 <7 0 0x10000000 0x00020000>; 277 <7 0 0x10000000 0x00020000>;
274 278
279 #interrupt-cells = <1>;
275 interrupt-map-mask = <0 0 63>; 280 interrupt-map-mask = <0 0 63>;
276 interrupt-map = <0 0 0 &gic 0 0 4>, 281 interrupt-map = <0 0 0 &gic 0 0 4>,
277 <0 0 1 &gic 0 1 4>, 282 <0 0 1 &gic 0 1 4>,
@@ -316,7 +321,7 @@
316 <0 0 40 &gic 0 40 4>, 321 <0 0 40 &gic 0 40 4>,
317 <0 0 41 &gic 0 41 4>, 322 <0 0 41 &gic 0 41 4>,
318 <0 0 42 &gic 0 42 4>; 323 <0 0 42 &gic 0 42 4>;
324
325 /include/ "vexpress-v2m.dtsi"
319 }; 326 };
320}; 327};
321
322/include/ "vexpress-v2m.dtsi"
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 99d4172816be..4e168e81fb42 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -446,17 +446,20 @@ static void __init v2m_dt_init_irq(void)
446 446
447static void __init v2m_dt_timer_init(void) 447static void __init v2m_dt_timer_init(void)
448{ 448{
449 struct device_node *node; 449 struct device_node *node = NULL;
450 const char *path;
451 int err;
452 450
453 vexpress_clk_of_init(); 451 vexpress_clk_of_init();
454 452
455 err = of_property_read_string(of_aliases, "arm,v2m_timer", &path); 453 do {
456 if (WARN_ON(err)) 454 node = of_find_compatible_node(node, NULL, "arm,sp804");
457 return; 455 } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB);
458 node = of_find_node_by_path(path); 456 if (node) {
459 v2m_sp804_init(of_iomap(node, 0), irq_of_parse_and_map(node, 0)); 457 pr_info("Using SP804 '%s' as a clock & events source\n",
458 node->full_name);
459 v2m_sp804_init(of_iomap(node, 0),
460 irq_of_parse_and_map(node, 0));
461 }
462
460 if (arch_timer_of_register() != 0) 463 if (arch_timer_of_register() != 0)
461 twd_local_timer_of_register(); 464 twd_local_timer_of_register();
462 465