]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: integrator: core module registers from compatible strings
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Oct 2013 16:24:58 +0000 (18:24 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 Oct 2013 12:10:14 +0000 (14:10 +0200)
This augments the core machine code for the Integrator platforms
to get their references to the core module device nodes by
using compatible strings instead of predefined node names
and rename the CP syscon node to be simply "syscon".

Reported-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/devicetree/bindings/arm/arm-boards
arch/arm/boot/dts/integratorap.dts
arch/arm/boot/dts/integratorcp.dts
arch/arm/mach-integrator/integrator_ap.c
arch/arm/mach-integrator/integrator_cp.c

index 0ebf3d94e8bf5194d8a019088b411b7e6f53e58c..5fac246a9530168fc42b378d7b37da9e694dbb91 100644 (file)
@@ -19,18 +19,22 @@ Required nodes:
   - regs: the location and size of the core module registers, one
     range of 0x200 bytes.
 
-- cpcon/syscon: the root node the Integrator/CP must have a /cpcon
-  node pointing to the CP control registers, and the Integrator/AP
-  must have a /syscon node pointing to the Integrator/AP system
-  controller. The AP syscon node must include the logical module
-  interrupts.
-
-In the root node the Integrator/CP must have a /cpcon node pointing
-to the CP control registers, and the Integrator/AP must have a
-/syscon node pointing to the Integrator/AP system controller.
-The AP syscon node must include the logic module interrupts, stated
-in order of module instance <module 0, module 1, module 2 ...>
-example:
+- syscon: the root node of the Integrator platforms must have a
+  system controller node pointong to the control registers,
+  with the compatible string
+  "arm,integrator-ap-syscon"
+  "arm,integrator-cp-syscon"
+  respectively.
+
+  Required properties for the system controller:
+  - regs: the location and size of the system controller registers,
+    one range of 0x100 bytes.
+
+  Required properties for the AP system controller:
+  - interrupts: the AP syscon node must include the logical module
+    interrupts, stated in order of module instance <module 0>,
+    <module 1>, <module 2> ... for the CP system controller this
+    is not required not of any use.
 
 /dts-v1/;
 /include/ "integrator.dtsi"
@@ -45,7 +49,7 @@ example:
        };
 
        syscon {
-               /* AP system controller registers */
+               compatible = "arm,integrator-ap-syscon";
                reg = <0x11000000 0x100>;
                interrupt-parent = <&pic>;
                /* These are the logic module IRQs */
index 453ab0ea4d2b4bfa4aed3fb88fc75fa3d3c21729..e6be9315ff0a54033e07daba296399b8f45112ca 100644 (file)
@@ -19,7 +19,7 @@
        };
 
        syscon {
-               /* AP system controller registers */
+               compatible = "arm,integrator-ap-syscon";
                reg = <0x11000000 0x100>;
                interrupt-parent = <&pic>;
                /* These are the logical module IRQs */
index ff1aea0ee04322bf26688e1bf8892b60b02a69ce..a3a06b893237d068ba731affb69a2a9b7729ccf6 100644 (file)
@@ -18,8 +18,8 @@
                bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk";
        };
 
-       cpcon {
-               /* CP controller registers */
+       syscon {
+               compatible = "arm,integrator-cp-syscon";
                reg = <0xcb000000 0x100>;
        };
 
index ece47556afe677d5c229d9c827a501c5a285855e..d50dc2dbfd89e53571a716b80e01bd567400ea36 100644 (file)
@@ -470,6 +470,11 @@ static struct of_dev_auxdata ap_auxdata_lookup[] __initdata = {
        { /* sentinel */ },
 };
 
+static const struct of_device_id ap_syscon_match[] = {
+       { .compatible = "arm,integrator-ap-syscon"},
+       { },
+};
+
 static void __init ap_init_of(void)
 {
        unsigned long sc_dec;
@@ -486,7 +491,8 @@ static void __init ap_init_of(void)
        root = of_find_node_by_path("/");
        if (!root)
                return;
-       syscon = of_find_node_by_path("/syscon");
+
+       syscon = of_find_matching_node(root, ap_syscon_match);
        if (!syscon)
                return;
 
index 422c3f9b4163daf700d218708e7ccbe690532f9b..1df6e7602cadb75dac78a961352624b8f855d73f 100644 (file)
@@ -286,6 +286,11 @@ static struct of_dev_auxdata intcp_auxdata_lookup[] __initdata = {
        { /* sentinel */ },
 };
 
+static const struct of_device_id intcp_syscon_match[] = {
+       { .compatible = "arm,integrator-cp-syscon"},
+       { },
+};
+
 static void __init intcp_init_of(void)
 {
        struct device_node *root;
@@ -300,7 +305,8 @@ static void __init intcp_init_of(void)
        root = of_find_node_by_path("/");
        if (!root)
                return;
-       cpcon = of_find_node_by_path("/cpcon");
+
+       cpcon = of_find_matching_node(root, intcp_syscon_match);
        if (!cpcon)
                return;