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 /arch/powerpc/sysdev | |
| 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>
Diffstat (limited to 'arch/powerpc/sysdev')
| -rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 5 | ||||
| -rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe.c | 63 |
2 files changed, 48 insertions, 20 deletions
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. |
