diff options
author | Andrew Lunn <andrew@lunn.ch> | 2011-05-15 07:32:49 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2011-05-16 15:11:33 -0400 |
commit | 4fcd3f374a928081d391cd9a570afe3b2c692fdc (patch) | |
tree | 04359735b7e279174e8d183c9d87906472fc0987 /arch/arm/plat-orion | |
parent | ee9627234dae8d1b8059b2ac39c961ee0932b803 (diff) |
ARM: orion: Consolidate USB platform setup code.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Diffstat (limited to 'arch/arm/plat-orion')
-rw-r--r-- | arch/arm/plat-orion/common.c | 89 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/common.h | 12 |
2 files changed, 101 insertions, 0 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 0a2face7109e..802cbf4b2f3c 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/spi/orion_spi.h> | 20 | #include <linux/spi/orion_spi.h> |
21 | #include <plat/orion_wdt.h> | 21 | #include <plat/orion_wdt.h> |
22 | #include <plat/mv_xor.h> | 22 | #include <plat/mv_xor.h> |
23 | #include <plat/ehci-orion.h> | ||
23 | 24 | ||
24 | /* Fill in the resources structure and link it into the platform | 25 | /* Fill in the resources structure and link it into the platform |
25 | device structure. There is always a memory region, and nearly | 26 | device structure. There is always a memory region, and nearly |
@@ -800,3 +801,91 @@ void __init orion_xor1_init(unsigned long mapbase_low, | |||
800 | orion_xor_init_channels(&orion_xor10_data, &orion_xor10_channel, | 801 | orion_xor_init_channels(&orion_xor10_data, &orion_xor10_channel, |
801 | &orion_xor11_data, &orion_xor11_channel); | 802 | &orion_xor11_data, &orion_xor11_channel); |
802 | } | 803 | } |
804 | |||
805 | /***************************************************************************** | ||
806 | * EHCI | ||
807 | ****************************************************************************/ | ||
808 | static struct orion_ehci_data orion_ehci_data = { | ||
809 | .phy_version = EHCI_PHY_NA, | ||
810 | }; | ||
811 | |||
812 | static u64 ehci_dmamask = DMA_BIT_MASK(32); | ||
813 | |||
814 | |||
815 | /***************************************************************************** | ||
816 | * EHCI0 | ||
817 | ****************************************************************************/ | ||
818 | static struct resource orion_ehci_resources[2]; | ||
819 | |||
820 | static struct platform_device orion_ehci = { | ||
821 | .name = "orion-ehci", | ||
822 | .id = 0, | ||
823 | .dev = { | ||
824 | .dma_mask = &ehci_dmamask, | ||
825 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
826 | .platform_data = &orion_ehci_data, | ||
827 | }, | ||
828 | }; | ||
829 | |||
830 | void __init orion_ehci_init(struct mbus_dram_target_info *mbus_dram_info, | ||
831 | unsigned long mapbase, | ||
832 | unsigned long irq) | ||
833 | { | ||
834 | orion_ehci_data.dram = mbus_dram_info; | ||
835 | fill_resources(&orion_ehci, orion_ehci_resources, mapbase, SZ_4K - 1, | ||
836 | irq); | ||
837 | |||
838 | platform_device_register(&orion_ehci); | ||
839 | } | ||
840 | |||
841 | /***************************************************************************** | ||
842 | * EHCI1 | ||
843 | ****************************************************************************/ | ||
844 | static struct resource orion_ehci_1_resources[2]; | ||
845 | |||
846 | static struct platform_device orion_ehci_1 = { | ||
847 | .name = "orion-ehci", | ||
848 | .id = 1, | ||
849 | .dev = { | ||
850 | .dma_mask = &ehci_dmamask, | ||
851 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
852 | .platform_data = &orion_ehci_data, | ||
853 | }, | ||
854 | }; | ||
855 | |||
856 | void __init orion_ehci_1_init(struct mbus_dram_target_info *mbus_dram_info, | ||
857 | unsigned long mapbase, | ||
858 | unsigned long irq) | ||
859 | { | ||
860 | orion_ehci_data.dram = mbus_dram_info; | ||
861 | fill_resources(&orion_ehci_1, orion_ehci_1_resources, | ||
862 | mapbase, SZ_4K - 1, irq); | ||
863 | |||
864 | platform_device_register(&orion_ehci_1); | ||
865 | } | ||
866 | |||
867 | /***************************************************************************** | ||
868 | * EHCI2 | ||
869 | ****************************************************************************/ | ||
870 | static struct resource orion_ehci_2_resources[2]; | ||
871 | |||
872 | static struct platform_device orion_ehci_2 = { | ||
873 | .name = "orion-ehci", | ||
874 | .id = 2, | ||
875 | .dev = { | ||
876 | .dma_mask = &ehci_dmamask, | ||
877 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
878 | .platform_data = &orion_ehci_data, | ||
879 | }, | ||
880 | }; | ||
881 | |||
882 | void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info, | ||
883 | unsigned long mapbase, | ||
884 | unsigned long irq) | ||
885 | { | ||
886 | orion_ehci_data.dram = mbus_dram_info; | ||
887 | fill_resources(&orion_ehci_2, orion_ehci_2_resources, | ||
888 | mapbase, SZ_4K - 1, irq); | ||
889 | |||
890 | platform_device_register(&orion_ehci_2); | ||
891 | } | ||
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index 0e11ca5acd02..6386f8e5df25 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h | |||
@@ -92,4 +92,16 @@ void __init orion_xor1_init(unsigned long mapbase_low, | |||
92 | unsigned long mapbase_high, | 92 | unsigned long mapbase_high, |
93 | unsigned long irq_0, | 93 | unsigned long irq_0, |
94 | unsigned long irq_1); | 94 | unsigned long irq_1); |
95 | |||
96 | void __init orion_ehci_init(struct mbus_dram_target_info *mbus_dram_info, | ||
97 | unsigned long mapbase, | ||
98 | unsigned long irq); | ||
99 | |||
100 | void __init orion_ehci_1_init(struct mbus_dram_target_info *mbus_dram_info, | ||
101 | unsigned long mapbase, | ||
102 | unsigned long irq); | ||
103 | |||
104 | void __init orion_ehci_2_init(struct mbus_dram_target_info *mbus_dram_info, | ||
105 | unsigned long mapbase, | ||
106 | unsigned long irq); | ||
95 | #endif | 107 | #endif |