~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/usb/musb/tusb6010_omap.c

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
        tusb_dma = container_of(c, struct tusb_omap_dma, controller);
67
67
 
68
 
        /* DBG(3, "ep%i ch: %i\n", chdat->epnum, chdat->ch); */
 
68
        /* dev_dbg(musb->controller, "ep%i ch: %i\n", chdat->epnum, chdat->ch); */
69
69
 
70
70
        return 0;
71
71
}
76
76
 
77
77
        tusb_dma = container_of(c, struct tusb_omap_dma, controller);
78
78
 
79
 
        /* DBG(3, "ep%i ch: %i\n", chdat->epnum, chdat->ch); */
 
79
        /* dev_dbg(musb->controller, "ep%i ch: %i\n", chdat->epnum, chdat->ch); */
80
80
 
81
81
        return 0;
82
82
}
89
89
        u32             reg = musb_readl(chdat->tbase, TUSB_DMA_EP_MAP);
90
90
 
91
91
        if (reg != 0) {
92
 
                DBG(3, "ep%i dmareq0 is busy for ep%i\n",
 
92
                dev_dbg(musb->controller, "ep%i dmareq0 is busy for ep%i\n",
93
93
                        chdat->epnum, reg & 0xf);
94
94
                return -EAGAIN;
95
95
        }
143
143
        if (ch_status != OMAP_DMA_BLOCK_IRQ)
144
144
                printk(KERN_ERR "TUSB DMA error status: %i\n", ch_status);
145
145
 
146
 
        DBG(3, "ep%i %s dma callback ch: %i status: %x\n",
 
146
        dev_dbg(musb->controller, "ep%i %s dma callback ch: %i status: %x\n",
147
147
                chdat->epnum, chdat->tx ? "tx" : "rx",
148
148
                ch, ch_status);
149
149
 
156
156
 
157
157
        /* HW issue #10: XFR_SIZE may get corrupt on DMA (both async & sync) */
158
158
        if (unlikely(remaining > chdat->transfer_len)) {
159
 
                DBG(2, "Corrupt %s dma ch%i XFR_SIZE: 0x%08lx\n",
 
159
                dev_dbg(musb->controller, "Corrupt %s dma ch%i XFR_SIZE: 0x%08lx\n",
160
160
                        chdat->tx ? "tx" : "rx", chdat->ch,
161
161
                        remaining);
162
162
                remaining = 0;
165
165
        channel->actual_len = chdat->transfer_len - remaining;
166
166
        pio = chdat->len - channel->actual_len;
167
167
 
168
 
        DBG(3, "DMA remaining %lu/%u\n", remaining, chdat->transfer_len);
 
168
        dev_dbg(musb->controller, "DMA remaining %lu/%u\n", remaining, chdat->transfer_len);
169
169
 
170
170
        /* Transfer remaining 1 - 31 bytes */
171
171
        if (pio > 0 && pio < 32) {
172
172
                u8      *buf;
173
173
 
174
 
                DBG(3, "Using PIO for remaining %lu bytes\n", pio);
 
174
                dev_dbg(musb->controller, "Using PIO for remaining %lu bytes\n", pio);
175
175
                buf = phys_to_virt((u32)chdat->dma_addr) + chdat->transfer_len;
176
176
                if (chdat->tx) {
177
177
                        dma_unmap_single(dev, chdat->dma_addr,
209
209
                u16     csr;
210
210
 
211
211
                if (chdat->tx) {
212
 
                        DBG(3, "terminating short tx packet\n");
 
212
                        dev_dbg(musb->controller, "terminating short tx packet\n");
213
213
                        musb_ep_select(mbase, chdat->epnum);
214
214
                        csr = musb_readw(hw_ep->regs, MUSB_TXCSR);
215
215
                        csr |= MUSB_TXCSR_MODE | MUSB_TXCSR_TXPKTRDY
264
264
 
265
265
        dma_remaining = TUSB_EP_CONFIG_XFR_SIZE(dma_remaining);
266
266
        if (dma_remaining) {
267
 
                DBG(2, "Busy %s dma ch%i, not using: %08x\n",
 
267
                dev_dbg(musb->controller, "Busy %s dma ch%i, not using: %08x\n",
268
268
                        chdat->tx ? "tx" : "rx", chdat->ch,
269
269
                        dma_remaining);
270
270
                return false;
283
283
                sync_dev = chdat->sync_dev;
284
284
        } else {
285
285
                if (tusb_omap_use_shared_dmareq(chdat) != 0) {
286
 
                        DBG(3, "could not get dma for ep%i\n", chdat->epnum);
 
286
                        dev_dbg(musb->controller, "could not get dma for ep%i\n", chdat->epnum);
287
287
                        return false;
288
288
                }
289
289
                if (tusb_dma->ch < 0) {
326
326
 
327
327
        dma_params.frame_count  = chdat->transfer_len / 32; /* Burst sz frame */
328
328
 
329
 
        DBG(3, "ep%i %s dma ch%i dma: %08x len: %u(%u) packet_sz: %i(%i)\n",
 
329
        dev_dbg(musb->controller, "ep%i %s dma ch%i dma: %08x len: %u(%u) packet_sz: %i(%i)\n",
330
330
                chdat->epnum, chdat->tx ? "tx" : "rx",
331
331
                ch, dma_addr, chdat->transfer_len, len,
332
332
                chdat->transfer_packet_sz, packet_sz);
370
370
                dst_burst = OMAP_DMA_DATA_BURST_16;     /* 16x32 write */
371
371
        }
372
372
 
373
 
        DBG(3, "ep%i %s using %i-bit %s dma from 0x%08lx to 0x%08lx\n",
 
373
        dev_dbg(musb->controller, "ep%i %s using %i-bit %s dma from 0x%08lx to 0x%08lx\n",
374
374
                chdat->epnum, chdat->tx ? "tx" : "rx",
375
375
                (dma_params.data_type == OMAP_DMA_DATA_TYPE_S32) ? 32 : 16,
376
376
                ((dma_addr & 0x3) == 0) ? "sync" : "async",
525
525
 
526
526
        /* REVISIT: Why does dmareq5 not work? */
527
527
        if (hw_ep->epnum == 0) {
528
 
                DBG(3, "Not allowing DMA for ep0 %s\n", tx ? "tx" : "rx");
 
528
                dev_dbg(musb->controller, "Not allowing DMA for ep0 %s\n", tx ? "tx" : "rx");
529
529
                return NULL;
530
530
        }
531
531
 
585
585
                chdat->ch = -1;
586
586
        }
587
587
 
588
 
        DBG(3, "ep%i %s dma: %s dma%i dmareq%i sync%i\n",
 
588
        dev_dbg(musb->controller, "ep%i %s dma: %s dma%i dmareq%i sync%i\n",
589
589
                chdat->epnum,
590
590
                chdat->tx ? "tx" : "rx",
591
591
                chdat->ch >= 0 ? "dedicated" : "shared",
598
598
free_dmareq:
599
599
        tusb_omap_dma_free_dmareq(chdat);
600
600
 
601
 
        DBG(3, "ep%i: Could not get a DMA channel\n", chdat->epnum);
 
601
        dev_dbg(musb->controller, "ep%i: Could not get a DMA channel\n", chdat->epnum);
602
602
        channel->status = MUSB_DMA_STATUS_UNKNOWN;
603
603
 
604
604
        return NULL;
611
611
        void __iomem            *tbase = musb->ctrl_base;
612
612
        u32                     reg;
613
613
 
614
 
        DBG(3, "ep%i ch%i\n", chdat->epnum, chdat->ch);
 
614
        dev_dbg(musb->controller, "ep%i ch%i\n", chdat->epnum, chdat->ch);
615
615
 
616
616
        reg = musb_readl(tbase, TUSB_DMA_INT_MASK);
617
617
        if (chdat->tx)