diff options
author | Viresh Kumar <viresh.kumar@st.com> | 2012-03-26 00:59:23 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-04-22 16:41:35 -0400 |
commit | 0b7ee71794b043de8a02d8887b69a57e4003106a (patch) | |
tree | fb4386d24146993d3c1400abbc6974c27c16722d /arch/arm/mach-spear3xx/spear300.c | |
parent | c5fa4fdcdbe5f52c3e36892cc81f9378339b00ce (diff) |
SPEAr: Add PL080 DMA support for 3xx and 6xx
Both SPEAr3xx and SPEAr6xx families have one instance of ARM PL080 DMA
controller. This patch adds in support for that.
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Diffstat (limited to 'arch/arm/mach-spear3xx/spear300.c')
-rw-r--r-- | arch/arm/mach-spear3xx/spear300.c | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c index c876c6a2caad..f46fc2692ab6 100644 --- a/arch/arm/mach-spear3xx/spear300.c +++ b/arch/arm/mach-spear3xx/spear300.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #define pr_fmt(fmt) "SPEAr300: " fmt | 14 | #define pr_fmt(fmt) "SPEAr300: " fmt |
15 | 15 | ||
16 | #include <linux/amba/pl08x.h> | ||
16 | #include <linux/of_platform.h> | 17 | #include <linux/of_platform.h> |
17 | #include <asm/hardware/vic.h> | 18 | #include <asm/hardware/vic.h> |
18 | #include <asm/mach/arch.h> | 19 | #include <asm/mach/arch.h> |
@@ -440,10 +441,199 @@ static struct pmx_dev *spear300_evb_pmx_devs[] = { | |||
440 | &spear300_pmx_gpio1, | 441 | &spear300_pmx_gpio1, |
441 | }; | 442 | }; |
442 | 443 | ||
444 | /* DMAC platform data's slave info */ | ||
445 | struct pl08x_channel_data spear300_dma_info[] = { | ||
446 | { | ||
447 | .bus_id = "uart0_rx", | ||
448 | .min_signal = 2, | ||
449 | .max_signal = 2, | ||
450 | .muxval = 0, | ||
451 | .cctl = 0, | ||
452 | .periph_buses = PL08X_AHB1, | ||
453 | }, { | ||
454 | .bus_id = "uart0_tx", | ||
455 | .min_signal = 3, | ||
456 | .max_signal = 3, | ||
457 | .muxval = 0, | ||
458 | .cctl = 0, | ||
459 | .periph_buses = PL08X_AHB1, | ||
460 | }, { | ||
461 | .bus_id = "ssp0_rx", | ||
462 | .min_signal = 8, | ||
463 | .max_signal = 8, | ||
464 | .muxval = 0, | ||
465 | .cctl = 0, | ||
466 | .periph_buses = PL08X_AHB1, | ||
467 | }, { | ||
468 | .bus_id = "ssp0_tx", | ||
469 | .min_signal = 9, | ||
470 | .max_signal = 9, | ||
471 | .muxval = 0, | ||
472 | .cctl = 0, | ||
473 | .periph_buses = PL08X_AHB1, | ||
474 | }, { | ||
475 | .bus_id = "i2c_rx", | ||
476 | .min_signal = 10, | ||
477 | .max_signal = 10, | ||
478 | .muxval = 0, | ||
479 | .cctl = 0, | ||
480 | .periph_buses = PL08X_AHB1, | ||
481 | }, { | ||
482 | .bus_id = "i2c_tx", | ||
483 | .min_signal = 11, | ||
484 | .max_signal = 11, | ||
485 | .muxval = 0, | ||
486 | .cctl = 0, | ||
487 | .periph_buses = PL08X_AHB1, | ||
488 | }, { | ||
489 | .bus_id = "irda", | ||
490 | .min_signal = 12, | ||
491 | .max_signal = 12, | ||
492 | .muxval = 0, | ||
493 | .cctl = 0, | ||
494 | .periph_buses = PL08X_AHB1, | ||
495 | }, { | ||
496 | .bus_id = "adc", | ||
497 | .min_signal = 13, | ||
498 | .max_signal = 13, | ||
499 | .muxval = 0, | ||
500 | .cctl = 0, | ||
501 | .periph_buses = PL08X_AHB1, | ||
502 | }, { | ||
503 | .bus_id = "to_jpeg", | ||
504 | .min_signal = 14, | ||
505 | .max_signal = 14, | ||
506 | .muxval = 0, | ||
507 | .cctl = 0, | ||
508 | .periph_buses = PL08X_AHB1, | ||
509 | }, { | ||
510 | .bus_id = "from_jpeg", | ||
511 | .min_signal = 15, | ||
512 | .max_signal = 15, | ||
513 | .muxval = 0, | ||
514 | .cctl = 0, | ||
515 | .periph_buses = PL08X_AHB1, | ||
516 | }, { | ||
517 | .bus_id = "ras0_rx", | ||
518 | .min_signal = 0, | ||
519 | .max_signal = 0, | ||
520 | .muxval = 1, | ||
521 | .cctl = 0, | ||
522 | .periph_buses = PL08X_AHB1, | ||
523 | }, { | ||
524 | .bus_id = "ras0_tx", | ||
525 | .min_signal = 1, | ||
526 | .max_signal = 1, | ||
527 | .muxval = 1, | ||
528 | .cctl = 0, | ||
529 | .periph_buses = PL08X_AHB1, | ||
530 | }, { | ||
531 | .bus_id = "ras1_rx", | ||
532 | .min_signal = 2, | ||
533 | .max_signal = 2, | ||
534 | .muxval = 1, | ||
535 | .cctl = 0, | ||
536 | .periph_buses = PL08X_AHB1, | ||
537 | }, { | ||
538 | .bus_id = "ras1_tx", | ||
539 | .min_signal = 3, | ||
540 | .max_signal = 3, | ||
541 | .muxval = 1, | ||
542 | .cctl = 0, | ||
543 | .periph_buses = PL08X_AHB1, | ||
544 | }, { | ||
545 | .bus_id = "ras2_rx", | ||
546 | .min_signal = 4, | ||
547 | .max_signal = 4, | ||
548 | .muxval = 1, | ||
549 | .cctl = 0, | ||
550 | .periph_buses = PL08X_AHB1, | ||
551 | }, { | ||
552 | .bus_id = "ras2_tx", | ||
553 | .min_signal = 5, | ||
554 | .max_signal = 5, | ||
555 | .muxval = 1, | ||
556 | .cctl = 0, | ||
557 | .periph_buses = PL08X_AHB1, | ||
558 | }, { | ||
559 | .bus_id = "ras3_rx", | ||
560 | .min_signal = 6, | ||
561 | .max_signal = 6, | ||
562 | .muxval = 1, | ||
563 | .cctl = 0, | ||
564 | .periph_buses = PL08X_AHB1, | ||
565 | }, { | ||
566 | .bus_id = "ras3_tx", | ||
567 | .min_signal = 7, | ||
568 | .max_signal = 7, | ||
569 | .muxval = 1, | ||
570 | .cctl = 0, | ||
571 | .periph_buses = PL08X_AHB1, | ||
572 | }, { | ||
573 | .bus_id = "ras4_rx", | ||
574 | .min_signal = 8, | ||
575 | .max_signal = 8, | ||
576 | .muxval = 1, | ||
577 | .cctl = 0, | ||
578 | .periph_buses = PL08X_AHB1, | ||
579 | }, { | ||
580 | .bus_id = "ras4_tx", | ||
581 | .min_signal = 9, | ||
582 | .max_signal = 9, | ||
583 | .muxval = 1, | ||
584 | .cctl = 0, | ||
585 | .periph_buses = PL08X_AHB1, | ||
586 | }, { | ||
587 | .bus_id = "ras5_rx", | ||
588 | .min_signal = 10, | ||
589 | .max_signal = 10, | ||
590 | .muxval = 1, | ||
591 | .cctl = 0, | ||
592 | .periph_buses = PL08X_AHB1, | ||
593 | }, { | ||
594 | .bus_id = "ras5_tx", | ||
595 | .min_signal = 11, | ||
596 | .max_signal = 11, | ||
597 | .muxval = 1, | ||
598 | .cctl = 0, | ||
599 | .periph_buses = PL08X_AHB1, | ||
600 | }, { | ||
601 | .bus_id = "ras6_rx", | ||
602 | .min_signal = 12, | ||
603 | .max_signal = 12, | ||
604 | .muxval = 1, | ||
605 | .cctl = 0, | ||
606 | .periph_buses = PL08X_AHB1, | ||
607 | }, { | ||
608 | .bus_id = "ras6_tx", | ||
609 | .min_signal = 13, | ||
610 | .max_signal = 13, | ||
611 | .muxval = 1, | ||
612 | .cctl = 0, | ||
613 | .periph_buses = PL08X_AHB1, | ||
614 | }, { | ||
615 | .bus_id = "ras7_rx", | ||
616 | .min_signal = 14, | ||
617 | .max_signal = 14, | ||
618 | .muxval = 1, | ||
619 | .cctl = 0, | ||
620 | .periph_buses = PL08X_AHB1, | ||
621 | }, { | ||
622 | .bus_id = "ras7_tx", | ||
623 | .min_signal = 15, | ||
624 | .max_signal = 15, | ||
625 | .muxval = 1, | ||
626 | .cctl = 0, | ||
627 | .periph_buses = PL08X_AHB1, | ||
628 | }, | ||
629 | }; | ||
630 | |||
443 | /* Add SPEAr300 auxdata to pass platform data */ | 631 | /* Add SPEAr300 auxdata to pass platform data */ |
444 | static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { | 632 | static struct of_dev_auxdata spear300_auxdata_lookup[] __initdata = { |
445 | OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, | 633 | OF_DEV_AUXDATA("arm,pl022", SPEAR3XX_ICM1_SSP_BASE, NULL, |
446 | &pl022_plat_data), | 634 | &pl022_plat_data), |
635 | OF_DEV_AUXDATA("arm,pl080", SPEAR3XX_ICM3_DMA_BASE, NULL, | ||
636 | &pl080_plat_data), | ||
447 | {} | 637 | {} |
448 | }; | 638 | }; |
449 | 639 | ||
@@ -451,6 +641,9 @@ static void __init spear300_dt_init(void) | |||
451 | { | 641 | { |
452 | int ret = -EINVAL; | 642 | int ret = -EINVAL; |
453 | 643 | ||
644 | pl080_plat_data.slave_channels = spear300_dma_info; | ||
645 | pl080_plat_data.num_slave_channels = ARRAY_SIZE(spear300_dma_info); | ||
646 | |||
454 | of_platform_populate(NULL, of_default_bus_match_table, | 647 | of_platform_populate(NULL, of_default_bus_match_table, |
455 | spear300_auxdata_lookup, NULL); | 648 | spear300_auxdata_lookup, NULL); |
456 | 649 | ||