aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm644x.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/dm644x.c')
-rw-r--r--arch/arm/mach-davinci/dm644x.c141
1 files changed, 130 insertions, 11 deletions
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index fb5449b3c97b..d6e0fa5a8d8a 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -27,6 +27,7 @@
27#include <mach/time.h> 27#include <mach/time.h>
28#include <mach/serial.h> 28#include <mach/serial.h>
29#include <mach/common.h> 29#include <mach/common.h>
30#include <mach/asp.h>
30 31
31#include "clock.h" 32#include "clock.h"
32#include "mux.h" 33#include "mux.h"
@@ -303,7 +304,7 @@ struct davinci_clk dm644x_clks[] = {
303 CLK("davinci_emac.1", NULL, &emac_clk), 304 CLK("davinci_emac.1", NULL, &emac_clk),
304 CLK("i2c_davinci.1", NULL, &i2c_clk), 305 CLK("i2c_davinci.1", NULL, &i2c_clk),
305 CLK("palm_bk3710", NULL, &ide_clk), 306 CLK("palm_bk3710", NULL, &ide_clk),
306 CLK("soc-audio.0", NULL, &asp_clk), 307 CLK("davinci-asp", NULL, &asp_clk),
307 CLK("davinci_mmc.0", NULL, &mmcsd_clk), 308 CLK("davinci_mmc.0", NULL, &mmcsd_clk),
308 CLK(NULL, "spi", &spi_clk), 309 CLK(NULL, "spi", &spi_clk),
309 CLK(NULL, "gpio", &gpio_clk), 310 CLK(NULL, "gpio", &gpio_clk),
@@ -484,17 +485,38 @@ static const s8 dma_chan_dm644x_no_event[] = {
484 -1 485 -1
485}; 486};
486 487
487static struct edma_soc_info dm644x_edma_info = { 488static const s8
488 .n_channel = 64, 489queue_tc_mapping[][2] = {
489 .n_region = 4, 490 /* {event queue no, TC no} */
490 .n_slot = 128, 491 {0, 0},
491 .n_tc = 2, 492 {1, 1},
492 .noevent = dma_chan_dm644x_no_event, 493 {-1, -1},
494};
495
496static const s8
497queue_priority_mapping[][2] = {
498 /* {event queue no, Priority} */
499 {0, 3},
500 {1, 7},
501 {-1, -1},
502};
503
504static struct edma_soc_info dm644x_edma_info[] = {
505 {
506 .n_channel = 64,
507 .n_region = 4,
508 .n_slot = 128,
509 .n_tc = 2,
510 .n_cc = 1,
511 .noevent = dma_chan_dm644x_no_event,
512 .queue_tc_mapping = queue_tc_mapping,
513 .queue_priority_mapping = queue_priority_mapping,
514 },
493}; 515};
494 516
495static struct resource edma_resources[] = { 517static struct resource edma_resources[] = {
496 { 518 {
497 .name = "edma_cc", 519 .name = "edma_cc0",
498 .start = 0x01c00000, 520 .start = 0x01c00000,
499 .end = 0x01c00000 + SZ_64K - 1, 521 .end = 0x01c00000 + SZ_64K - 1,
500 .flags = IORESOURCE_MEM, 522 .flags = IORESOURCE_MEM,
@@ -512,10 +534,12 @@ static struct resource edma_resources[] = {
512 .flags = IORESOURCE_MEM, 534 .flags = IORESOURCE_MEM,
513 }, 535 },
514 { 536 {
537 .name = "edma0",
515 .start = IRQ_CCINT0, 538 .start = IRQ_CCINT0,
516 .flags = IORESOURCE_IRQ, 539 .flags = IORESOURCE_IRQ,
517 }, 540 },
518 { 541 {
542 .name = "edma0_err",
519 .start = IRQ_CCERRINT, 543 .start = IRQ_CCERRINT,
520 .flags = IORESOURCE_IRQ, 544 .flags = IORESOURCE_IRQ,
521 }, 545 },
@@ -524,12 +548,91 @@ static struct resource edma_resources[] = {
524 548
525static struct platform_device dm644x_edma_device = { 549static struct platform_device dm644x_edma_device = {
526 .name = "edma", 550 .name = "edma",
527 .id = -1, 551 .id = 0,
528 .dev.platform_data = &dm644x_edma_info, 552 .dev.platform_data = dm644x_edma_info,
529 .num_resources = ARRAY_SIZE(edma_resources), 553 .num_resources = ARRAY_SIZE(edma_resources),
530 .resource = edma_resources, 554 .resource = edma_resources,
531}; 555};
532 556
557/* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */
558static struct resource dm644x_asp_resources[] = {
559 {
560 .start = DAVINCI_ASP0_BASE,
561 .end = DAVINCI_ASP0_BASE + SZ_8K - 1,
562 .flags = IORESOURCE_MEM,
563 },
564 {
565 .start = DAVINCI_DMA_ASP0_TX,
566 .end = DAVINCI_DMA_ASP0_TX,
567 .flags = IORESOURCE_DMA,
568 },
569 {
570 .start = DAVINCI_DMA_ASP0_RX,
571 .end = DAVINCI_DMA_ASP0_RX,
572 .flags = IORESOURCE_DMA,
573 },
574};
575
576static struct platform_device dm644x_asp_device = {
577 .name = "davinci-asp",
578 .id = -1,
579 .num_resources = ARRAY_SIZE(dm644x_asp_resources),
580 .resource = dm644x_asp_resources,
581};
582
583static struct resource dm644x_vpss_resources[] = {
584 {
585 /* VPSS Base address */
586 .name = "vpss",
587 .start = 0x01c73400,
588 .end = 0x01c73400 + 0xff,
589 .flags = IORESOURCE_MEM,
590 },
591};
592
593static struct platform_device dm644x_vpss_device = {
594 .name = "vpss",
595 .id = -1,
596 .dev.platform_data = "dm644x_vpss",
597 .num_resources = ARRAY_SIZE(dm644x_vpss_resources),
598 .resource = dm644x_vpss_resources,
599};
600
601static struct resource vpfe_resources[] = {
602 {
603 .start = IRQ_VDINT0,
604 .end = IRQ_VDINT0,
605 .flags = IORESOURCE_IRQ,
606 },
607 {
608 .start = IRQ_VDINT1,
609 .end = IRQ_VDINT1,
610 .flags = IORESOURCE_IRQ,
611 },
612 {
613 .start = 0x01c70400,
614 .end = 0x01c70400 + 0xff,
615 .flags = IORESOURCE_MEM,
616 },
617};
618
619static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
620static struct platform_device vpfe_capture_dev = {
621 .name = CAPTURE_DRV_NAME,
622 .id = -1,
623 .num_resources = ARRAY_SIZE(vpfe_resources),
624 .resource = vpfe_resources,
625 .dev = {
626 .dma_mask = &vpfe_capture_dma_mask,
627 .coherent_dma_mask = DMA_BIT_MASK(32),
628 },
629};
630
631void dm644x_set_vpfe_config(struct vpfe_config *cfg)
632{
633 vpfe_capture_dev.dev.platform_data = cfg;
634}
635
533/*----------------------------------------------------------------------*/ 636/*----------------------------------------------------------------------*/
534 637
535static struct map_desc dm644x_io_desc[] = { 638static struct map_desc dm644x_io_desc[] = {
@@ -557,6 +660,13 @@ static struct davinci_id dm644x_ids[] = {
557 .cpu_id = DAVINCI_CPU_ID_DM6446, 660 .cpu_id = DAVINCI_CPU_ID_DM6446,
558 .name = "dm6446", 661 .name = "dm6446",
559 }, 662 },
663 {
664 .variant = 0x1,
665 .part_no = 0xb700,
666 .manufacturer = 0x017,
667 .cpu_id = DAVINCI_CPU_ID_DM6446,
668 .name = "dm6446a",
669 },
560}; 670};
561 671
562static void __iomem *dm644x_psc_bases[] = { 672static void __iomem *dm644x_psc_bases[] = {
@@ -630,7 +740,6 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
630 .intc_irq_prios = dm644x_default_priorities, 740 .intc_irq_prios = dm644x_default_priorities,
631 .intc_irq_num = DAVINCI_N_AINTC_IRQ, 741 .intc_irq_num = DAVINCI_N_AINTC_IRQ,
632 .timer_info = &dm644x_timer_info, 742 .timer_info = &dm644x_timer_info,
633 .wdt_base = IO_ADDRESS(DAVINCI_WDOG_BASE),
634 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE), 743 .gpio_base = IO_ADDRESS(DAVINCI_GPIO_BASE),
635 .gpio_num = 71, 744 .gpio_num = 71,
636 .gpio_irq = IRQ_GPIOBNK0, 745 .gpio_irq = IRQ_GPIOBNK0,
@@ -640,6 +749,13 @@ static struct davinci_soc_info davinci_soc_info_dm644x = {
640 .sram_len = SZ_16K, 749 .sram_len = SZ_16K,
641}; 750};
642 751
752void __init dm644x_init_asp(struct snd_platform_data *pdata)
753{
754 davinci_cfg_reg(DM644X_MCBSP);
755 dm644x_asp_device.dev.platform_data = pdata;
756 platform_device_register(&dm644x_asp_device);
757}
758
643void __init dm644x_init(void) 759void __init dm644x_init(void)
644{ 760{
645 davinci_common_init(&davinci_soc_info_dm644x); 761 davinci_common_init(&davinci_soc_info_dm644x);
@@ -652,6 +768,9 @@ static int __init dm644x_init_devices(void)
652 768
653 platform_device_register(&dm644x_edma_device); 769 platform_device_register(&dm644x_edma_device);
654 platform_device_register(&dm644x_emac_device); 770 platform_device_register(&dm644x_emac_device);
771 platform_device_register(&dm644x_vpss_device);
772 platform_device_register(&vpfe_capture_dev);
773
655 return 0; 774 return 0;
656} 775}
657postcore_initcall(dm644x_init_devices); 776postcore_initcall(dm644x_init_devices);