[POWERPC] CPM: Change from fsl,brg-frequency to brg/clock-frequency
authorScott Wood <scottwood@freescale.com>
Wed, 29 Aug 2007 20:08:40 +0000 (15:08 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 4 Oct 2007 01:35:43 +0000 (20:35 -0500)
As suggested by David Gibson, now that we have a separate node
for the baud rate generators, it's better to use the standard
clock-frequency property than a cpm-node-level fsl,brg-frequency
property.

This patch updates existing places where fsl,brg-frequency is
used.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/boot/cuboot-8xx.c
arch/powerpc/boot/cuboot-pq2.c
arch/powerpc/sysdev/fsl_soc.c

index 88ed84015a8badc2a21e8a79c7b4d4abd884649a..0e82015a5f95d42add314aa7e5c6fb3cbaa0b0aa 100644 (file)
@@ -29,10 +29,12 @@ static void platform_fixups(void)
        dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
 
        node = finddevice("/soc/cpm");
-       if (node) {
+       if (node)
                setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
-               setprop(node, "fsl,brg-frequency", &bd.bi_busfreq, 4);
-       }
+
+       node = finddevice("/soc/cpm/brg");
+       if (node)
+               setprop(node, "clock-frequency",  &bd.bi_busfreq, 4);
 }
 
 void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
index 8021fd4a43bc16ebfaa21d9ac3e077ce72d04890..b150bd4f1b73ea27209f43166e8c07d1f58e5c51 100644 (file)
@@ -264,10 +264,12 @@ static void pq2_platform_fixups(void)
        dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
 
        node = finddevice("/soc/cpm");
-       if (node) {
+       if (node)
                setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4);
-               setprop(node, "fsl,brg-frequency", &bd.bi_brgfreq, 4);
-       }
+
+       node = finddevice("/soc/cpm/brg");
+       if (node)
+               setprop(node, "clock-frequency",  &bd.bi_brgfreq, 4);
 
        update_cs_ranges();
        fixup_pci();
index d028e8da027b1e479e6b6c151befb63499ff8aa9..30523667df4ea3968e29a5960552bb1a732bf4f0 100644 (file)
@@ -73,22 +73,26 @@ static u32 brgfreq = -1;
 u32 get_brgfreq(void)
 {
        struct device_node *node;
+       const unsigned int *prop;
+       int size;
 
        if (brgfreq != -1)
                return brgfreq;
 
-       node = of_find_compatible_node(NULL, NULL, "fsl,cpm1");
-       if (!node)
-               node = of_find_compatible_node(NULL, NULL, "fsl,cpm2");
-       if (!node)
-               node = of_find_node_by_type(NULL, "cpm");
+       node = of_find_compatible_node(NULL, NULL, "fsl,cpm-brg");
        if (node) {
-               int size;
-               const unsigned int *prop;
+               prop = of_get_property(node, "clock-frequency", &size);
+               if (prop && size == 4)
+                       brgfreq = *prop;
 
-               prop = of_get_property(node, "fsl,brg-frequency", &size);
-               if (!prop)
-                       prop = of_get_property(node, "brg-frequency", &size);
+               of_node_put(node);
+               return brgfreq;
+       }
+
+       /* Legacy device binding -- will go away when no users are left. */
+       node = of_find_node_by_type(NULL, "cpm");
+       if (node) {
+               prop = of_get_property(node, "brg-frequency", &size);
                if (prop && size == 4)
                        brgfreq = *prop;