diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-01-24 10:39:59 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-28 09:32:55 -0500 |
commit | a2dd70a11d4c9cb8a4e4bb41f53a9b430e08559b (patch) | |
tree | 0ecb6b3f6ed79c06db25299450a7ea1ef216ed5a | |
parent | f67be814ff8e862422739cb424ce8c4e6c142c28 (diff) |
[POWERPC] QE: get rid of most device_types and model
Now we're searching for "fsl,qe", "fsl,qe-muram", "fsl,qe-muram-data"
and "fsl,qe-ic".
Unfortunately it's still impossible to remove device_type = "qe"
from the existing device trees because older u-boots are looking for it.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r-- | Documentation/powerpc/booting-without-of.txt | 11 | ||||
-rw-r--r-- | arch/powerpc/boot/dts/mpc832x_mds.dts | 9 | ||||
-rw-r--r-- | arch/powerpc/boot/dts/mpc832x_rdb.dts | 10 | ||||
-rw-r--r-- | arch/powerpc/boot/dts/mpc836x_mds.dts | 10 | ||||
-rw-r--r-- | arch/powerpc/boot/dts/mpc8568mds.dts | 10 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_mds.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc832x_rdb.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/mpc836x_mds.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 32 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 5 | ||||
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe.c | 63 |
11 files changed, 117 insertions, 66 deletions
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt index e74a4a65d469..470cbc0cfceb 100644 --- a/Documentation/powerpc/booting-without-of.txt +++ b/Documentation/powerpc/booting-without-of.txt | |||
@@ -1543,7 +1543,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1543 | i) Root QE device | 1543 | i) Root QE device |
1544 | 1544 | ||
1545 | Required properties: | 1545 | Required properties: |
1546 | - device_type : should be "qe"; | 1546 | - compatible : should be "fsl,qe"; |
1547 | - model : precise model of the QE, Can be "QE", "CPM", or "CPM2" | 1547 | - model : precise model of the QE, Can be "QE", "CPM", or "CPM2" |
1548 | - reg : offset and length of the device registers. | 1548 | - reg : offset and length of the device registers. |
1549 | - bus-frequency : the clock frequency for QUICC Engine. | 1549 | - bus-frequency : the clock frequency for QUICC Engine. |
@@ -1557,8 +1557,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1557 | #address-cells = <1>; | 1557 | #address-cells = <1>; |
1558 | #size-cells = <1>; | 1558 | #size-cells = <1>; |
1559 | #interrupt-cells = <2>; | 1559 | #interrupt-cells = <2>; |
1560 | device_type = "qe"; | 1560 | compatible = "fsl,qe"; |
1561 | model = "QE"; | ||
1562 | ranges = <0 e0100000 00100000>; | 1561 | ranges = <0 e0100000 00100000>; |
1563 | reg = <e0100000 480>; | 1562 | reg = <e0100000 480>; |
1564 | brg-frequency = <0>; | 1563 | brg-frequency = <0>; |
@@ -1781,7 +1780,7 @@ platforms are moved over to use the flattened-device-tree model. | |||
1781 | vii) Multi-User RAM (MURAM) | 1780 | vii) Multi-User RAM (MURAM) |
1782 | 1781 | ||
1783 | Required properties: | 1782 | Required properties: |
1784 | - device_type : should be "muram". | 1783 | - compatible : should be "fsl,qe-muram", "fsl,cpm-muram". |
1785 | - mode : the could be "host" or "slave". | 1784 | - mode : the could be "host" or "slave". |
1786 | - ranges : Should be defined as specified in 1) to describe the | 1785 | - ranges : Should be defined as specified in 1) to describe the |
1787 | translation of MURAM addresses. | 1786 | translation of MURAM addresses. |
@@ -1791,10 +1790,12 @@ platforms are moved over to use the flattened-device-tree model. | |||
1791 | Example: | 1790 | Example: |
1792 | 1791 | ||
1793 | muram@10000 { | 1792 | muram@10000 { |
1794 | device_type = "muram"; | 1793 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; |
1795 | ranges = <0 00010000 0000c000>; | 1794 | ranges = <0 00010000 0000c000>; |
1796 | 1795 | ||
1797 | data-only@0{ | 1796 | data-only@0{ |
1797 | compatible = "fsl,qe-muram-data", | ||
1798 | "fsl,cpm-muram-data"; | ||
1798 | reg = <0 c000>; | 1799 | reg = <0 c000>; |
1799 | }; | 1800 | }; |
1800 | }; | 1801 | }; |
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts index 690252456d3d..e300df4d3e05 100644 --- a/arch/powerpc/boot/dts/mpc832x_mds.dts +++ b/arch/powerpc/boot/dts/mpc832x_mds.dts | |||
@@ -206,17 +206,18 @@ | |||
206 | #size-cells = <1>; | 206 | #size-cells = <1>; |
207 | device_type = "qe"; | 207 | device_type = "qe"; |
208 | compatible = "fsl,qe"; | 208 | compatible = "fsl,qe"; |
209 | model = "QE"; | ||
210 | ranges = <0 e0100000 00100000>; | 209 | ranges = <0 e0100000 00100000>; |
211 | reg = <e0100000 480>; | 210 | reg = <e0100000 480>; |
212 | brg-frequency = <0>; | 211 | brg-frequency = <0>; |
213 | bus-frequency = <BCD3D80>; | 212 | bus-frequency = <BCD3D80>; |
214 | 213 | ||
215 | muram@10000 { | 214 | muram@10000 { |
216 | device_type = "muram"; | 215 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; |
217 | ranges = <0 00010000 00004000>; | 216 | ranges = <0 00010000 00004000>; |
218 | 217 | ||
219 | data-only@0 { | 218 | data-only@0 { |
219 | compatible = "fsl,qe-muram-data", | ||
220 | "fsl,cpm-muram-data"; | ||
220 | reg = <0 4000>; | 221 | reg = <0 4000>; |
221 | }; | 222 | }; |
222 | }; | 223 | }; |
@@ -320,9 +321,9 @@ | |||
320 | }; | 321 | }; |
321 | }; | 322 | }; |
322 | 323 | ||
323 | qeic: qeic@80 { | 324 | qeic: interrupt-controller@80 { |
324 | interrupt-controller; | 325 | interrupt-controller; |
325 | device_type = "qeic"; | 326 | compatible = "fsl,qe-ic"; |
326 | #address-cells = <0>; | 327 | #address-cells = <0>; |
327 | #interrupt-cells = <1>; | 328 | #interrupt-cells = <1>; |
328 | reg = <80 80>; | 329 | reg = <80 80>; |
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts index 10ff7aadf9dc..4d5cfd32cd7c 100644 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts | |||
@@ -166,17 +166,19 @@ | |||
166 | #address-cells = <1>; | 166 | #address-cells = <1>; |
167 | #size-cells = <1>; | 167 | #size-cells = <1>; |
168 | device_type = "qe"; | 168 | device_type = "qe"; |
169 | model = "QE"; | 169 | compatible = "fsl,qe"; |
170 | ranges = <0 e0100000 00100000>; | 170 | ranges = <0 e0100000 00100000>; |
171 | reg = <e0100000 480>; | 171 | reg = <e0100000 480>; |
172 | brg-frequency = <0>; | 172 | brg-frequency = <0>; |
173 | bus-frequency = <BCD3D80>; | 173 | bus-frequency = <BCD3D80>; |
174 | 174 | ||
175 | muram@10000 { | 175 | muram@10000 { |
176 | device_type = "muram"; | 176 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; |
177 | ranges = <0 00010000 00004000>; | 177 | ranges = <0 00010000 00004000>; |
178 | 178 | ||
179 | data-only@0 { | 179 | data-only@0 { |
180 | compatible = "fsl,qe-muram-data", | ||
181 | "fsl,cpm-muram-data"; | ||
180 | reg = <0 4000>; | 182 | reg = <0 4000>; |
181 | }; | 183 | }; |
182 | }; | 184 | }; |
@@ -252,9 +254,9 @@ | |||
252 | }; | 254 | }; |
253 | }; | 255 | }; |
254 | 256 | ||
255 | qeic:qeic@80 { | 257 | qeic:interrupt-controller@80 { |
256 | interrupt-controller; | 258 | interrupt-controller; |
257 | device_type = "qeic"; | 259 | compatible = "fsl,qe-ic"; |
258 | #address-cells = <0>; | 260 | #address-cells = <0>; |
259 | #interrupt-cells = <1>; | 261 | #interrupt-cells = <1>; |
260 | reg = <80 80>; | 262 | reg = <80 80>; |
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts index 2181d2cdbff2..9a2581b6a170 100644 --- a/arch/powerpc/boot/dts/mpc836x_mds.dts +++ b/arch/powerpc/boot/dts/mpc836x_mds.dts | |||
@@ -207,17 +207,19 @@ | |||
207 | #address-cells = <1>; | 207 | #address-cells = <1>; |
208 | #size-cells = <1>; | 208 | #size-cells = <1>; |
209 | device_type = "qe"; | 209 | device_type = "qe"; |
210 | model = "QE"; | 210 | compatible = "fsl,qe"; |
211 | ranges = <0 e0100000 00100000>; | 211 | ranges = <0 e0100000 00100000>; |
212 | reg = <e0100000 480>; | 212 | reg = <e0100000 480>; |
213 | brg-frequency = <0>; | 213 | brg-frequency = <0>; |
214 | bus-frequency = <179A7B00>; | 214 | bus-frequency = <179A7B00>; |
215 | 215 | ||
216 | muram@10000 { | 216 | muram@10000 { |
217 | device_type = "muram"; | 217 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; |
218 | ranges = <0 00010000 0000c000>; | 218 | ranges = <0 00010000 0000c000>; |
219 | 219 | ||
220 | data-only@0{ | 220 | data-only@0{ |
221 | compatible = "fsl,qe-muram-data", | ||
222 | "fsl,cpm-muram-data"; | ||
221 | reg = <0 c000>; | 223 | reg = <0 c000>; |
222 | }; | 224 | }; |
223 | }; | 225 | }; |
@@ -303,9 +305,9 @@ | |||
303 | }; | 305 | }; |
304 | }; | 306 | }; |
305 | 307 | ||
306 | qeic: qeic@80 { | 308 | qeic: interrupt-controller@80 { |
307 | interrupt-controller; | 309 | interrupt-controller; |
308 | device_type = "qeic"; | 310 | compatible = "fsl,qe-ic"; |
309 | #address-cells = <0>; | 311 | #address-cells = <0>; |
310 | #interrupt-cells = <1>; | 312 | #interrupt-cells = <1>; |
311 | reg = <80 80>; | 313 | reg = <80 80>; |
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts index 5818a7c861e7..04f5c6f68256 100644 --- a/arch/powerpc/boot/dts/mpc8568mds.dts +++ b/arch/powerpc/boot/dts/mpc8568mds.dts | |||
@@ -284,17 +284,19 @@ | |||
284 | #address-cells = <1>; | 284 | #address-cells = <1>; |
285 | #size-cells = <1>; | 285 | #size-cells = <1>; |
286 | device_type = "qe"; | 286 | device_type = "qe"; |
287 | model = "QE"; | 287 | compatible = "fsl,qe"; |
288 | ranges = <0 e0080000 00040000>; | 288 | ranges = <0 e0080000 00040000>; |
289 | reg = <e0080000 480>; | 289 | reg = <e0080000 480>; |
290 | brg-frequency = <0>; | 290 | brg-frequency = <0>; |
291 | bus-frequency = <179A7B00>; | 291 | bus-frequency = <179A7B00>; |
292 | 292 | ||
293 | muram@10000 { | 293 | muram@10000 { |
294 | device_type = "muram"; | 294 | compatible = "fsl,qe-muram", "fsl,cpm-muram"; |
295 | ranges = <0 00010000 0000c000>; | 295 | ranges = <0 00010000 0000c000>; |
296 | 296 | ||
297 | data-only@0{ | 297 | data-only@0{ |
298 | compatible = "fsl,qe-muram-data", | ||
299 | "fsl,cpm-muram-data"; | ||
298 | reg = <0 c000>; | 300 | reg = <0 c000>; |
299 | }; | 301 | }; |
300 | }; | 302 | }; |
@@ -385,9 +387,9 @@ | |||
385 | }; | 387 | }; |
386 | }; | 388 | }; |
387 | 389 | ||
388 | qeic: qeic@80 { | 390 | qeic: interrupt-controller@80 { |
389 | interrupt-controller; | 391 | interrupt-controller; |
390 | device_type = "qeic"; | 392 | compatible = "fsl,qe-ic"; |
391 | #address-cells = <0>; | 393 | #address-cells = <0>; |
392 | #interrupt-cells = <1>; | 394 | #interrupt-cells = <1>; |
393 | reg = <80 80>; | 395 | reg = <80 80>; |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index dbdd4adef645..6dbc6eabcb02 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -105,6 +105,7 @@ static struct of_device_id mpc832x_ids[] = { | |||
105 | { .type = "soc", }, | 105 | { .type = "soc", }, |
106 | { .compatible = "soc", }, | 106 | { .compatible = "soc", }, |
107 | { .type = "qe", }, | 107 | { .type = "qe", }, |
108 | { .compatible = "fsl,qe", }, | ||
108 | {}, | 109 | {}, |
109 | }; | 110 | }; |
110 | 111 | ||
@@ -134,10 +135,12 @@ static void __init mpc832x_sys_init_IRQ(void) | |||
134 | of_node_put(np); | 135 | of_node_put(np); |
135 | 136 | ||
136 | #ifdef CONFIG_QUICC_ENGINE | 137 | #ifdef CONFIG_QUICC_ENGINE |
137 | np = of_find_node_by_type(NULL, "qeic"); | 138 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); |
138 | if (!np) | 139 | if (!np) { |
139 | return; | 140 | np = of_find_node_by_type(NULL, "qeic"); |
140 | 141 | if (!np) | |
142 | return; | ||
143 | } | ||
141 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | 144 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); |
142 | of_node_put(np); | 145 | of_node_put(np); |
143 | #endif /* CONFIG_QUICC_ENGINE */ | 146 | #endif /* CONFIG_QUICC_ENGINE */ |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c index 5fddd2285abb..9f0fd88b2b1f 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c | |||
@@ -115,6 +115,7 @@ static struct of_device_id mpc832x_ids[] = { | |||
115 | { .type = "soc", }, | 115 | { .type = "soc", }, |
116 | { .compatible = "soc", }, | 116 | { .compatible = "soc", }, |
117 | { .type = "qe", }, | 117 | { .type = "qe", }, |
118 | { .compatible = "fsl,qe", }, | ||
118 | {}, | 119 | {}, |
119 | }; | 120 | }; |
120 | 121 | ||
@@ -145,10 +146,12 @@ void __init mpc832x_rdb_init_IRQ(void) | |||
145 | of_node_put(np); | 146 | of_node_put(np); |
146 | 147 | ||
147 | #ifdef CONFIG_QUICC_ENGINE | 148 | #ifdef CONFIG_QUICC_ENGINE |
148 | np = of_find_node_by_type(NULL, "qeic"); | 149 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); |
149 | if (!np) | 150 | if (!np) { |
150 | return; | 151 | np = of_find_node_by_type(NULL, "qeic"); |
151 | 152 | if (!np) | |
153 | return; | ||
154 | } | ||
152 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | 155 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); |
153 | of_node_put(np); | 156 | of_node_put(np); |
154 | #endif /* CONFIG_QUICC_ENGINE */ | 157 | #endif /* CONFIG_QUICC_ENGINE */ |
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index db491ec006e0..c2e5de60c055 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c | |||
@@ -136,6 +136,7 @@ static struct of_device_id mpc836x_ids[] = { | |||
136 | { .type = "soc", }, | 136 | { .type = "soc", }, |
137 | { .compatible = "soc", }, | 137 | { .compatible = "soc", }, |
138 | { .type = "qe", }, | 138 | { .type = "qe", }, |
139 | { .compatible = "fsl,qe", }, | ||
139 | {}, | 140 | {}, |
140 | }; | 141 | }; |
141 | 142 | ||
@@ -165,10 +166,12 @@ static void __init mpc836x_mds_init_IRQ(void) | |||
165 | of_node_put(np); | 166 | of_node_put(np); |
166 | 167 | ||
167 | #ifdef CONFIG_QUICC_ENGINE | 168 | #ifdef CONFIG_QUICC_ENGINE |
168 | np = of_find_node_by_type(NULL, "qeic"); | 169 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); |
169 | if (!np) | 170 | if (!np) { |
170 | return; | 171 | np = of_find_node_by_type(NULL, "qeic"); |
171 | 172 | if (!np) | |
173 | return; | ||
174 | } | ||
172 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); | 175 | qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); |
173 | of_node_put(np); | 176 | of_node_put(np); |
174 | #endif /* CONFIG_QUICC_ENGINE */ | 177 | #endif /* CONFIG_QUICC_ENGINE */ |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 4fdf5abefffd..25f8bc75e838 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -94,21 +94,25 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | #ifdef CONFIG_QUICC_ENGINE | 96 | #ifdef CONFIG_QUICC_ENGINE |
97 | if ((np = of_find_node_by_name(NULL, "qe")) != NULL) { | 97 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
98 | qe_reset(); | 98 | if (!np) { |
99 | of_node_put(np); | 99 | np = of_find_node_by_name(NULL, "qe"); |
100 | if (!np) | ||
101 | return; | ||
100 | } | 102 | } |
101 | 103 | ||
102 | if ((np = of_find_node_by_name(NULL, "par_io")) != NULL) { | 104 | qe_reset(); |
103 | struct device_node *ucc = NULL; | 105 | of_node_put(np); |
106 | |||
107 | np = of_find_node_by_name(NULL, "par_io"); | ||
108 | if (np) { | ||
109 | struct device_node *ucc; | ||
104 | 110 | ||
105 | par_io_init(np); | 111 | par_io_init(np); |
106 | of_node_put(np); | 112 | of_node_put(np); |
107 | 113 | ||
108 | for ( ;(ucc = of_find_node_by_name(ucc, "ucc")) != NULL;) | 114 | for_each_node_by_name(ucc, "ucc") |
109 | par_io_of_config(ucc); | 115 | par_io_of_config(ucc); |
110 | |||
111 | of_node_put(ucc); | ||
112 | } | 116 | } |
113 | 117 | ||
114 | if (bcsr_regs) { | 118 | if (bcsr_regs) { |
@@ -131,7 +135,6 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
131 | 135 | ||
132 | iounmap(bcsr_regs); | 136 | iounmap(bcsr_regs); |
133 | } | 137 | } |
134 | |||
135 | #endif /* CONFIG_QUICC_ENGINE */ | 138 | #endif /* CONFIG_QUICC_ENGINE */ |
136 | } | 139 | } |
137 | 140 | ||
@@ -139,6 +142,7 @@ static struct of_device_id mpc85xx_ids[] = { | |||
139 | { .type = "soc", }, | 142 | { .type = "soc", }, |
140 | { .compatible = "soc", }, | 143 | { .compatible = "soc", }, |
141 | { .type = "qe", }, | 144 | { .type = "qe", }, |
145 | { .compatible = "fsl,qe", }, | ||
142 | {}, | 146 | {}, |
143 | }; | 147 | }; |
144 | 148 | ||
@@ -176,10 +180,12 @@ static void __init mpc85xx_mds_pic_init(void) | |||
176 | mpic_init(mpic); | 180 | mpic_init(mpic); |
177 | 181 | ||
178 | #ifdef CONFIG_QUICC_ENGINE | 182 | #ifdef CONFIG_QUICC_ENGINE |
179 | np = of_find_node_by_type(NULL, "qeic"); | 183 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); |
180 | if (!np) | 184 | if (!np) { |
181 | return; | 185 | np = of_find_node_by_type(NULL, "qeic"); |
182 | 186 | if (!np) | |
187 | return; | ||
188 | } | ||
183 | qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); | 189 | qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); |
184 | of_node_put(np); | 190 | of_node_put(np); |
185 | #endif /* CONFIG_QUICC_ENGINE */ | 191 | #endif /* CONFIG_QUICC_ENGINE */ |
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index f2c0988a03b8..26f7d83c4be5 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -1276,7 +1276,10 @@ int __init fsl_spi_init(struct spi_board_info *board_infos, | |||
1276 | const u32 *sysclk; | 1276 | const u32 *sysclk; |
1277 | 1277 | ||
1278 | /* SPI controller is either clocked from QE or SoC clock */ | 1278 | /* SPI controller is either clocked from QE or SoC clock */ |
1279 | np = of_find_node_by_type(NULL, "qe"); | 1279 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
1280 | if (!np) | ||
1281 | np = of_find_node_by_type(NULL, "qe"); | ||
1282 | |||
1280 | if (!np) | 1283 | if (!np) |
1281 | np = of_find_node_by_type(NULL, "soc"); | 1284 | np = of_find_node_by_type(NULL, "soc"); |
1282 | 1285 | ||
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index 3925eae9b0f5..5ef844da9355 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -65,17 +65,22 @@ static phys_addr_t qebase = -1; | |||
65 | phys_addr_t get_qe_base(void) | 65 | phys_addr_t get_qe_base(void) |
66 | { | 66 | { |
67 | struct device_node *qe; | 67 | struct device_node *qe; |
68 | unsigned int size; | ||
69 | const void *prop; | ||
68 | 70 | ||
69 | if (qebase != -1) | 71 | if (qebase != -1) |
70 | return qebase; | 72 | return qebase; |
71 | 73 | ||
72 | qe = of_find_node_by_type(NULL, "qe"); | 74 | qe = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
73 | if (qe) { | 75 | if (!qe) { |
74 | unsigned int size; | 76 | qe = of_find_node_by_type(NULL, "qe"); |
75 | const void *prop = of_get_property(qe, "reg", &size); | 77 | if (!qe) |
76 | qebase = of_translate_address(qe, prop); | 78 | return qebase; |
77 | of_node_put(qe); | 79 | } |
78 | }; | 80 | |
81 | prop = of_get_property(qe, "reg", &size); | ||
82 | qebase = of_translate_address(qe, prop); | ||
83 | of_node_put(qe); | ||
79 | 84 | ||
80 | return qebase; | 85 | return qebase; |
81 | } | 86 | } |
@@ -153,16 +158,26 @@ static unsigned int brg_clk = 0; | |||
153 | unsigned int get_brg_clk(void) | 158 | unsigned int get_brg_clk(void) |
154 | { | 159 | { |
155 | struct device_node *qe; | 160 | struct device_node *qe; |
161 | unsigned int size; | ||
162 | const u32 *prop; | ||
163 | |||
156 | if (brg_clk) | 164 | if (brg_clk) |
157 | return brg_clk; | 165 | return brg_clk; |
158 | 166 | ||
159 | qe = of_find_node_by_type(NULL, "qe"); | 167 | qe = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
160 | if (qe) { | 168 | if (!qe) { |
161 | unsigned int size; | 169 | qe = of_find_node_by_type(NULL, "qe"); |
162 | const u32 *prop = of_get_property(qe, "brg-frequency", &size); | 170 | if (!qe) |
163 | brg_clk = *prop; | 171 | return brg_clk; |
164 | of_node_put(qe); | 172 | } |
165 | }; | 173 | |
174 | prop = of_get_property(qe, "brg-frequency", &size); | ||
175 | if (!prop || size != sizeof(*prop)) | ||
176 | return brg_clk; | ||
177 | |||
178 | brg_clk = *prop; | ||
179 | of_node_put(qe); | ||
180 | |||
166 | return brg_clk; | 181 | return brg_clk; |
167 | } | 182 | } |
168 | 183 | ||
@@ -322,7 +337,7 @@ static rh_info_t qe_muram_info; | |||
322 | static void qe_muram_init(void) | 337 | static void qe_muram_init(void) |
323 | { | 338 | { |
324 | struct device_node *np; | 339 | struct device_node *np; |
325 | u32 address; | 340 | const u32 *address; |
326 | u64 size; | 341 | u64 size; |
327 | unsigned int flags; | 342 | unsigned int flags; |
328 | 343 | ||
@@ -335,11 +350,21 @@ static void qe_muram_init(void) | |||
335 | /* XXX: This is a subset of the available muram. It | 350 | /* XXX: This is a subset of the available muram. It |
336 | * varies with the processor and the microcode patches activated. | 351 | * varies with the processor and the microcode patches activated. |
337 | */ | 352 | */ |
338 | if ((np = of_find_node_by_name(NULL, "data-only")) != NULL) { | 353 | np = of_find_compatible_node(NULL, NULL, "fsl,qe-muram-data"); |
339 | address = *of_get_address(np, 0, &size, &flags); | 354 | if (!np) { |
340 | of_node_put(np); | 355 | np = of_find_node_by_name(NULL, "data-only"); |
341 | rh_attach_region(&qe_muram_info, address, (int) size); | 356 | if (!np) { |
357 | WARN_ON(1); | ||
358 | return; | ||
359 | } | ||
342 | } | 360 | } |
361 | |||
362 | address = of_get_address(np, 0, &size, &flags); | ||
363 | WARN_ON(!address); | ||
364 | |||
365 | of_node_put(np); | ||
366 | if (address) | ||
367 | rh_attach_region(&qe_muram_info, *address, (int)size); | ||
343 | } | 368 | } |
344 | 369 | ||
345 | /* This function returns an index into the MURAM area. | 370 | /* This function returns an index into the MURAM area. |