diff options
author | Haiying Wang <Haiying.Wang@freescale.com> | 2010-05-21 10:16:12 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2010-05-24 22:29:25 -0400 |
commit | 48936a08b85518c22a9467a8eaac35d43af54ab4 (patch) | |
tree | 49243b31d948199f5141377c4bb58d1c5224b645 /arch/powerpc/platforms | |
parent | 710e33832653cccf7fc432023e7dbe8c49a1902f (diff) |
powerpc/85xx: Add P1021MDS board support
P1021 is a dual e500v2 core based SOC with:
* 3 eTSECs (eTSEC1/3 RGMII, eTSEC2 SGMII on this board)
* 2 PCIe Controller
* 1 USB2.0 controller
* eSDHC, eSPI, I2C, DUART
* eLBC (NAND, BCSR, PMC0/1)
* Security Engine (SEC 3.3.2)
* Quicc Engine (QE)
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Yu Liu <Yu.Liu@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/85xx/mpc85xx_mds.c | 102 |
1 files changed, 99 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index f0684c8ac960..8fe87fc61485 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Freescale Semicondutor, Inc. 2006-2007. All rights reserved. | 2 | * Copyright (C) Freescale Semicondutor, Inc. 2006-2010. All rights reserved. |
3 | * | 3 | * |
4 | * Author: Andy Fleming <afleming@freescale.com> | 4 | * Author: Andy Fleming <afleming@freescale.com> |
5 | * | 5 | * |
@@ -154,6 +154,10 @@ static int mpc8568_mds_phy_fixups(struct phy_device *phydev) | |||
154 | * Setup the architecture | 154 | * Setup the architecture |
155 | * | 155 | * |
156 | */ | 156 | */ |
157 | #ifdef CONFIG_SMP | ||
158 | extern void __init mpc85xx_smp_init(void); | ||
159 | #endif | ||
160 | |||
157 | static void __init mpc85xx_mds_setup_arch(void) | 161 | static void __init mpc85xx_mds_setup_arch(void) |
158 | { | 162 | { |
159 | struct device_node *np; | 163 | struct device_node *np; |
@@ -194,6 +198,10 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
194 | } | 198 | } |
195 | #endif | 199 | #endif |
196 | 200 | ||
201 | #ifdef CONFIG_SMP | ||
202 | mpc85xx_smp_init(); | ||
203 | #endif | ||
204 | |||
197 | #ifdef CONFIG_QUICC_ENGINE | 205 | #ifdef CONFIG_QUICC_ENGINE |
198 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); | 206 | np = of_find_compatible_node(NULL, NULL, "fsl,qe"); |
199 | if (!np) { | 207 | if (!np) { |
@@ -271,9 +279,49 @@ static void __init mpc85xx_mds_setup_arch(void) | |||
271 | BCSR_UCC_RGMII, BCSR_UCC_RTBI); | 279 | BCSR_UCC_RGMII, BCSR_UCC_RTBI); |
272 | } | 280 | } |
273 | 281 | ||
282 | } else if (machine_is(p1021_mds)) { | ||
283 | #define BCSR11_ENET_MICRST (0x1 << 5) | ||
284 | /* Reset Micrel PHY */ | ||
285 | clrbits8(&bcsr_regs[11], BCSR11_ENET_MICRST); | ||
286 | setbits8(&bcsr_regs[11], BCSR11_ENET_MICRST); | ||
274 | } | 287 | } |
288 | |||
275 | iounmap(bcsr_regs); | 289 | iounmap(bcsr_regs); |
276 | } | 290 | } |
291 | |||
292 | if (machine_is(p1021_mds)) { | ||
293 | #define MPC85xx_PMUXCR_OFFSET 0x60 | ||
294 | #define MPC85xx_PMUXCR_QE0 0x00008000 | ||
295 | #define MPC85xx_PMUXCR_QE3 0x00001000 | ||
296 | #define MPC85xx_PMUXCR_QE9 0x00000040 | ||
297 | #define MPC85xx_PMUXCR_QE12 0x00000008 | ||
298 | static __be32 __iomem *pmuxcr; | ||
299 | |||
300 | np = of_find_node_by_name(NULL, "global-utilities"); | ||
301 | |||
302 | if (np) { | ||
303 | pmuxcr = of_iomap(np, 0) + MPC85xx_PMUXCR_OFFSET; | ||
304 | |||
305 | if (!pmuxcr) | ||
306 | printk(KERN_EMERG "Error: Alternate function" | ||
307 | " signal multiplex control register not" | ||
308 | " mapped!\n"); | ||
309 | else | ||
310 | /* P1021 has pins muxed for QE and other functions. To | ||
311 | * enable QE UEC mode, we need to set bit QE0 for UCC1 | ||
312 | * in Eth mode, QE0 and QE3 for UCC5 in Eth mode, QE9 | ||
313 | * and QE12 for QE MII management singals in PMUXCR | ||
314 | * register. | ||
315 | */ | ||
316 | setbits32(pmuxcr, MPC85xx_PMUXCR_QE0 | | ||
317 | MPC85xx_PMUXCR_QE3 | | ||
318 | MPC85xx_PMUXCR_QE9 | | ||
319 | MPC85xx_PMUXCR_QE12); | ||
320 | |||
321 | of_node_put(np); | ||
322 | } | ||
323 | |||
324 | } | ||
277 | #endif /* CONFIG_QUICC_ENGINE */ | 325 | #endif /* CONFIG_QUICC_ENGINE */ |
278 | 326 | ||
279 | #ifdef CONFIG_SWIOTLB | 327 | #ifdef CONFIG_SWIOTLB |
@@ -330,6 +378,16 @@ static struct of_device_id mpc85xx_ids[] = { | |||
330 | {}, | 378 | {}, |
331 | }; | 379 | }; |
332 | 380 | ||
381 | static struct of_device_id p1021_ids[] = { | ||
382 | { .type = "soc", }, | ||
383 | { .compatible = "soc", }, | ||
384 | { .compatible = "simple-bus", }, | ||
385 | { .type = "qe", }, | ||
386 | { .compatible = "fsl,qe", }, | ||
387 | { .compatible = "gianfar", }, | ||
388 | {}, | ||
389 | }; | ||
390 | |||
333 | static int __init mpc85xx_publish_devices(void) | 391 | static int __init mpc85xx_publish_devices(void) |
334 | { | 392 | { |
335 | if (machine_is(mpc8568_mds)) | 393 | if (machine_is(mpc8568_mds)) |
@@ -342,11 +400,22 @@ static int __init mpc85xx_publish_devices(void) | |||
342 | 400 | ||
343 | return 0; | 401 | return 0; |
344 | } | 402 | } |
403 | |||
404 | static int __init p1021_publish_devices(void) | ||
405 | { | ||
406 | /* Publish the QE devices */ | ||
407 | of_platform_bus_probe(NULL, p1021_ids, NULL); | ||
408 | |||
409 | return 0; | ||
410 | } | ||
411 | |||
345 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); | 412 | machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); |
346 | machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); | 413 | machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices); |
414 | machine_device_initcall(p1021_mds, p1021_publish_devices); | ||
347 | 415 | ||
348 | machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); | 416 | machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier); |
349 | machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); | 417 | machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier); |
418 | machine_arch_initcall(p1021_mds, swiotlb_setup_bus_notifier); | ||
350 | 419 | ||
351 | static void __init mpc85xx_mds_pic_init(void) | 420 | static void __init mpc85xx_mds_pic_init(void) |
352 | { | 421 | { |
@@ -366,7 +435,7 @@ static void __init mpc85xx_mds_pic_init(void) | |||
366 | 435 | ||
367 | mpic = mpic_alloc(np, r.start, | 436 | mpic = mpic_alloc(np, r.start, |
368 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | | 437 | MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN | |
369 | MPIC_BROKEN_FRR_NIRQS, | 438 | MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU, |
370 | 0, 256, " OpenPIC "); | 439 | 0, 256, " OpenPIC "); |
371 | BUG_ON(mpic == NULL); | 440 | BUG_ON(mpic == NULL); |
372 | of_node_put(np); | 441 | of_node_put(np); |
@@ -380,7 +449,11 @@ static void __init mpc85xx_mds_pic_init(void) | |||
380 | if (!np) | 449 | if (!np) |
381 | return; | 450 | return; |
382 | } | 451 | } |
383 | qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); | 452 | if (machine_is(p1021_mds)) |
453 | qe_ic_init(np, 0, qe_ic_cascade_low_mpic, | ||
454 | qe_ic_cascade_high_mpic); | ||
455 | else | ||
456 | qe_ic_init(np, 0, qe_ic_cascade_muxed_mpic, NULL); | ||
384 | of_node_put(np); | 457 | of_node_put(np); |
385 | #endif /* CONFIG_QUICC_ENGINE */ | 458 | #endif /* CONFIG_QUICC_ENGINE */ |
386 | } | 459 | } |
@@ -426,3 +499,26 @@ define_machine(mpc8569_mds) { | |||
426 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | 499 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, |
427 | #endif | 500 | #endif |
428 | }; | 501 | }; |
502 | |||
503 | static int __init p1021_mds_probe(void) | ||
504 | { | ||
505 | unsigned long root = of_get_flat_dt_root(); | ||
506 | |||
507 | return of_flat_dt_is_compatible(root, "fsl,P1021MDS"); | ||
508 | |||
509 | } | ||
510 | |||
511 | define_machine(p1021_mds) { | ||
512 | .name = "P1021 MDS", | ||
513 | .probe = p1021_mds_probe, | ||
514 | .setup_arch = mpc85xx_mds_setup_arch, | ||
515 | .init_IRQ = mpc85xx_mds_pic_init, | ||
516 | .get_irq = mpic_get_irq, | ||
517 | .restart = fsl_rstcr_restart, | ||
518 | .calibrate_decr = generic_calibrate_decr, | ||
519 | .progress = udbg_progress, | ||
520 | #ifdef CONFIG_PCI | ||
521 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | ||
522 | #endif | ||
523 | }; | ||
524 | |||