Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31682
b: refs/heads/master
c: 7ff879d
h: refs/heads/master
v: v3
  • Loading branch information
Tony Lindgren committed Jun 26, 2006
1 parent 15dc75e commit eb38805
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dc3c8f20159530d5553d0f8decc9454916d7495
refs/heads/master: 7ff879dbcd2083c95933a56bce65ae45ecab3f35
37 changes: 22 additions & 15 deletions trunk/arch/arm/plat-omap/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

#define OMAP_DMA_ACTIVE 0x01
#define OMAP_DMA_CCR_EN (1 << 7)
#define OMAP2_DMA_CSR_CLEAR_MASK 0xffe

#define OMAP_FUNC_MUX_ARM_BASE (0xfffe1000 + 0xec)

Expand Down Expand Up @@ -409,8 +410,11 @@ static inline void omap_enable_channel_irq(int lch)
{
u32 status;

/* Read CSR to make sure it's cleared. */
status = OMAP_DMA_CSR_REG(lch);
/* Clear CSR */
if (cpu_class_is_omap1())
status = OMAP_DMA_CSR_REG(lch);
else if (cpu_is_omap24xx())
OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;

/* Enable some nice interrupts. */
OMAP_DMA_CICR_REG(lch) = dma_chan[lch].enabled_irqs;
Expand Down Expand Up @@ -509,11 +513,13 @@ int omap_request_dma(int dev_id, const char *dev_name,
chan->dev_name = dev_name;
chan->callback = callback;
chan->data = data;
chan->enabled_irqs = OMAP_DMA_TOUT_IRQ | OMAP_DMA_DROP_IRQ |
OMAP_DMA_BLOCK_IRQ;
chan->enabled_irqs = OMAP_DMA_DROP_IRQ | OMAP_DMA_BLOCK_IRQ;

if (cpu_is_omap24xx())
chan->enabled_irqs |= OMAP2_DMA_TRANS_ERR_IRQ;
if (cpu_class_is_omap1())
chan->enabled_irqs |= OMAP1_DMA_TOUT_IRQ;
else if (cpu_is_omap24xx())
chan->enabled_irqs |= OMAP2_DMA_MISALIGNED_ERR_IRQ |
OMAP2_DMA_TRANS_ERR_IRQ;

if (cpu_is_omap16xx()) {
/* If the sync device is set, configure it dynamically. */
Expand All @@ -533,7 +539,7 @@ int omap_request_dma(int dev_id, const char *dev_name,

omap_enable_channel_irq(free_ch);
/* Clear the CSR register and IRQ status register */
OMAP_DMA_CSR_REG(free_ch) = 0x0;
OMAP_DMA_CSR_REG(free_ch) = OMAP2_DMA_CSR_CLEAR_MASK;
omap_writel(~0x0, OMAP_DMA4_IRQSTATUS_L0);
}

Expand Down Expand Up @@ -573,7 +579,7 @@ void omap_free_dma(int lch)
omap_writel(val, OMAP_DMA4_IRQENABLE_L0);

/* Clear the CSR register and IRQ status register */
OMAP_DMA_CSR_REG(lch) = 0x0;
OMAP_DMA_CSR_REG(lch) = OMAP2_DMA_CSR_CLEAR_MASK;

val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
val |= 1 << lch;
Expand Down Expand Up @@ -837,7 +843,7 @@ static int omap1_dma_handle_ch(int ch)
"%d (CSR %04x)\n", ch, csr);
return 0;
}
if (unlikely(csr & OMAP_DMA_TOUT_IRQ))
if (unlikely(csr & OMAP1_DMA_TOUT_IRQ))
printk(KERN_WARNING "DMA timeout with device %d\n",
dma_chan[ch].dev_id);
if (unlikely(csr & OMAP_DMA_DROP_IRQ))
Expand Down Expand Up @@ -885,20 +891,21 @@ static int omap2_dma_handle_ch(int ch)
return 0;
if (unlikely(dma_chan[ch].dev_id == -1))
return 0;
/* REVISIT: According to 24xx TRM, there's no TOUT_IE */
if (unlikely(status & OMAP_DMA_TOUT_IRQ))
printk(KERN_INFO "DMA timeout with device %d\n",
dma_chan[ch].dev_id);
if (unlikely(status & OMAP_DMA_DROP_IRQ))
printk(KERN_INFO
"DMA synchronization event drop occurred with device "
"%d\n", dma_chan[ch].dev_id);

if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ))
printk(KERN_INFO "DMA transaction error with device %d\n",
dma_chan[ch].dev_id);
if (unlikely(status & OMAP2_DMA_SECURE_ERR_IRQ))
printk(KERN_INFO "DMA secure error with device %d\n",
dma_chan[ch].dev_id);
if (unlikely(status & OMAP2_DMA_MISALIGNED_ERR_IRQ))
printk(KERN_INFO "DMA misaligned error with device %d\n",
dma_chan[ch].dev_id);

