aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/dm355.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/dm355.c')
-rw-r--r--arch/arm/mach-davinci/dm355.c92
1 files changed, 59 insertions, 33 deletions
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index dedf4d4f3a27..3dc0a88712eb 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -29,6 +29,7 @@
29#include <mach/serial.h> 29#include <mach/serial.h>
30#include <mach/common.h> 30#include <mach/common.h>
31#include <mach/asp.h> 31#include <mach/asp.h>
32#include <mach/spi.h>
32 33
33#include "clock.h" 34#include "clock.h"
34#include "mux.h" 35#include "mux.h"
@@ -125,7 +126,6 @@ static struct clk vpss_slave_clk = {
125 .lpsc = DAVINCI_LPSC_VPSSSLV, 126 .lpsc = DAVINCI_LPSC_VPSSSLV,
126}; 127};
127 128
128
129static struct clk clkout1_clk = { 129static struct clk clkout1_clk = {
130 .name = "clkout1", 130 .name = "clkout1",
131 .parent = &pll1_aux_clk, 131 .parent = &pll1_aux_clk,
@@ -335,7 +335,7 @@ static struct clk usb_clk = {
335 .lpsc = DAVINCI_LPSC_USB, 335 .lpsc = DAVINCI_LPSC_USB,
336}; 336};
337 337
338static struct davinci_clk dm355_clks[] = { 338static struct clk_lookup dm355_clks[] = {
339 CLK(NULL, "ref", &ref_clk), 339 CLK(NULL, "ref", &ref_clk),
340 CLK(NULL, "pll1", &pll1_clk), 340 CLK(NULL, "pll1", &pll1_clk),
341 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1), 341 CLK(NULL, "pll1_sysclk1", &pll1_sysclk1),
@@ -363,9 +363,9 @@ static struct davinci_clk dm355_clks[] = {
363 CLK("davinci-asp.1", NULL, &asp1_clk), 363 CLK("davinci-asp.1", NULL, &asp1_clk),
364 CLK("davinci_mmc.0", NULL, &mmcsd0_clk), 364 CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
365 CLK("davinci_mmc.1", NULL, &mmcsd1_clk), 365 CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
366 CLK(NULL, "spi0", &spi0_clk), 366 CLK("spi_davinci.0", NULL, &spi0_clk),
367 CLK(NULL, "spi1", &spi1_clk), 367 CLK("spi_davinci.1", NULL, &spi1_clk),
368 CLK(NULL, "spi2", &spi2_clk), 368 CLK("spi_davinci.2", NULL, &spi2_clk),
369 CLK(NULL, "gpio", &gpio_clk), 369 CLK(NULL, "gpio", &gpio_clk),
370 CLK(NULL, "aemif", &aemif_clk), 370 CLK(NULL, "aemif", &aemif_clk),
371 CLK(NULL, "pwm0", &pwm0_clk), 371 CLK(NULL, "pwm0", &pwm0_clk),
@@ -392,24 +392,40 @@ static struct resource dm355_spi0_resources[] = {
392 .flags = IORESOURCE_MEM, 392 .flags = IORESOURCE_MEM,
393 }, 393 },
394 { 394 {
395 .start = IRQ_DM355_SPINT0_1, 395 .start = IRQ_DM355_SPINT0_0,
396 .flags = IORESOURCE_IRQ, 396 .flags = IORESOURCE_IRQ,
397 }, 397 },
398 /* Not yet used, so not included: 398 {
399 * IORESOURCE_IRQ: 399 .start = 17,
400 * - IRQ_DM355_SPINT0_0 400 .flags = IORESOURCE_DMA,
401 * IORESOURCE_DMA: 401 },
402 * - DAVINCI_DMA_SPI_SPIX 402 {
403 * - DAVINCI_DMA_SPI_SPIR 403 .start = 16,
404 */ 404 .flags = IORESOURCE_DMA,
405 },
406 {
407 .start = EVENTQ_1,
408 .flags = IORESOURCE_DMA,
409 },
405}; 410};
406 411
412static struct davinci_spi_platform_data dm355_spi0_pdata = {
413 .version = SPI_VERSION_1,
414 .num_chipselect = 2,
415 .clk_internal = 1,
416 .cs_hold = 1,
417 .intr_level = 0,
418 .poll_mode = 1, /* 0 -> interrupt mode 1-> polling mode */
419 .c2tdelay = 0,
420 .t2cdelay = 0,
421};
407static struct platform_device dm355_spi0_device = { 422static struct platform_device dm355_spi0_device = {
408 .name = "spi_davinci", 423 .name = "spi_davinci",
409 .id = 0, 424 .id = 0,
410 .dev = { 425 .dev = {
411 .dma_mask = &dm355_spi0_dma_mask, 426 .dma_mask = &dm355_spi0_dma_mask,
412 .coherent_dma_mask = DMA_BIT_MASK(32), 427 .coherent_dma_mask = DMA_BIT_MASK(32),
428 .platform_data = &dm355_spi0_pdata,
413 }, 429 },
414 .num_resources = ARRAY_SIZE(dm355_spi0_resources), 430 .num_resources = ARRAY_SIZE(dm355_spi0_resources),
415 .resource = dm355_spi0_resources, 431 .resource = dm355_spi0_resources,
@@ -564,13 +580,6 @@ static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
564 580
565/*----------------------------------------------------------------------*/ 581/*----------------------------------------------------------------------*/
566 582
567static const s8 dma_chan_dm355_no_event[] = {
568 12, 13, 24, 56, 57,
569 58, 59, 60, 61, 62,
570 63,
571 -1
572};
573
574static const s8 583static const s8
575queue_tc_mapping[][2] = { 584queue_tc_mapping[][2] = {
576 /* {event queue no, TC no} */ 585 /* {event queue no, TC no} */
@@ -594,7 +603,6 @@ static struct edma_soc_info dm355_edma_info[] = {
594 .n_slot = 128, 603 .n_slot = 128,
595 .n_tc = 2, 604 .n_tc = 2,
596 .n_cc = 1, 605 .n_cc = 1,
597 .noevent = dma_chan_dm355_no_event,
598 .queue_tc_mapping = queue_tc_mapping, 606 .queue_tc_mapping = queue_tc_mapping,
599 .queue_priority_mapping = queue_priority_mapping, 607 .queue_priority_mapping = queue_priority_mapping,
600 }, 608 },
@@ -665,6 +673,17 @@ static struct platform_device dm355_asp1_device = {
665 .resource = dm355_asp1_resources, 673 .resource = dm355_asp1_resources,
666}; 674};
667 675
676static void dm355_ccdc_setup_pinmux(void)
677{
678 davinci_cfg_reg(DM355_VIN_PCLK);
679 davinci_cfg_reg(DM355_VIN_CAM_WEN);
680 davinci_cfg_reg(DM355_VIN_CAM_VD);
681 davinci_cfg_reg(DM355_VIN_CAM_HD);
682 davinci_cfg_reg(DM355_VIN_YIN_EN);
683 davinci_cfg_reg(DM355_VIN_CINL_EN);
684 davinci_cfg_reg(DM355_VIN_CINH_EN);
685}
686
668static struct resource dm355_vpss_resources[] = { 687static struct resource dm355_vpss_resources[] = {
669 { 688 {
670 /* VPSS BL Base address */ 689 /* VPSS BL Base address */
@@ -701,6 +720,10 @@ static struct resource vpfe_resources[] = {
701 .end = IRQ_VDINT1, 720 .end = IRQ_VDINT1,
702 .flags = IORESOURCE_IRQ, 721 .flags = IORESOURCE_IRQ,
703 }, 722 },
723};
724
725static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
726static struct resource dm355_ccdc_resource[] = {
704 /* CCDC Base address */ 727 /* CCDC Base address */
705 { 728 {
706 .flags = IORESOURCE_MEM, 729 .flags = IORESOURCE_MEM,
@@ -708,8 +731,18 @@ static struct resource vpfe_resources[] = {
708 .end = 0x01c70600 + 0x1ff, 731 .end = 0x01c70600 + 0x1ff,
709 }, 732 },
710}; 733};
734static struct platform_device dm355_ccdc_dev = {
735 .name = "dm355_ccdc",
736 .id = -1,
737 .num_resources = ARRAY_SIZE(dm355_ccdc_resource),
738 .resource = dm355_ccdc_resource,
739 .dev = {
740 .dma_mask = &vpfe_capture_dma_mask,
741 .coherent_dma_mask = DMA_BIT_MASK(32),
742 .platform_data = dm355_ccdc_setup_pinmux,
743 },
744};
711 745
712static u64 vpfe_capture_dma_mask = DMA_BIT_MASK(32);
713static struct platform_device vpfe_capture_dev = { 746static struct platform_device vpfe_capture_dev = {
714 .name = CAPTURE_DRV_NAME, 747 .name = CAPTURE_DRV_NAME,
715 .id = -1, 748 .id = -1,
@@ -857,20 +890,13 @@ static int __init dm355_init_devices(void)
857 if (!cpu_is_davinci_dm355()) 890 if (!cpu_is_davinci_dm355())
858 return 0; 891 return 0;
859 892
893 /* Add ccdc clock aliases */
894 clk_add_alias("master", dm355_ccdc_dev.name, "vpss_master", NULL);
895 clk_add_alias("slave", dm355_ccdc_dev.name, "vpss_master", NULL);
860 davinci_cfg_reg(DM355_INT_EDMA_CC); 896 davinci_cfg_reg(DM355_INT_EDMA_CC);
861 platform_device_register(&dm355_edma_device); 897 platform_device_register(&dm355_edma_device);
862 platform_device_register(&dm355_vpss_device); 898 platform_device_register(&dm355_vpss_device);
863 /* 899 platform_device_register(&dm355_ccdc_dev);
864 * setup Mux configuration for vpfe input and register
865 * vpfe capture platform device
866 */
867 davinci_cfg_reg(DM355_VIN_PCLK);
868 davinci_cfg_reg(DM355_VIN_CAM_WEN);
869 davinci_cfg_reg(DM355_VIN_CAM_VD);
870 davinci_cfg_reg(DM355_VIN_CAM_HD);
871 davinci_cfg_reg(DM355_VIN_YIN_EN);
872 davinci_cfg_reg(DM355_VIN_CINL_EN);
873 davinci_cfg_reg(DM355_VIN_CINH_EN);
874 platform_device_register(&vpfe_capture_dev); 900 platform_device_register(&vpfe_capture_dev);
875 901
876 return 0; 902 return 0;