diff options
Diffstat (limited to 'arch/arm/mach-davinci/dm644x.c')
-rw-r--r-- | arch/arm/mach-davinci/dm644x.c | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index 43a48ee1917..23e81cafba8 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
17 | 17 | ||
18 | #include <mach/dm644x.h> | ||
19 | #include <mach/cputype.h> | 18 | #include <mach/cputype.h> |
20 | #include <mach/edma.h> | 19 | #include <mach/edma.h> |
21 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
@@ -27,6 +26,7 @@ | |||
27 | #include <mach/asp.h> | 26 | #include <mach/asp.h> |
28 | #include <mach/gpio-davinci.h> | 27 | #include <mach/gpio-davinci.h> |
29 | 28 | ||
29 | #include "davinci.h" | ||
30 | #include "clock.h" | 30 | #include "clock.h" |
31 | #include "mux.h" | 31 | #include "mux.h" |
32 | 32 | ||
@@ -35,6 +35,13 @@ | |||
35 | */ | 35 | */ |
36 | #define DM644X_REF_FREQ 27000000 | 36 | #define DM644X_REF_FREQ 27000000 |
37 | 37 | ||
38 | #define DM644X_EMAC_BASE 0x01c80000 | ||
39 | #define DM644X_EMAC_MDIO_BASE (DM644X_EMAC_BASE + 0x4000) | ||
40 | #define DM644X_EMAC_CNTRL_OFFSET 0x0000 | ||
41 | #define DM644X_EMAC_CNTRL_MOD_OFFSET 0x1000 | ||
42 | #define DM644X_EMAC_CNTRL_RAM_OFFSET 0x2000 | ||
43 | #define DM644X_EMAC_CNTRL_RAM_SIZE 0x2000 | ||
44 | |||
38 | static struct pll_data pll1_data = { | 45 | static struct pll_data pll1_data = { |
39 | .num = 1, | 46 | .num = 1, |
40 | .phys_base = DAVINCI_PLL1_BASE, | 47 | .phys_base = DAVINCI_PLL1_BASE, |
@@ -587,13 +594,15 @@ static struct platform_device dm644x_asp_device = { | |||
587 | .resource = dm644x_asp_resources, | 594 | .resource = dm644x_asp_resources, |
588 | }; | 595 | }; |
589 | 596 | ||
597 | #define DM644X_VPSS_BASE 0x01c73400 | ||
598 | |||
590 | static struct resource dm644x_vpss_resources[] = { | 599 | static struct resource dm644x_vpss_resources[] = { |
591 | { | 600 | { |
592 | /* VPSS Base address */ | 601 | /* VPSS Base address */ |
593 | .name = "vpss", | 602 | .name = "vpss", |
594 | .start = 0x01c73400, | 603 | .start = DM644X_VPSS_BASE, |
595 | .end = 0x01c73400 + 0xff, | 604 | .end = DM644X_VPSS_BASE + 0xff, |
596 | .flags = IORESOURCE_MEM, | 605 | .flags = IORESOURCE_MEM, |
597 | }, | 606 | }, |
598 | }; | 607 | }; |
599 | 608 | ||
@@ -605,7 +614,7 @@ static struct platform_device dm644x_vpss_device = { | |||
605 | .resource = dm644x_vpss_resources, | 614 | .resource = dm644x_vpss_resources, |
606 | }; | 615 | }; |
607 | 616 | ||
608 | static struct resource vpfe_resources[] = { | 617 | static struct resource dm644x_vpfe_resources[] = { |
609 | { | 618 | { |
610 | .start = IRQ_VDINT0, | 619 | .start = IRQ_VDINT0, |
611 | .end = IRQ_VDINT0, | 620 | .end = IRQ_VDINT0, |
@@ -639,22 +648,17 @@ static struct platform_device dm644x_ccdc_dev = { | |||
639 | }, | 648 | }, |
640 | }; | 649 | }; |
641 | 650 | ||
642 | static struct platform_device vpfe_capture_dev = { | 651 | static struct platform_device dm644x_vpfe_dev = { |
643 | .name = CAPTURE_DRV_NAME, | 652 | .name = CAPTURE_DRV_NAME, |
644 | .id = -1, | 653 | .id = -1, |
645 | .num_resources = ARRAY_SIZE(vpfe_resources), | 654 | .num_resources = ARRAY_SIZE(dm644x_vpfe_resources), |
646 | .resource = vpfe_resources, | 655 | .resource = dm644x_vpfe_resources, |
647 | .dev = { | 656 | .dev = { |
648 | .dma_mask = &vpfe_capture_dma_mask, | 657 | .dma_mask = &vpfe_capture_dma_mask, |
649 | .coherent_dma_mask = DMA_BIT_MASK(32), | 658 | .coherent_dma_mask = DMA_BIT_MASK(32), |
650 | }, | 659 | }, |
651 | }; | 660 | }; |
652 | 661 | ||
653 | void dm644x_set_vpfe_config(struct vpfe_config *cfg) | ||
654 | { | ||
655 | vpfe_capture_dev.dev.platform_data = cfg; | ||
656 | } | ||
657 | |||
658 | /*----------------------------------------------------------------------*/ | 662 | /*----------------------------------------------------------------------*/ |
659 | 663 | ||
660 | static struct map_desc dm644x_io_desc[] = { | 664 | static struct map_desc dm644x_io_desc[] = { |
@@ -779,16 +783,29 @@ void __init dm644x_init_asp(struct snd_platform_data *pdata) | |||
779 | void __init dm644x_init(void) | 783 | void __init dm644x_init(void) |
780 | { | 784 | { |
781 | davinci_common_init(&davinci_soc_info_dm644x); | 785 | davinci_common_init(&davinci_soc_info_dm644x); |
786 | davinci_map_sysmod(); | ||
782 | } | 787 | } |
783 | 788 | ||
784 | static int __init dm644x_init_devices(void) | 789 | int __init dm644x_init_video(struct vpfe_config *vpfe_cfg) |
785 | { | 790 | { |
786 | if (!cpu_is_davinci_dm644x()) | 791 | dm644x_vpfe_dev.dev.platform_data = vpfe_cfg; |
787 | return 0; | ||
788 | 792 | ||
789 | /* Add ccdc clock aliases */ | 793 | /* Add ccdc clock aliases */ |
790 | clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL); | 794 | clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL); |
791 | clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL); | 795 | clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL); |
796 | |||
797 | platform_device_register(&dm644x_vpss_device); | ||
798 | platform_device_register(&dm644x_ccdc_dev); | ||
799 | platform_device_register(&dm644x_vpfe_dev); | ||
800 | |||
801 | return 0; | ||
802 | } | ||
803 | |||
804 | static int __init dm644x_init_devices(void) | ||
805 | { | ||
806 | if (!cpu_is_davinci_dm644x()) | ||
807 | return 0; | ||
808 | |||
792 | platform_device_register(&dm644x_edma_device); | 809 | platform_device_register(&dm644x_edma_device); |
793 | 810 | ||
794 | platform_device_register(&dm644x_mdio_device); | 811 | platform_device_register(&dm644x_mdio_device); |
@@ -796,10 +813,6 @@ static int __init dm644x_init_devices(void) | |||
796 | clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev), | 813 | clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev), |
797 | NULL, &dm644x_emac_device.dev); | 814 | NULL, &dm644x_emac_device.dev); |
798 | 815 | ||
799 | platform_device_register(&dm644x_vpss_device); | ||
800 | platform_device_register(&dm644x_ccdc_dev); | ||
801 | platform_device_register(&vpfe_capture_dev); | ||
802 | |||
803 | return 0; | 816 | return 0; |
804 | } | 817 | } |
805 | postcore_initcall(dm644x_init_devices); | 818 | postcore_initcall(dm644x_init_devices); |