]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
ARM: vexpress: Remove motherboard dependencies in the DTS files
authorPawel Moll <pawel.moll@arm.com>
Tue, 16 Oct 2012 14:27:12 +0000 (15:27 +0100)
committerPawel Moll <pawel.moll@arm.com>
Mon, 5 Nov 2012 17:09:52 +0000 (17:09 +0000)
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>
Documentation/devicetree/bindings/arm/vexpress.txt
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
arch/arm/boot/dts/vexpress-v2m.dtsi
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
arch/arm/boot/dts/vexpress-v2p-ca5s.dts
arch/arm/boot/dts/vexpress-v2p-ca9.dts
arch/arm/mach-vexpress/v2m.c

index 5d9996b9eabf29415a84499a30969f8edf3f81dc..ae49161e478ae556a31cb9eed4bc66e50daf9c70 100644 (file)
@@ -141,14 +141,19 @@ can be used to obtain required phandle in the tile's "aliases" node:
 - SP804 timers:
        v2m_timer01 and v2m_timer23
 
-Current Linux implementation requires a "arm,v2m_timer" alias
-pointing at one of the motherboard's SP804 timers, if it is to be
-used as the system timer. This alias should be defined in the
-motherboard files.
-
-The tile description must define "ranges", "interrupt-map-mask" and
-"interrupt-map" properties to translate the motherboard's address
-and interrupt space into one used by the tile's processor.
+The tile description should define a "smb" node, describing the
+Static Memory Bus between the tile and motherboard. It must define
+the following properties:
+- "simple-bus" compatible value (to ensure creation of the children)
+       compatible = "simple-bus";
+- mapping of the SMB CS/offset addresses into main address space:
+       #address-cells = <2>;
+       #size-cells = <1>;
+       ranges = <...>;
+- interrupts mapping:
+       #interrupt-cells = <1>;
+       interrupt-map-mask = <0 0 63>;
+       interrupt-map = <...>;
 
 
 Example of a VE tile description (simplified)
@@ -200,13 +205,20 @@ Example of a VE tile description (simplified)
                };
        };
 
-       motherboard {
+       smb {
+               compatible = "simple-bus";
+
+               #address-cells = <2>;
+               #size-cells = <1>;
                /* CS0 is visible at 0x08000000 */
                ranges = <0 0 0x08000000 0x04000000>;
+
+               #interrupt-cells = <1>;
                interrupt-map-mask = <0 0 63>;
                /* Active high IRQ 0 is connected to GIC's SPI0 */
                interrupt-map = <0 0 0 &gic 0 0 4>;
+
+               /include/ "vexpress-v2m-rs1.dtsi"
        };
 };
 
-/include/ "vexpress-v2m-rs1.dtsi"
index 9a7b6922f83b1ea22d7140a9bcf3de70150578c5..ac870fb3fa0d459b6639e5965f9cc2daecae14e2 100644 (file)
  * CHANGES TO vexpress-v2m.dtsi!
  */
 
-/ {
-       aliases {
-               arm,v2m_timer = &v2m_timer01;
-       };
-
        motherboard {
-               compatible = "simple-bus";
+               model = "V2M-P1";
+               arm,hbi = <0x190>;
                arm,vexpress,site = <0>;
                arm,v2m-memory-map = "rs1";
+               compatible = "arm,vexpress,v2m-p1", "simple-bus";
                #address-cells = <2>; /* SMB chipselect number and offset */
                #size-cells = <1>;
                #interrupt-cells = <1>;
+               ranges;
 
                flash@0,00000000 {
                        compatible = "arm,vexpress-flash", "cfi-flash";
                        };
                };
        };
-};
index 4d321a832dbd09b853903b31379a5dd344341439..f1420368355bb2f91715526d4a057660f5480b71 100644 (file)
  * CHANGES TO vexpress-v2m-rs1.dtsi!
  */
 
-/ {
-       aliases {
-               arm,v2m_timer = &v2m_timer01;
-       };
-
        motherboard {
-               compatible = "simple-bus";
+               model = "V2M-P1";
+               arm,hbi = <0x190>;
                arm,vexpress,site = <0>;
+               compatible = "arm,vexpress,v2m-p1", "simple-bus";
                #address-cells = <2>; /* SMB chipselect number and offset */
                #size-cells = <1>;
                #interrupt-cells = <1>;
+               ranges;
 
                flash@0,00000000 {
                        compatible = "arm,vexpress-flash", "cfi-flash";
                        };
                };
        };
-};
index 4bbed10de45bf0349071249db378c3554b535034..a3d37ec2655d80efccae49ee9f85ca9c9b1213b1 100644 (file)
                };
        };
 
-       motherboard {
+       smb {
+               compatible = "simple-bus";
+
+               #address-cells = <2>;
+               #size-cells = <1>;
                ranges = <0 0 0 0x08000000 0x04000000>,
                         <1 0 0 0x14000000 0x04000000>,
                         <2 0 0 0x18000000 0x04000000>,
                         <4 0 0 0x0c000000 0x04000000>,
                         <5 0 0 0x10000000 0x04000000>;
 
+               #interrupt-cells = <1>;
                interrupt-map-mask = <0 0 63>;
                interrupt-map = <0 0  0 &gic 0  0 4>,
                                <0 0  1 &gic 0  1 4>,
                                <0 0 40 &gic 0 40 4>,
                                <0 0 41 &gic 0 41 4>,
                                <0 0 42 &gic 0 42 4>;
+
+               /include/ "vexpress-v2m-rs1.dtsi"
        };
 };
