Commit 2aad33d7 authored by Hirokazu Takata's avatar Hirokazu Takata Committed by Linus Torvalds

[PATCH] m32r: modify IO routines for m32700ut CF access

Here is a patch for M3T-M32700UT board.

- Enable CF access through card-service if CONFIG_M32R_CFC is not defined.
Signed-off-by: default avatarHirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b405caff
...@@ -40,7 +40,7 @@ static __inline__ void *_port2addr(unsigned long port) ...@@ -40,7 +40,7 @@ static __inline__ void *_port2addr(unsigned long port)
return (void *)(port + NONCACHE_OFFSET); return (void *)(port + NONCACHE_OFFSET);
} }
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
static __inline__ void *__port2addr_ata(unsigned long port) static __inline__ void *__port2addr_ata(unsigned long port)
{ {
static int dummy_reg; static int dummy_reg;
...@@ -119,7 +119,7 @@ unsigned char _inb(unsigned long port) ...@@ -119,7 +119,7 @@ unsigned char _inb(unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
return _ne_inb(PORT2ADDR_NE(port)); return _ne_inb(PORT2ADDR_NE(port));
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned char *)__port2addr_ata(port); return *(volatile unsigned char *)__port2addr_ata(port);
} }
...@@ -139,7 +139,7 @@ unsigned short _inw(unsigned long port) ...@@ -139,7 +139,7 @@ unsigned short _inw(unsigned long port)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
return _ne_inw(PORT2ADDR_NE(port)); return _ne_inw(PORT2ADDR_NE(port));
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned short *)__port2addr_ata(port); return *(volatile unsigned short *)__port2addr_ata(port);
} }
...@@ -177,7 +177,7 @@ unsigned char _inb_p(unsigned long port) ...@@ -177,7 +177,7 @@ unsigned char _inb_p(unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inb(PORT2ADDR_NE(port)); v = _ne_inb(PORT2ADDR_NE(port));
else else
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned char *)__port2addr_ata(port); return *(volatile unsigned char *)__port2addr_ata(port);
} else } else
...@@ -202,7 +202,7 @@ unsigned short _inw_p(unsigned long port) ...@@ -202,7 +202,7 @@ unsigned short _inw_p(unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
v = _ne_inw(PORT2ADDR_NE(port)); v = _ne_inw(PORT2ADDR_NE(port));
else else
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
return *(volatile unsigned short *)__port2addr_ata(port); return *(volatile unsigned short *)__port2addr_ata(port);
} else } else
...@@ -239,7 +239,7 @@ void _outb(unsigned char b, unsigned long port) ...@@ -239,7 +239,7 @@ void _outb(unsigned char b, unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
_ne_outb(b, PORT2ADDR_NE(port)); _ne_outb(b, PORT2ADDR_NE(port));
else else
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned char *)__port2addr_ata(port) = b; *(volatile unsigned char *)__port2addr_ata(port) = b;
} else } else
...@@ -257,7 +257,7 @@ void _outw(unsigned short w, unsigned long port) ...@@ -257,7 +257,7 @@ void _outw(unsigned short w, unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
_ne_outw(w, PORT2ADDR_NE(port)); _ne_outw(w, PORT2ADDR_NE(port));
else else
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned short *)__port2addr_ata(port) = w; *(volatile unsigned short *)__port2addr_ata(port) = w;
} else } else
...@@ -290,7 +290,7 @@ void _outb_p(unsigned char b, unsigned long port) ...@@ -290,7 +290,7 @@ void _outb_p(unsigned char b, unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
_ne_outb(b, PORT2ADDR_NE(port)); _ne_outb(b, PORT2ADDR_NE(port));
else else
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned char *)__port2addr_ata(port) = b; *(volatile unsigned char *)__port2addr_ata(port) = b;
} else } else
...@@ -310,7 +310,7 @@ void _outw_p(unsigned short w, unsigned long port) ...@@ -310,7 +310,7 @@ void _outw_p(unsigned short w, unsigned long port)
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
_ne_outw(w, PORT2ADDR_NE(port)); _ne_outw(w, PORT2ADDR_NE(port));
else else
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
*(volatile unsigned short *)__port2addr_ata(port) = w; *(volatile unsigned short *)__port2addr_ata(port) = w;
} else } else
...@@ -340,7 +340,7 @@ void _insb(unsigned int port, void * addr, unsigned long count) ...@@ -340,7 +340,7 @@ void _insb(unsigned int port, void * addr, unsigned long count)
{ {
if (port >= LAN_IOSTART && port < LAN_IOEND) if (port >= LAN_IOSTART && port < LAN_IOEND)
_ne_insb(PORT2ADDR_NE(port), addr, count); _ne_insb(PORT2ADDR_NE(port), addr, count);
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
unsigned char *buf = addr; unsigned char *buf = addr;
unsigned char *portp = __port2addr_ata(port); unsigned char *portp = __port2addr_ata(port);
...@@ -375,7 +375,7 @@ void _insw(unsigned int port, void * addr, unsigned long count) ...@@ -375,7 +375,7 @@ void _insw(unsigned int port, void * addr, unsigned long count)
} else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), count, 1); pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), count, 1);
#endif #endif
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
} else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
portp = __port2addr_ata(port); portp = __port2addr_ata(port);
while (count--) *buf++ = *(volatile unsigned short *)portp; while (count--) *buf++ = *(volatile unsigned short *)portp;
...@@ -403,7 +403,7 @@ void _outsb(unsigned int port, const void * addr, unsigned long count) ...@@ -403,7 +403,7 @@ void _outsb(unsigned int port, const void * addr, unsigned long count)
if (port >= LAN_IOSTART && port < LAN_IOEND) { if (port >= LAN_IOSTART && port < LAN_IOEND) {
portp = PORT2ADDR_NE(port); portp = PORT2ADDR_NE(port);
while (count--) _ne_outb(*buf++, portp); while (count--) _ne_outb(*buf++, portp);
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
} else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
portp = __port2addr_ata(port); portp = __port2addr_ata(port);
while(count--) *(volatile unsigned char *)portp = *buf++; while(count--) *(volatile unsigned char *)portp = *buf++;
...@@ -430,7 +430,7 @@ void _outsw(unsigned int port, const void * addr, unsigned long count) ...@@ -430,7 +430,7 @@ void _outsw(unsigned int port, const void * addr, unsigned long count)
*/ */
portp = PORT2ADDR_NE(port); portp = PORT2ADDR_NE(port);
while(count--) *(volatile unsigned short *)portp = *buf++; while(count--) *(volatile unsigned short *)portp = *buf++;
#if defined(CONFIG_IDE) #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
} else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
portp = __port2addr_ata(port); portp = __port2addr_ata(port);
while(count--) *(volatile unsigned short *)portp = *buf++; while(count--) *(volatile unsigned short *)portp = *buf++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment