]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-omap2/board-3430sdp-usb.c
dd8f7facd343b2fdd9ee329ec8096abf2df1693e
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / board-3430sdp-usb.c
1 /*
2  * linux/arch/arm/mach-omap2/board-3430sdp-usb.c
3  *
4  * This file will contain the board specific details for the
5  * MENTOR USB OTG and Synopsys EHCI host controllers on OMAP3430
6  *
7  * Copyright (C) 2007 Texas Instruments
8  * Author: Vikram Pandita
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  */
14
15 #include <linux/types.h>
16 #include <linux/errno.h>
17 #include <linux/delay.h>
18 #include <linux/platform_device.h>
19 #include <linux/usb/musb.h>
20
21 #include <asm/arch/hardware.h>
22 #include <asm/arch/usb.h>
23
24 #ifdef CONFIG_USB_MUSB_SOC
25 static struct resource musb_resources[] = {
26         [0] = {
27                 .start  = OMAP34XX_HSUSB_OTG_BASE,
28                 .end    = OMAP34XX_HSUSB_OTG_BASE + SZ_8K,
29                 .flags  = IORESOURCE_MEM,
30         },
31         [1] = { /* general IRQ */
32                 .start  = INT_243X_HS_USB_MC,
33                 .flags  = IORESOURCE_IRQ,
34         },
35         [2] = { /* DMA IRQ */
36                 .start  = INT_243X_HS_USB_DMA,
37                 .flags  = IORESOURCE_IRQ,
38         },
39 };
40
41 static struct musb_hdrc_platform_data musb_plat = {
42 #ifdef CONFIG_USB_MUSB_OTG
43         .mode           = MUSB_OTG,
44 #elif defined(CONFIG_USB_MUSB_HDRC_HCD)
45         .mode           = MUSB_HOST,
46 #elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
47         .mode           = MUSB_PERIPHERAL,
48 #endif
49         .multipoint     = 1,
50         .clock          = NULL,
51         .set_clock      = NULL,
52 };
53
54 static u64 musb_dmamask = ~(u32)0;
55
56 static struct platform_device musb_device = {
57         .name           = "musb_hdrc",
58         .id             = 0,
59         .dev = {
60                 .dma_mask               = &musb_dmamask,
61                 .coherent_dma_mask      = 0xffffffff,
62                 .platform_data          = &musb_plat,
63         },
64         .num_resources  = ARRAY_SIZE(musb_resources),
65         .resource       = musb_resources,
66 };
67 #endif
68
69 void __init sdp3430_usb_init(void)
70 {
71 #ifdef CONFIG_USB_MUSB_SOC
72         if (platform_device_register(&musb_device) < 0) {
73                 printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
74                 return;
75         }
76 #endif
77 }