aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-orion/common.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2011-05-15 07:32:49 -0400
committerNicolas Pitre <nico@fluxnic.net>2011-05-16 15:11:33 -0400
commit4fcd3f374a928081d391cd9a570afe3b2c692fdc (patch)
tree04359735b7e279174e8d183c9d87906472fc0987 /arch/arm/plat-orion/common.c
parentee9627234dae8d1b8059b2ac39c961ee0932b803 (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/common.c')
-rw-r--r--arch/arm/plat-orion/common.c89
1 files changed, 89 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 ****************************************************************************/
808static struct orion_ehci_data orion_ehci_data = {
809 .phy_version = EHCI_PHY_NA,
810};
811
812static u64 ehci_dmamask = DMA_BIT_MASK(32);
813
814
815/*****************************************************************************
816 * EHCI0
817 ****************************************************************************/
818static struct resource orion_ehci_resources[2];
819
820static 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
830void __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 ****************************************************************************/
844static struct resource orion_ehci_1_resources[2];
845
846static 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
856void __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 ****************************************************************************/
870static struct resource orion_ehci_2_resources[2];
871
872static 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
882void __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}