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>
28 #include <linux/usb/musb.h>
30 #include <mach/hardware.h>
35 #ifdef CONFIG_USB_MUSB_SOC
36 static struct resource musb_resources[] = {
38 .start = cpu_is_omap34xx()
39 ? OMAP34XX_HSUSB_OTG_BASE
41 .end = cpu_is_omap34xx()
42 ? OMAP34XX_HSUSB_OTG_BASE + SZ_8K - 1
43 : OMAP243X_HS_BASE + SZ_8K - 1,
44 .flags = IORESOURCE_MEM,
46 [1] = { /* general IRQ */
47 .start = INT_243X_HS_USB_MC,
48 .flags = IORESOURCE_IRQ,
51 .start = INT_243X_HS_USB_DMA,
52 .flags = IORESOURCE_IRQ,
58 static int musb_set_clock(struct clk *clk, int state)
77 static struct musb_hdrc_eps_bits musb_eps[] = {
110 static struct musb_hdrc_config musb_config = {
117 .dma_req_chan = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3),
119 .eps_bits = musb_eps,
122 static struct musb_hdrc_platform_data musb_plat = {
123 #ifdef CONFIG_USB_MUSB_OTG
125 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
127 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
128 .mode = MUSB_PERIPHERAL,
130 .clock = cpu_is_omap34xx()
133 .set_clock = musb_set_clock,
134 .config = &musb_config,
136 /* REVISIT charge pump on TWL4030 can supply up to
137 * 100 mA ... but this value is board-specific, like
138 * "mode", and should be passed to usb_musb_init().
140 .power = 50, /* up to 100 mA */
143 static u64 musb_dmamask = DMA_32BIT_MASK;
145 static struct platform_device musb_device = {
149 .dma_mask = &musb_dmamask,
150 .coherent_dma_mask = DMA_32BIT_MASK,
151 .platform_data = &musb_plat,
153 .num_resources = ARRAY_SIZE(musb_resources),
154 .resource = musb_resources,
159 void __init usb_musb_init(void)
161 #ifdef CONFIG_USB_MUSB_SOC
162 if (platform_device_register(&musb_device) < 0) {
163 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");