musb: adding support for am335x
authorAjay Kumar Gupta <ajay.gupta@ti.com>
Fri, 29 Jul 2011 12:29:00 +0000 (17:59 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:20 +0000 (00:44 +0530)
am335x has two musb interface and uses cppi4.1 dma engine. It's
almost same as ti81xx and so using ti81xx files for am335x.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
drivers/usb/musb/Kconfig
drivers/usb/musb/cppi41_dma.c

index fbe05ea6443353dd2e09a0bf8e3c5af66fff9ae5..a06335fa7e9a9b550d5b3e565b49e366bacd7384 100644 (file)
@@ -8,7 +8,7 @@ config USB_MUSB_HDRC
        tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
        depends on USB && USB_GADGET
        select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN)
-       select NOP_USB_XCEIV if (SOC_OMAPTI81XX)
+       select NOP_USB_XCEIV if (SOC_OMAPTI81XX || SOC_OMAPAM33XX)
        select TWL4030_USB if MACH_OMAP_3430SDP
        select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
        select USB_OTG_UTILS
@@ -62,8 +62,8 @@ config USB_MUSB_AM35X_GLUE
 
 config USB_MUSB_TI81XX_GLUE
        select USB_MUSB_TI81XX
-       tristate "TI81XX"
-       depends on SOC_OMAPTI81XX && USB_MUSB_HDRC
+       tristate "TI81XX onward"
+       depends on (SOC_OMAPTI81XX || SOC_OMAPAM33XX) && USB_MUSB_HDRC
 
 config USB_MUSB_BLACKFIN_GLUE
        select USB_MUSB_BLACKFIN
index b274732c13b737e54d7123ca5d1b1e79caedae12..b553d49931b1a8a03e946db1cbb1db054ed6332b 100644 (file)
@@ -191,7 +191,7 @@ static int __devinit cppi41_controller_start(struct dma_controller *controller)
        cppi_info = cppi->cppi_info;
        musb = cppi->musb;
 
-       if (cpu_is_ti81xx()) {
+       if (cpu_is_ti816x() || cpu_is_am33xx()) {
                cppi->automode_reg_offs = TI81XX_USB_AUTOREQ_REG;
                cppi->teardown_reg_offs = TI81XX_USB_TEARDOWN_REG;
        } else {
@@ -1510,14 +1510,14 @@ static void usb_process_rx_queue(struct cppi41 *cppi, unsigned index)
                if (unlikely(rx_ch->channel.actual_len >= rx_ch->length ||
                             length < orig_buf_len)) {
 
-#ifdef CONFIG_SOC_OMAPTI81XX
+#if defined(CONFIG_SOC_OMAPTI81XX) || defined(CONFIG_SOC_OMAPAM33XX)
                        struct musb_hw_ep *ep;
                        u8 isoc, next_seg = 0;
 
                        /* Workaround for early rx completion of
                         * cppi41 dma in Generic RNDIS mode for ti81xx
                         */
-                       if (cpu_is_ti81xx() && is_host_enabled(cppi->musb)) {
+                       if (is_host_enabled(cppi->musb)) {
                                u32 pkt_size = rx_ch->pkt_size;
                                ep = cppi->musb->endpoints + ep_num;
                                isoc = musb_readb(ep->regs, MUSB_RXTYPE);