diff options
Diffstat (limited to 'arch/arm/mach-davinci/dm646x.c')
-rw-r--r-- | arch/arm/mach-davinci/dm646x.c | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 8fa28039f27e..0976049c7b3b 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -32,6 +32,15 @@ | |||
32 | #include "clock.h" | 32 | #include "clock.h" |
33 | #include "mux.h" | 33 | #include "mux.h" |
34 | 34 | ||
35 | #define DAVINCI_VPIF_BASE (0x01C12000) | ||
36 | #define VDD3P3V_PWDN_OFFSET (0x48) | ||
37 | #define VSCLKDIS_OFFSET (0x6C) | ||
38 | |||
39 | #define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\ | ||
40 | BIT_MASK(0)) | ||
41 | #define VSCLKDIS_MASK (BIT_MASK(11) | BIT_MASK(10) | BIT_MASK(9) |\ | ||
42 | BIT_MASK(8)) | ||
43 | |||
35 | /* | 44 | /* |
36 | * Device specific clocks | 45 | * Device specific clocks |
37 | */ | 46 | */ |
@@ -686,6 +695,75 @@ static struct platform_device dm646x_dit_device = { | |||
686 | .id = -1, | 695 | .id = -1, |
687 | }; | 696 | }; |
688 | 697 | ||
698 | static u64 vpif_dma_mask = DMA_BIT_MASK(32); | ||
699 | |||
700 | static struct resource vpif_resource[] = { | ||
701 | { | ||
702 | .start = DAVINCI_VPIF_BASE, | ||
703 | .end = DAVINCI_VPIF_BASE + 0x03ff, | ||
704 | .flags = IORESOURCE_MEM, | ||
705 | } | ||
706 | }; | ||
707 | |||
708 | static struct platform_device vpif_dev = { | ||
709 | .name = "vpif", | ||
710 | .id = -1, | ||
711 | .dev = { | ||
712 | .dma_mask = &vpif_dma_mask, | ||
713 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
714 | }, | ||
715 | .resource = vpif_resource, | ||
716 | .num_resources = ARRAY_SIZE(vpif_resource), | ||
717 | }; | ||
718 | |||
719 | static struct resource vpif_display_resource[] = { | ||
720 | { | ||
721 | .start = IRQ_DM646X_VP_VERTINT2, | ||
722 | .end = IRQ_DM646X_VP_VERTINT2, | ||
723 | .flags = IORESOURCE_IRQ, | ||
724 | }, | ||
725 | { | ||
726 | .start = IRQ_DM646X_VP_VERTINT3, | ||
727 | .end = IRQ_DM646X_VP_VERTINT3, | ||
728 | .flags = IORESOURCE_IRQ, | ||
729 | }, | ||
730 | }; | ||
731 | |||
732 | static struct platform_device vpif_display_dev = { | ||
733 | .name = "vpif_display", | ||
734 | .id = -1, | ||
735 | .dev = { | ||
736 | .dma_mask = &vpif_dma_mask, | ||
737 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
738 | }, | ||
739 | .resource = vpif_display_resource, | ||
740 | .num_resources = ARRAY_SIZE(vpif_display_resource), | ||
741 | }; | ||
742 | |||
743 | static struct resource vpif_capture_resource[] = { | ||
744 | { | ||
745 | .start = IRQ_DM646X_VP_VERTINT0, | ||
746 | .end = IRQ_DM646X_VP_VERTINT0, | ||
747 | .flags = IORESOURCE_IRQ, | ||
748 | }, | ||
749 | { | ||
750 | .start = IRQ_DM646X_VP_VERTINT1, | ||
751 | .end = IRQ_DM646X_VP_VERTINT1, | ||
752 | .flags = IORESOURCE_IRQ, | ||
753 | }, | ||
754 | }; | ||
755 | |||
756 | static struct platform_device vpif_capture_dev = { | ||
757 | .name = "vpif_capture", | ||
758 | .id = -1, | ||
759 | .dev = { | ||
760 | .dma_mask = &vpif_dma_mask, | ||
761 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
762 | }, | ||
763 | .resource = vpif_capture_resource, | ||
764 | .num_resources = ARRAY_SIZE(vpif_capture_resource), | ||
765 | }; | ||
766 | |||
689 | /*----------------------------------------------------------------------*/ | 767 | /*----------------------------------------------------------------------*/ |
690 | 768 | ||
691 | static struct map_desc dm646x_io_desc[] = { | 769 | static struct map_desc dm646x_io_desc[] = { |
@@ -814,6 +892,32 @@ void __init dm646x_init_mcasp1(struct snd_platform_data *pdata) | |||
814 | platform_device_register(&dm646x_dit_device); | 892 | platform_device_register(&dm646x_dit_device); |
815 | } | 893 | } |
816 | 894 | ||
895 | void dm646x_setup_vpif(struct vpif_display_config *display_config, | ||
896 | struct vpif_capture_config *capture_config) | ||
897 | { | ||
898 | unsigned int value; | ||
899 | void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE); | ||
900 | |||
901 | value = __raw_readl(base + VSCLKDIS_OFFSET); | ||
902 | value &= ~VSCLKDIS_MASK; | ||
903 | __raw_writel(value, base + VSCLKDIS_OFFSET); | ||
904 | |||
905 | value = __raw_readl(base + VDD3P3V_PWDN_OFFSET); | ||
906 | value &= ~VDD3P3V_VID_MASK; | ||
907 | __raw_writel(value, base + VDD3P3V_PWDN_OFFSET); | ||
908 | |||
909 | davinci_cfg_reg(DM646X_STSOMUX_DISABLE); | ||
910 | davinci_cfg_reg(DM646X_STSIMUX_DISABLE); | ||
911 | davinci_cfg_reg(DM646X_PTSOMUX_DISABLE); | ||
912 | davinci_cfg_reg(DM646X_PTSIMUX_DISABLE); | ||
913 | |||
914 | vpif_display_dev.dev.platform_data = display_config; | ||
915 | vpif_capture_dev.dev.platform_data = capture_config; | ||
916 | platform_device_register(&vpif_dev); | ||
917 | platform_device_register(&vpif_display_dev); | ||
918 | platform_device_register(&vpif_capture_dev); | ||
919 | } | ||
920 | |||
817 | void __init dm646x_init(void) | 921 | void __init dm646x_init(void) |
818 | { | 922 | { |
819 | davinci_common_init(&davinci_soc_info_dm646x); | 923 | davinci_common_init(&davinci_soc_info_dm646x); |