aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPete Popov <ppopov@embeddedalley.com>2005-09-17 21:10:46 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:32:25 -0400
commit13bb199f98d179664cc24ab2e4762ef8ab059acc (patch)
treef442c2d1c1dcf911580a4b12c8c7a0317c55c373 /arch
parentd6460827af0763dc2f4a5cf0455cbf1e3a9ccb77 (diff)
Fix a cache snooping issue.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/au1000/common/dbdma.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/mips/au1000/common/dbdma.c b/arch/mips/au1000/common/dbdma.c
index eb5803aed91b..80d241b9c6f4 100644
--- a/arch/mips/au1000/common/dbdma.c
+++ b/arch/mips/au1000/common/dbdma.c
@@ -141,12 +141,12 @@ static dbdev_tab_t dbdev_tab[] = {
141 { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 }, 141 { DSCR_CMD0_AES_RX, DEV_FLAGS_IN , 4, 32, 0x10300008, 0, 0 },
142 { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 }, 142 { DSCR_CMD0_AES_TX, DEV_FLAGS_OUT, 4, 32, 0x10300004, 0, 0 },
143 143
144 { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 0, 0x11a0001c, 0, 0 }, 144 { DSCR_CMD0_PSC0_TX, DEV_FLAGS_OUT, 0, 16, 0x11a0001c, 0, 0 },
145 { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 0, 0x11a0001c, 0, 0 }, 145 { DSCR_CMD0_PSC0_RX, DEV_FLAGS_IN, 0, 16, 0x11a0001c, 0, 0 },
146 { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 146 { DSCR_CMD0_PSC0_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
147 147
148 { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 0, 0x11b0001c, 0, 0 }, 148 { DSCR_CMD0_PSC1_TX, DEV_FLAGS_OUT, 0, 16, 0x11b0001c, 0, 0 },
149 { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 0, 0x11b0001c, 0, 0 }, 149 { DSCR_CMD0_PSC1_RX, DEV_FLAGS_IN, 0, 16, 0x11b0001c, 0, 0 },
150 { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 }, 150 { DSCR_CMD0_PSC1_SYNC, DEV_FLAGS_ANYUSE, 0, 0, 0x00000000, 0, 0 },
151 151
152 { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 }, 152 { DSCR_CMD0_CIM_RXA, DEV_FLAGS_IN, 0, 32, 0x14004020, 0, 0 },
@@ -430,7 +430,13 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
430 cmd0 |= DSCR_CMD0_SID(srcid); 430 cmd0 |= DSCR_CMD0_SID(srcid);
431 cmd0 |= DSCR_CMD0_DID(destid); 431 cmd0 |= DSCR_CMD0_DID(destid);
432 cmd0 |= DSCR_CMD0_IE | DSCR_CMD0_CV; 432 cmd0 |= DSCR_CMD0_IE | DSCR_CMD0_CV;
433 cmd0 |= DSCR_CMD0_ST(DSCR_CMD0_ST_CURRENT); 433 cmd0 |= DSCR_CMD0_ST(DSCR_CMD0_ST_NOCHANGE);
434
435 /* is it mem to mem transfer? */
436 if(((DSCR_CUSTOM2DEV_ID(srcid) == DSCR_CMD0_THROTTLE) || (DSCR_CUSTOM2DEV_ID(srcid) == DSCR_CMD0_ALWAYS)) &&
437 ((DSCR_CUSTOM2DEV_ID(destid) == DSCR_CMD0_THROTTLE) || (DSCR_CUSTOM2DEV_ID(destid) == DSCR_CMD0_ALWAYS))) {
438 cmd0 |= DSCR_CMD0_MEM;
439 }
434 440
435 switch (stp->dev_devwidth) { 441 switch (stp->dev_devwidth) {
436 case 8: 442 case 8:
@@ -539,7 +545,8 @@ au1xxx_dbdma_ring_alloc(u32 chanid, int entries)
539 dp->dscr_dest0 = dest0; 545 dp->dscr_dest0 = dest0;
540 dp->dscr_dest1 = dest1; 546 dp->dscr_dest1 = dest1;
541 dp->dscr_stat = 0; 547 dp->dscr_stat = 0;
542 dp->sw_context = dp->sw_status = 0; 548 dp->sw_context = 0;
549 dp->sw_status = 0;
543 dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1)); 550 dp->dscr_nxtptr = DSCR_NXTPTR(virt_to_phys(dp + 1));
544 dp++; 551 dp++;
545 } 552 }
@@ -591,9 +598,6 @@ _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
591 dp->dscr_cmd0 |= DSCR_CMD0_IE; 598 dp->dscr_cmd0 |= DSCR_CMD0_IE;
592 if (flags & DDMA_FLAGS_NOIE) 599 if (flags & DDMA_FLAGS_NOIE)
593 dp->dscr_cmd0 &= ~DSCR_CMD0_IE; 600 dp->dscr_cmd0 &= ~DSCR_CMD0_IE;
594 /* Get next descriptor pointer.
595 */
596 ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
597 601
598 /* 602 /*
599 * There is an errata on the Au1200/Au1550 parts that could result 603 * There is an errata on the Au1200/Au1550 parts that could result
@@ -608,6 +612,10 @@ _au1xxx_dbdma_put_source(u32 chanid, void *buf, int nbytes, u32 flags)
608 dma_cache_wback_inv((unsigned long)dp, sizeof(dp)); 612 dma_cache_wback_inv((unsigned long)dp, sizeof(dp));
609 ctp->chan_ptr->ddma_dbell = 0; 613 ctp->chan_ptr->ddma_dbell = 0;
610 614
615 /* Get next descriptor pointer.
616 */
617 ctp->put_ptr = phys_to_virt(DSCR_GET_NXTPTR(dp->dscr_nxtptr));
618
611 /* return something not zero. 619 /* return something not zero.
612 */ 620 */
613 return nbytes; 621 return nbytes;