aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-08-20 12:38:12 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-09-14 09:51:43 -0400
commitf9234736112bf193e5ab451abbfbdf279cc53137 (patch)
treed732233f231e003b1c55c0e225c2d918e130df04 /arch
parent683d00b03eb09a140e25d7f1457d347277bc2619 (diff)
[POWERPC] fsl_soc.c cleanup
1. Update the way get_brgfreq() finds things in the device tree. It now uses names that are less namespace polluting. The old names are supported until all boards are converted. 2. "size" is changed from unsigned int to int, to match what of_get_property() expects. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/sysdev/fsl_soc.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index f3abce11bead..7012e51ae5c6 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -52,13 +52,13 @@ phys_addr_t get_immrbase(void)
52 52
53 soc = of_find_node_by_type(NULL, "soc"); 53 soc = of_find_node_by_type(NULL, "soc");
54 if (soc) { 54 if (soc) {
55 unsigned int size; 55 int size;
56 const void *prop = of_get_property(soc, "reg", &size); 56 const void *prop = of_get_property(soc, "reg", &size);
57 57
58 if (prop) 58 if (prop)
59 immrbase = of_translate_address(soc, prop); 59 immrbase = of_translate_address(soc, prop);
60 of_node_put(soc); 60 of_node_put(soc);
61 }; 61 }
62 62
63 return immrbase; 63 return immrbase;
64} 64}
@@ -76,16 +76,23 @@ u32 get_brgfreq(void)
76 if (brgfreq != -1) 76 if (brgfreq != -1)
77 return brgfreq; 77 return brgfreq;
78 78
79 node = of_find_node_by_type(NULL, "cpm"); 79 node = of_find_compatible_node(NULL, NULL, "fsl,cpm1");
80 if (!node)
81 node = of_find_compatible_node(NULL, NULL, "fsl,cpm2");
82 if (!node)
83 node = of_find_node_by_type(NULL, "cpm");
80 if (node) { 84 if (node) {
81 unsigned int size; 85 int size;
82 const unsigned int *prop = of_get_property(node, 86 const unsigned int *prop;
83 "brg-frequency", &size);
84 87
85 if (prop) 88 prop = of_get_property(node, "fsl,brg-frequency", &size);
89 if (!prop)
90 prop = of_get_property(node, "brg-frequency", &size);
91 if (prop && size == 4)
86 brgfreq = *prop; 92 brgfreq = *prop;
93
87 of_node_put(node); 94 of_node_put(node);
88 }; 95 }
89 96
90 return brgfreq; 97 return brgfreq;
91} 98}
@@ -103,14 +110,14 @@ u32 get_baudrate(void)
103 110
104 node = of_find_node_by_type(NULL, "serial"); 111 node = of_find_node_by_type(NULL, "serial");
105 if (node) { 112 if (node) {
106 unsigned int size; 113 int size;
107 const unsigned int *prop = of_get_property(node, 114 const unsigned int *prop = of_get_property(node,
108 "current-speed", &size); 115 "current-speed", &size);
109 116
110 if (prop) 117 if (prop)
111 fs_baudrate = *prop; 118 fs_baudrate = *prop;
112 of_node_put(node); 119 of_node_put(node);
113 }; 120 }
114 121
115 return fs_baudrate; 122 return fs_baudrate;
116} 123}