Update of /cvsroot/linux-mips/linux/include/asm-mips
In directory usw-pr-cvs1:/tmp/cvs-serv32242/include/asm-mips
Modified Files:
au1000.h au1000_dma.h
Log Message:
Replaced readl/writel type of macros with au_readl/au_writel since
we need to enable software byte swapping in BE mode, but register
accesses should not be swapped. The Pb1x00 boards are now mostly BE
safe, but some external peripherals (external to the SOC) are not yet
usable in BE mode. USB has not been tested in BE mode either.
Index: au1000.h
===================================================================
RCS file: /cvsroot/linux-mips/linux/include/asm-mips/au1000.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- au1000.h 18 Apr 2002 00:03:28 -0000 1.18
+++ au1000.h 1 May 2002 18:00:31 -0000 1.19
@@ -58,20 +58,50 @@
void static inline outb_sync(u8 val, int reg)
{
- writeb(val, reg);
+ *(volatile u8 *)(reg) = val;
au_sync();
}
void static inline outw_sync(u16 val, int reg)
{
- writew(val, reg);
+ *(volatile u16 *)(reg) = val;
au_sync();
}
void static inline outl_sync(u32 val, int reg)
{
- writel(val, reg);
+ *(volatile u32 *)(reg) = val;
au_sync();
+}
+
+void static inline au_writeb(u8 val, int reg)
+{
+ *(volatile u8 *)(reg) = val;
+}
+
+void static inline au_writew(u16 val, int reg)
+{
+ *(volatile u16 *)(reg) = val;
+}
+
+void static inline au_writel(u32 val, int reg)
+{
+ *(volatile u32 *)(reg) = val;
+}
+
+static inline u8 au_readb(unsigned long port)
+{
+ return (*(volatile u8 *)port);
+}
+
+static inline u16 au_readw(unsigned long port)
+{
+ return (*(volatile u16 *)port);
+}
+
+static inline u32 au_readl(unsigned long port)
+{
+ return (*(volatile u32 *)port);
}
/* arch/mips/au1000/common/clocks.c */
Index: au1000_dma.h
===================================================================
RCS file: /cvsroot/linux-mips/linux/include/asm-mips/au1000_dma.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- au1000_dma.h 25 Mar 2002 22:58:15 -0000 1.8
+++ au1000_dma.h 1 May 2002 18:00:31 -0000 1.9
@@ -191,7 +191,7 @@
// poll the halt bit
for (i = 0; i < DMA_HALT_POLL; i++)
- if (inl(chan->io + DMA_MODE_SET) & DMA_HALT)
+ if (au_readl(chan->io + DMA_MODE_SET) & DMA_HALT)
break;
if (i == DMA_HALT_POLL) {
printk(KERN_INFO "disable_dma: HALT poll expired!\n");
@@ -233,7 +233,7 @@
struct dma_chan *chan = get_dma_chan(dmanr);
if (!chan)
return -1;
- return (inl(chan->io + DMA_MODE_SET) & DMA_AB) ? 1 : 0;
+ return (au_readl(chan->io + DMA_MODE_SET) & DMA_AB) ? 1 : 0;
}
@@ -354,7 +354,7 @@
if (!chan)
return 0;
- return inl(chan->io + DMA_MODE_SET) & (DMA_D0 | DMA_D1);
+ return au_readl(chan->io + DMA_MODE_SET) & (DMA_D0 | DMA_D1);
}
@@ -380,10 +380,10 @@
if (!chan)
return 0;
- curBufCntReg = (inl(chan->io + DMA_MODE_SET) & DMA_AB) ?
+ curBufCntReg = (au_readl(chan->io + DMA_MODE_SET) & DMA_AB) ?
DMA_BUFFER1_COUNT : DMA_BUFFER0_COUNT;
- count = inl(chan->io + curBufCntReg) & DMA_COUNT_MASK;
+ count = au_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK;
if ((chan->mode & DMA_DW_MASK) == DMA_DW16)
count <<= 1;
|