@@ -260,6 +260,9 @@ obj-$(CONFIG_MACH_TI8168EVM) += board-ti8168evm.o
usbfs-$(CONFIG_ARCH_OMAP_OTG) := usb-fs.o
obj-y += $(usbfs-m) $(usbfs-y)
obj-y += usb-musb.o
+ifneq ($(CONFIG_USB_DWC3),)
+obj-y += usb-dwc3.o
+endif
obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o
obj-y += usb-host.o
new file mode 100644
@@ -0,0 +1,49 @@
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+
+#include <plat/usb.h>
+#include <plat/omap_device.h>
+
+static u64 dwc3_dmamask = DMA_BIT_MASK(32);
+
+static struct omap_device_pm_latency omap_dwc3_latency[] = {
+ {
+ .deactivate_func = omap_device_idle_hwmods,
+ .activate_func = omap_device_enable_hwmods,
+ .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
+ },
+};
+
+void __init usb_dwc3_init(void)
+{
+ struct omap_hwmod *oh;
+ struct omap_device *od;
+ struct platform_device *pdev;
+ int bus_id = -1;
+ const char *oh_name, *name;
+
+ oh_name = "usb_otg_ss";
+ name = "omap-dwc3";
+
+ oh = omap_hwmod_lookup(oh_name);
+ if (!oh) {
+ pr_err("Could not lookup hwmod for %s\n", oh_name);
+ return;
+ }
+
+ od = omap_device_build(name, bus_id, oh,
+ NULL, 0,
+ omap_dwc3_latency, ARRAY_SIZE(omap_dwc3_latency),
+ false);
+ if (IS_ERR(od)) {
+ pr_err("Could not build omap_device for %s %s\n",
+ name, oh_name);
+ return;
+ }
+
+ pdev = &od->pdev;
+ get_device(&pdev->dev);
+ pdev->dev.dma_mask = &dwc3_dmamask;
+ pdev->dev.coherent_dma_mask = dwc3_dmamask;
+ put_device(&pdev->dev);
+}
@@ -293,4 +293,10 @@ static inline u32 omap1_usb2_init(unsigned nwires, unsigned alt_pingroup)
}
#endif
+#if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE)
+void usb_dwc3_init(void);
+#else
+static inline void usb_dwc3_init(void) {}
+#endif
+
#endif /* __ASM_ARCH_OMAP_USB_H */