OMAP_DMA_CSR_REG(ch) = 0x20;
OMAP_DMA_CSR_REG(ch) = OMAP2_DMA_CSR_CLEAR_MASK;

val = omap_readl(OMAP_DMA4_IRQSTATUS_L0);
/* ch in this function is from 0-31 while in register it is 1-32 */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/mmc/omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ static void mmc_omap_dma_cb(int lch, u16 ch_status, void *data)
return;
}
/* FIXME: We really should do something to _handle_ the errors */
if (ch_status & OMAP_DMA_TOUT_IRQ) {
if (ch_status & OMAP1_DMA_TOUT_IRQ) {
dev_err(mmc_dev(host->mmc),"DMA timeout\n");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/usb/gadget/omap_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ static void dma_error(int lch, u16 ch_status, void *data)
struct omap_ep *ep = data;

/* if ch_status & OMAP_DMA_DROP_IRQ ... */
/* if ch_status & OMAP_DMA_TOUT_IRQ ... */
/* if ch_status & OMAP1_DMA_TOUT_IRQ ... */
ERR("%s dma error, lch %d status %02x\n", ep->ep.name, lch, ch_status);

/* complete current transfer ... */
Expand Down
11 changes: 7 additions & 4 deletions trunk/include/asm-arm/arch-omap/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@
/* DMA channels for 24xx */
#define OMAP24XX_DMA_NO_DEVICE 0
#define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */
#define OMAP24XX_DMA_EXT_NDMA_REQ0 2 /* S_DMA_1 */
#define OMAP24XX_DMA_EXT_NDMA_REQ1 3 /* S_DMA_2 */
#define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */
#define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */
#define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */
#define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */
#define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */
Expand All @@ -197,7 +197,9 @@
#define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */
#define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */
#define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */

#define OMAP24XX_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */
#define OMAP24XX_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */
#define OMAP24XX_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */
#define OMAP24XX_DMA_EAC_AC_RD 17 /* S_DMA_16 */
#define OMAP24XX_DMA_EAC_AC_WR 18 /* S_DMA_17 */
#define OMAP24XX_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */
Expand Down Expand Up @@ -244,6 +246,7 @@
#define OMAP24XX_DMA_MMC1_TX 61 /* SDMA_60 */
#define OMAP24XX_DMA_MMC1_RX 62 /* SDMA_61 */
#define OMAP24XX_DMA_MS 63 /* SDMA_62 */
#define OMAP24XX_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */

/*----------------------------------------------------------------------------*/

Expand Down Expand Up @@ -274,7 +277,7 @@
#define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea)
#define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4)

#define OMAP_DMA_TOUT_IRQ (1 << 0) /* Only on omap1 */
#define OMAP1_DMA_TOUT_IRQ (1 << 0)
#define OMAP_DMA_DROP_IRQ (1 << 1)
#define OMAP_DMA_HALF_IRQ (1 << 2)
#define OMAP_DMA_FRAME_IRQ (1 << 3)
Expand Down

0 comments on commit eb38805

Please sign in to comment.