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

Scott Wood scottwood at freescale.com
Wed Jul 18 11:35:38 EST 2007


It now uses names that are less namespace polluting.

Signed-off-by: Scott Wood <scottwood at freescale.com>
---
 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";
 			ranges = <00000000 00000000 20000>;
 			reg = <0 20000>;
 			command-proc = <119c0>;
-			brg-frequency = <17D7840>;
+			fsl,brg-frequency = <d#25000000>;
 			cpm_clk = <BEBC200>;
 
 			scc at 11a00 {
diff --git a/arch/powerpc/boot/dts/mpc8560ads.dts b/arch/powerpc/boot/dts/mpc8560ads.dts
index 21ccaaa..1626587 100644
--- a/arch/powerpc/boot/dts/mpc8560ads.dts
+++ b/arch/powerpc/boot/dts/mpc8560ads.dts
@@ -235,12 +235,11 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			#interrupt-cells = <2>;
-			device_type = "cpm";
-			model = "CPM2";
+			compatible = "fsl,mpc8560-cpm", "fsl,cpm2", "fsl,cpm";
 			ranges = <0 0 c0000>;
 			reg = <80000 40000>;
 			command-proc = <919c0>;
-			brg-frequency = <9d5b340>;
+			fsl,brg-frequency = <d#165000000>;
 
 			cpmpic: pic at 90c00 {
 				interrupt-controller;
diff --git a/arch/powerpc/boot/dts/mpc866ads.dts b/arch/powerpc/boot/dts/mpc866ads.dts
index e5e7726..b3dbfe8 100644
--- a/arch/powerpc/boot/dts/mpc866ads.dts
+++ b/arch/powerpc/boot/dts/mpc866ads.dts
@@ -87,12 +87,11 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			#interrupt-cells = <2>;
-			device_type = "cpm";
-			model = "CPM";
+			compatible = "fsl,mpc866-cpm", "fsl,cpm1", "fsl,cpm";
 			ranges = <0 0 4000>;
 			reg = <860 f0>;
 			command-proc = <9c0>;
-			brg-frequency = <0>;
+			fsl,brg-frequency = <0>;
 			interrupts = <0 2>;	// cpm error interrupt
 			interrupt-parent = <&Cpm_pic>;
 
diff --git a/arch/powerpc/boot/dts/mpc885ads.dts b/arch/powerpc/boot/dts/mpc885ads.dts
index dc7ab9c..8372469 100644
--- a/arch/powerpc/boot/dts/mpc885ads.dts
+++ b/arch/powerpc/boot/dts/mpc885ads.dts
@@ -118,12 +118,11 @@
 			#address-cells = <1>;
 			#size-cells = <1>;
 			#interrupt-cells = <2>;
-			device_type = "cpm";
-			model = "CPM";
+			compatible = "fsl,mpc885-cpm", "fsl,cpm1", "fsl,cpm";
 			ranges = <0 0 4000>;
 			reg = <860 f0>;
 			command-proc = <9c0>;
-			brg-frequency = <0>;
+			fsl,brg-frequency = <0>;
 			interrupts = <0 2>;	// cpm error interrupt
 			interrupt-parent = <&Cpm_pic>;
 
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);
 
-		if (prop)
+		if (prop && size == 4)
 			brgfreq = *prop;
 		of_node_put(node);
-	};
+	}
 
 	return brgfreq;
 }
-- 
1.5.0.3




More information about the Linuxppc-dev mailing list