-
-/include/ "vexpress-v2m-rs1.dtsi"
index 3f4e1d00f4bedb45599c9d0bc466657528621a9b..1fc405a9ecfb0a4e6cacd94ba9442d6ce75575fa 100644 (file)
                };
        };
 
-       motherboard {
+       smb {
+               compatible = "simple-bus";
+
+               #address-cells = <2>;
+               #size-cells = <1>;
                ranges = <0 0 0 0x08000000 0x04000000>,
                         <1 0 0 0x14000000 0x04000000>,
                         <2 0 0 0x18000000 0x04000000>,
                         <4 0 0 0x0c000000 0x04000000>,
                         <5 0 0 0x10000000 0x04000000>;
 
+               #interrupt-cells = <1>;
                interrupt-map-mask = <0 0 63>;
                interrupt-map = <0 0  0 &gic 0  0 4>,
                                <0 0  1 &gic 0  1 4>,
                                <0 0 40 &gic 0 40 4>,
                                <0 0 41 &gic 0 41 4>,
                                <0 0 42 &gic 0 42 4>;
+
+               /include/ "vexpress-v2m-rs1.dtsi"
        };
 };
-
-/include/ "vexpress-v2m-rs1.dtsi"
index f3c1f2a440727f631deae98111bbf86c6a545221..6328cbc71d3005931fecb40a796bcedd8c61ce1f 100644 (file)
                };
        };
 
-       motherboard {
+       smb {
+               compatible = "simple-bus";
+
+               #address-cells = <2>;
+               #size-cells = <1>;
                ranges = <0 0 0x08000000 0x04000000>,
                         <1 0 0x14000000 0x04000000>,
                         <2 0 0x18000000 0x04000000>,
                         <4 0 0x0c000000 0x04000000>,
                         <5 0 0x10000000 0x04000000>;
 
+               #interrupt-cells = <1>;
                interrupt-map-mask = <0 0 63>;
                interrupt-map = <0 0  0 &gic 0  0 4>,
                                <0 0  1 &gic 0  1 4>,
                                <0 0 40 &gic 0 40 4>,
                                <0 0 41 &gic 0 41 4>,
                                <0 0 42 &gic 0 42 4>;
+
+               /include/ "vexpress-v2m-rs1.dtsi"
        };
 };
-
-/include/ "vexpress-v2m-rs1.dtsi"
index 005259db541d10ca7a49555725292eec4c981d3b..1420bb14d95c9bdeecea3aff5598612df359b924 100644 (file)
                };
        };
 
-       motherboard {
+       smb {
+               compatible = "simple-bus";
+
+               #address-cells = <2>;
+               #size-cells = <1>;
                ranges = <0 0 0x40000000 0x04000000>,
                         <1 0 0x44000000 0x04000000>,
                         <2 0 0x48000000 0x04000000>,
                         <3 0 0x4c000000 0x04000000>,
                         <7 0 0x10000000 0x00020000>;
 
+               #interrupt-cells = <1>;
                interrupt-map-mask = <0 0 63>;
                interrupt-map = <0 0  0 &gic 0  0 4>,
                                <0 0  1 &gic 0  1 4>,
                                <0 0 40 &gic 0 40 4>,
                                <0 0 41 &gic 0 41 4>,
                                <0 0 42 &gic 0 42 4>;
+
+               /include/ "vexpress-v2m.dtsi"
        };
 };
-
-/include/ "vexpress-v2m.dtsi"
index 99d4172816bede541f2750daaab63542a717ff6f..4e168e81fb424827b2cf0fe2546df030ea41d31f 100644 (file)
@@ -446,17 +446,20 @@ static void __init v2m_dt_init_irq(void)
 
 static void __init v2m_dt_timer_init(void)
 {
-       struct device_node *node;
-       const char *path;
-       int err;
+       struct device_node *node = NULL;
 
        vexpress_clk_of_init();
 
-       err = of_property_read_string(of_aliases, "arm,v2m_timer", &path);
-       if (WARN_ON(err))
-               return;
-       node = of_find_node_by_path(path);
-       v2m_sp804_init(of_iomap(node, 0), irq_of_parse_and_map(node, 0));
+       do {
+               node = of_find_compatible_node(node, NULL, "arm,sp804");
+       } while (node && vexpress_get_site_by_node(node) != VEXPRESS_SITE_MB);
+       if (node) {
+               pr_info("Using SP804 '%s' as a clock & events source\n",
+                               node->full_name);
+               v2m_sp804_init(of_iomap(node, 0),
+                               irq_of_parse_and_map(node, 0));
+       }
+
        if (arch_timer_of_register() != 0)
                twd_local_timer_of_register();