Thread (129 messages) flat view 129 messages, 11 authors, 2007-07-19

Re: [PATCH 30/61] fsl_soc: Update the way get_brgfreq() finds things in the device tree.

From: Kumar Gala <hidden>
Date: 2007-07-18 05:28:14

On Jul 17, 2007, at 8:35 PM, Scott Wood wrote:
quoted hunk ↗ jump to hunk
It now uses names that are less namespace polluting.

Signed-off-by: Scott Wood <redacted>
---
 arch/powerpc/boot/dts/mpc8272ads.dts |    5 ++---
 arch/powerpc/boot/dts/mpc8560ads.dts |    5 ++---
 arch/powerpc/boot/dts/mpc866ads.dts  |    5 ++---
 arch/powerpc/boot/dts/mpc885ads.dts  |    5 ++---
 arch/powerpc/sysdev/fsl_soc.c        |   10 +++++-----
 5 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8272ads.dts b/arch/powerpc/ 
boot/dts/mpc8272ads.dts
index 4d09dca..16a77f4 100644
--- a/arch/powerpc/boot/dts/mpc8272ads.dts
+++ b/arch/powerpc/boot/dts/mpc8272ads.dts
@@ -119,12 +119,11 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			#interrupt-cells = <2>;
-			device_type = "cpm";
-			model = "CPM2";
+			compatible = "fsl,mpc8272-cpm", "fsl,cpm2", "fsl,cpm";
Does 'fsl,cpm' really mean anything useful?
 			ranges = <00000000 00000000 20000>;
 			reg = <0 20000>;
 			command-proc = <119c0>;
-			brg-frequency = <17D7840>;
+			fsl,brg-frequency = <d#25000000>;
Leave brg-frequency, and make a note about it being deprecated.
 			cpm_clk = <BEBC200>;

 			scc@11a00 {
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/ 
fsl_soc.c
index a837742..ff70d62 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -84,16 +84,16 @@ u32 get_brgfreq(void)
 	if (brgfreq != -1)
 		return brgfreq;

-	node = of_find_node_by_type(NULL, "cpm");
+	node = of_find_compatible_node(NULL, NULL, "fsl,cpm");
 	if (node) {
 		unsigned int size;
-		const unsigned int *prop = of_get_property(node,
-					"brg-frequency", &size);
+		const unsigned int *prop =
+			of_get_property(node, "fsl,brg-frequency", &size);
We need to support both "brg-frequency" and "fsl,brg-frequency" for  
some period of time.

Also, take a look at QE it has a similar concept.
-		if (prop)
+		if (prop && size == 4)
 			brgfreq = *prop;
 		of_node_put(node);
-	};
+	}

 	return brgfreq;
 }
-- 
1.5.0.3

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help