]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Add support for USB on OMAP34XX
authorAnand Gadiyar <gadiyar@ti.com>
Mon, 17 Dec 2007 07:38:54 +0000 (13:08 +0530)
committerTony Lindgren <tony@atomide.com>
Mon, 17 Dec 2007 19:12:57 +0000 (11:12 -0800)
Added support for USB on OMAP34XX.

Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-3430sdp-usb.c [new file with mode: 0644]
arch/arm/mach-omap2/board-3430sdp.c
include/asm-arm/arch-omap/board-3430sdp.h

index d4d6d9880a6741ddfc737b7a0cc1c3f784251355..f596a86d74abe6d912377271581627b606e7fdc1 100644 (file)
@@ -26,7 +26,8 @@ obj-$(CONFIG_MACH_OMAP_2430SDP)               += board-2430sdp.o \
                                           board-2430sdp-flash.o \
                                           board-2430sdp-usb.o
 obj-$(CONFIG_MACH_OMAP_2430OSK)                += board-2430osk.o
-obj-$(CONFIG_MACH_OMAP_3430SDP)                += board-3430sdp.o
+obj-$(CONFIG_MACH_OMAP_3430SDP)                += board-3430sdp.o \
+                                          board-3430sdp-usb.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)                += board-apollon.o \
                                           board-apollon-mmc.o  \
                                           board-apollon-keys.o
diff --git a/arch/arm/mach-omap2/board-3430sdp-usb.c b/arch/arm/mach-omap2/board-3430sdp-usb.c
new file mode 100644 (file)
index 0000000..dd8f7fa
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * linux/arch/arm/mach-omap2/board-3430sdp-usb.c
+ *
+ * This file will contain the board specific details for the
+ * MENTOR USB OTG and Synopsys EHCI host controllers on OMAP3430
+ *
+ * Copyright (C) 2007 Texas Instruments
+ * Author: Vikram Pandita
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/delay.h>
+#include <linux/platform_device.h>
+#include <linux/usb/musb.h>
+
+#include <asm/arch/hardware.h>
+#include <asm/arch/usb.h>
+
+#ifdef CONFIG_USB_MUSB_SOC
+static struct resource musb_resources[] = {
+       [0] = {
+               .start  = OMAP34XX_HSUSB_OTG_BASE,
+               .end    = OMAP34XX_HSUSB_OTG_BASE + SZ_8K,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = { /* general IRQ */
+               .start  = INT_243X_HS_USB_MC,
+               .flags  = IORESOURCE_IRQ,
+       },
+       [2] = { /* DMA IRQ */
+               .start  = INT_243X_HS_USB_DMA,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct musb_hdrc_platform_data musb_plat = {
+#ifdef CONFIG_USB_MUSB_OTG
+       .mode           = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+       .mode           = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+       .mode           = MUSB_PERIPHERAL,
+#endif
+       .multipoint     = 1,
+       .clock          = NULL,
+       .set_clock      = NULL,
+};
+
+static u64 musb_dmamask = ~(u32)0;
+
+static struct platform_device musb_device = {
+       .name           = "musb_hdrc",
+       .id             = 0,
+       .dev = {
+               .dma_mask               = &musb_dmamask,
+               .coherent_dma_mask      = 0xffffffff,
+               .platform_data          = &musb_plat,
+       },
+       .num_resources  = ARRAY_SIZE(musb_resources),
+       .resource       = musb_resources,
+};
+#endif
+
+void __init sdp3430_usb_init(void)
+{
+#ifdef CONFIG_USB_MUSB_SOC
+       if (platform_device_register(&musb_device) < 0) {
+               printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
+               return;
+       }
+#endif
+}
index ba410bfe13772eca6b722580c12d53bcce2d7279..0c55858e57d37b6c8266d62647841ec7219fbdfc 100644 (file)
@@ -329,6 +329,7 @@ static void __init omap_3430sdp_init(void)
                                ARRAY_SIZE(sdp3430_spi_board_info));
        ads7846_dev_init();
        omap_serial_init();
+       sdp3430_usb_init();
 }
 
 static void __init omap_3430sdp_map_io(void)
index 4a0247da9a826fe7d7339388d67d4d308e1118b3..369d0025fb29d3c1bf7108859a6035d382f86c5c 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef __ASM_ARCH_OMAP_3430SDP_H
 #define __ASM_ARCH_OMAP_3430SDP_H
 
+extern void sdp3430_usb_init(void);
+
 #define DEBUG_BASE                     0x08000000  /* debug board */
 
 /* Placeholder for 3430SDP specific defines */