aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-davinci/include/mach/da8xx.h2
-rw-r--r--arch/arm/mach-davinci/include/mach/usb.h20
-rw-r--r--arch/arm/mach-davinci/usb.c37
3 files changed, 58 insertions, 1 deletions
diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h
index abb8a5b2c692..3b7527324bf4 100644
--- a/arch/arm/mach-davinci/include/mach/da8xx.h
+++ b/arch/arm/mach-davinci/include/mach/da8xx.h
@@ -19,6 +19,7 @@
19#include <mach/emac.h> 19#include <mach/emac.h>
20#include <mach/asp.h> 20#include <mach/asp.h>
21#include <mach/mmc.h> 21#include <mach/mmc.h>
22#include <mach/usb.h>
22 23
23extern void __iomem *da8xx_syscfg_base; 24extern void __iomem *da8xx_syscfg_base;
24 25
@@ -78,6 +79,7 @@ void __init da850_init(void);
78int da8xx_register_edma(void); 79int da8xx_register_edma(void);
79int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata); 80int da8xx_register_i2c(int instance, struct davinci_i2c_platform_data *pdata);
80int da8xx_register_watchdog(void); 81int da8xx_register_watchdog(void);
82int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
81int da8xx_register_emac(void); 83int da8xx_register_emac(void);
82int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata); 84int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
83int da8xx_register_mmcsd0(struct davinci_mmc_config *config); 85int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
diff --git a/arch/arm/mach-davinci/include/mach/usb.h b/arch/arm/mach-davinci/include/mach/usb.h
index d0fb412a9edd..435f2284238a 100644
--- a/arch/arm/mach-davinci/include/mach/usb.h
+++ b/arch/arm/mach-davinci/include/mach/usb.h
@@ -34,4 +34,24 @@
34#define CFGCHIP2_REFFREQ_24MHZ (2 << 0) 34#define CFGCHIP2_REFFREQ_24MHZ (2 << 0)
35#define CFGCHIP2_REFFREQ_48MHZ (3 << 0) 35#define CFGCHIP2_REFFREQ_48MHZ (3 << 0)
36 36
37struct da8xx_ohci_root_hub;
38
39typedef void (*da8xx_ocic_handler_t)(struct da8xx_ohci_root_hub *hub,
40 unsigned port);
41
42/* Passed as the platform data to the OHCI driver */
43struct da8xx_ohci_root_hub {
44 /* Switch the port power on/off */
45 int (*set_power)(unsigned port, int on);
46 /* Read the port power status */
47 int (*get_power)(unsigned port);
48 /* Read the port over-current indicator */
49 int (*get_oci)(unsigned port);
50 /* Over-current indicator change notification (pass NULL to disable) */
51 int (*ocic_notify)(da8xx_ocic_handler_t handler);
52
53 /* Time from power on to power good (in 2 ms units) */
54 u8 potpgt;
55};
56
37#endif /* ifndef __ASM_ARCH_USB_H */ 57#endif /* ifndef __ASM_ARCH_USB_H */
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
index 06f55931620c..2fff9a6295b9 100644
--- a/arch/arm/mach-davinci/usb.c
+++ b/arch/arm/mach-davinci/usb.c
@@ -14,8 +14,10 @@
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include <mach/irqs.h> 15#include <mach/irqs.h>
16#include <mach/cputype.h> 16#include <mach/cputype.h>
17#include <mach/usb.h>
17 18
18#define DAVINCI_USB_OTG_BASE 0x01C64000 19#define DAVINCI_USB_OTG_BASE 0x01c64000
20#define DA8XX_USB1_BASE 0x01e25000
19 21
20#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 22#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
21static struct musb_hdrc_eps_bits musb_eps[] = { 23static struct musb_hdrc_eps_bits musb_eps[] = {
@@ -108,3 +110,36 @@ void __init setup_usb(unsigned mA, unsigned potpgt_msec)
108 110
109#endif /* CONFIG_USB_MUSB_HDRC */ 111#endif /* CONFIG_USB_MUSB_HDRC */
110 112
113#ifdef CONFIG_ARCH_DAVINCI_DA8XX
114static struct resource da8xx_usb11_resources[] = {
115 [0] = {
116 .start = DA8XX_USB1_BASE,
117 .end = DA8XX_USB1_BASE + SZ_4K - 1,
118 .flags = IORESOURCE_MEM,
119 },
120 [1] = {
121 .start = IRQ_DA8XX_IRQN,
122 .end = IRQ_DA8XX_IRQN,
123 .flags = IORESOURCE_IRQ,
124 },
125};
126
127static u64 da8xx_usb11_dma_mask = DMA_BIT_MASK(32);
128
129static struct platform_device da8xx_usb11_device = {
130 .name = "ohci",
131 .id = 0,
132 .dev = {
133 .dma_mask = &da8xx_usb11_dma_mask,
134 .coherent_dma_mask = DMA_BIT_MASK(32),
135 },
136 .num_resources = ARRAY_SIZE(da8xx_usb11_resources),
137 .resource = da8xx_usb11_resources,
138};
139
140int __init da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata)
141{
142 da8xx_usb11_device.dev.platform_data = pdata;
143 return platform_device_register(&da8xx_usb11_device);
144}
145#endif /* CONFIG_DAVINCI_DA8XX */