2 * linux/arch/arm/mach-omap2/usb-musb.c
4 * This file will contain the board specific details for the
5 * MENTOR USB OTG controller on OMAP3430
7 * Copyright (C) 2007-2008 Texas Instruments
8 * Copyright (C) 2008 Nokia Corporation
9 * Author: Vikram Pandita
12 * Felipe Balbi <felipe.balbi@nokia.com>
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
19 #include <linux/types.h>
20 #include <linux/errno.h>
21 #include <linux/delay.h>
22 #include <linux/platform_device.h>
23 #include <linux/clk.h>
24 #include <linux/dma-mapping.h>
27 #include <linux/usb/musb.h>
29 #include <mach/hardware.h>
30 #include <mach/irqs.h>
34 static struct resource musb_resources
[] = {
35 [0] = { /* start and end set dynamically */
36 .flags
= IORESOURCE_MEM
,
38 [1] = { /* general IRQ */
39 .start
= INT_243X_HS_USB_MC
,
40 .flags
= IORESOURCE_IRQ
,
43 .start
= INT_243X_HS_USB_DMA
,
44 .flags
= IORESOURCE_IRQ
,
50 static int musb_set_clock(struct clk
*clk
, int state
)
69 static struct musb_hdrc_eps_bits musb_eps
[] = {
102 static struct musb_hdrc_config musb_config
= {
109 .dma_req_chan
= (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
111 .eps_bits
= musb_eps
,
114 static struct musb_hdrc_platform_data musb_plat
= {
115 #ifdef CONFIG_USB_MUSB_OTG
117 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
119 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
120 .mode
= MUSB_PERIPHERAL
,
122 /* .clock is set dynamically */
123 .set_clock
= musb_set_clock
,
124 .config
= &musb_config
,
126 /* REVISIT charge pump on TWL4030 can supply up to
127 * 100 mA ... but this value is board-specific, like
128 * "mode", and should be passed to usb_musb_init().
130 .power
= 50, /* up to 100 mA */
133 static u64 musb_dmamask
= DMA_BIT_MASK(32);
135 static struct platform_device musb_device
= {
139 .dma_mask
= &musb_dmamask
,
140 .coherent_dma_mask
= DMA_BIT_MASK(32),
141 .platform_data
= &musb_plat
,
143 .num_resources
= ARRAY_SIZE(musb_resources
),
144 .resource
= musb_resources
,
147 #ifdef CONFIG_NOP_USB_XCEIV
148 static u64 nop_xceiv_dmamask
= DMA_BIT_MASK(32);
150 static struct platform_device nop_xceiv_device
= {
151 .name
= "nop_usb_xceiv",
154 .dma_mask
= &nop_xceiv_dmamask
,
155 .coherent_dma_mask
= DMA_BIT_MASK(32),
156 .platform_data
= NULL
,
161 void __init
usb_musb_init(void)
163 if (cpu_is_omap243x())
164 musb_resources
[0].start
= OMAP243X_HS_BASE
;
166 musb_resources
[0].start
= OMAP34XX_HSUSB_OTG_BASE
;
167 musb_resources
[0].end
= musb_resources
[0].start
+ SZ_8K
- 1;
170 * REVISIT: This line can be removed once all the platforms using
171 * musb_core.c have been converted to use use clkdev.
173 musb_plat
.clock
= "ick";
175 #ifdef CONFIG_NOP_USB_XCEIV
176 if (platform_device_register(&nop_xceiv_device
) < 0) {
177 printk(KERN_ERR
"Unable to register NOP-XCEIV device\n");
182 if (platform_device_register(&musb_device
) < 0) {
183 printk(KERN_ERR
"Unable to register HS-USB (MUSB) device\n");