aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/boot/cuboot-8xx.c8
-rw-r--r--arch/powerpc/boot/cuboot-pq2.c8
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c24
3 files changed, 24 insertions, 16 deletions
diff --git a/arch/powerpc/boot/cuboot-8xx.c b/arch/powerpc/boot/cuboot-8xx.c
index 88ed84015a8b..0e82015a5f95 100644
--- a/arch/powerpc/boot/cuboot-8xx.c
+++ b/arch/powerpc/boot/cuboot-8xx.c
@@ -29,10 +29,12 @@ static void platform_fixups(void)
29 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq); 29 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
30 30
31 node = finddevice("/soc/cpm"); 31 node = finddevice("/soc/cpm");
32 if (node) { 32 if (node)
33 setprop(node, "clock-frequency", &bd.bi_busfreq, 4); 33 setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
34 setprop(node, "fsl,brg-frequency", &bd.bi_busfreq, 4); 34
35 } 35 node = finddevice("/soc/cpm/brg");
36 if (node)
37 setprop(node, "clock-frequency", &bd.bi_busfreq, 4);
36} 38}
37 39
38void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 40void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
diff --git a/arch/powerpc/boot/cuboot-pq2.c b/arch/powerpc/boot/cuboot-pq2.c
index 8021fd4a43bc..b150bd4f1b73 100644
--- a/arch/powerpc/boot/cuboot-pq2.c
+++ b/arch/powerpc/boot/cuboot-pq2.c
@@ -264,10 +264,12 @@ static void pq2_platform_fixups(void)
264 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq); 264 dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
265 265
266 node = finddevice("/soc/cpm"); 266 node = finddevice("/soc/cpm");
267 if (node) { 267 if (node)
268 setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4); 268 setprop(node, "clock-frequency", &bd.bi_cpmfreq, 4);
269 setprop(node, "fsl,brg-frequency", &bd.bi_brgfreq, 4); 269
270 } 270 node = finddevice("/soc/cpm/brg");
271 if (node)
272 setprop(node, "clock-frequency", &bd.bi_brgfreq, 4);
271 273
272 update_cs_ranges(); 274 update_cs_ranges();
273 fixup_pci(); 275 fixup_pci();
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index d028e8da027b..30523667df4e 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -73,22 +73,26 @@ static u32 brgfreq = -1;
73u32 get_brgfreq(void) 73u32 get_brgfreq(void)
74{ 74{
75 struct device_node *node; 75 struct device_node *node;
76 const unsigned int *prop;
77 int size;
76 78
77 if (brgfreq != -1) 79 if (brgfreq != -1)
78 return brgfreq; 80 return brgfreq;
79 81
80 node = of_find_compatible_node(NULL, NULL, "fsl,cpm1"); 82 node = of_find_compatible_node(NULL, NULL, "fsl,cpm-brg");
81 if (!node)
82 node = of_find_compatible_node(NULL, NULL, "fsl,cpm2");
83 if (!node)
84 node = of_find_node_by_type(NULL, "cpm");
85 if (node) { 83 if (node) {
86 int size; 84 prop = of_get_property(node, "clock-frequency", &size);
87 const unsigned int *prop; 85 if (prop && size == 4)
86 brgfreq = *prop;
88 87
89 prop = of_get_property(node, "fsl,brg-frequency", &size); 88 of_node_put(node);
90 if (!prop) 89 return brgfreq;
91 prop = of_get_property(node, "brg-frequency", &size); 90 }
91
92 /* Legacy device binding -- will go away when no users are left. */
93 node = of_find_node_by_type(NULL, "cpm");
94 if (node) {
95 prop = of_get_property(node, "brg-frequency", &size);
92 if (prop && size == 4) 96 if (prop && size == 4)
93 brgfreq = *prop; 97 brgfreq = *prop;
94 98