aboutsummaryrefslogtreecommitdiff
path: root/arch/m32r/kernel/io_usrv.c
diff options
context:
space:
mode:
authorHirokazu Takata <takata@linux-m32r.org>2005-06-21 17:16:10 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 19:07:30 -0700
commit2368086344c3d67b0f4aecac39d620fb9b8795c3 (patch)
treeaa55003e311abf6049acd23f5ff7f8bfd24eca4c /arch/m32r/kernel/io_usrv.c
parentd4c477ca5448f19afaaf6c0cfd655009ea9e614d (diff)
[PATCH] m32r: Support M3A-2170(Mappi-III) platform
This patchset is for supporting a new m32r platform, M3A-2170(Mappi-III) evaluation board. An M32R chip multiprocessor is equipped on the board. http://http://www.linux-m32r.org/eng/platform/platform.html * arch/m32r/Kconfig: Support Mappi-III platform. * arch/m32r/kernel/Makefile: ditto. * arch/m32r/kernel/io_mappi3.c: ditto. * arch/m32r/kernel/setup.c: ditto. * arch/m32r/kernel/setup_mappi3.c: ditto. * include/asm-m32r/m32102.h: ditto. * include/asm-m32r/m32r.h: ditto. * include/asm-m32r/mappi3/mappi3_pld.h: ditto. * include/asm-m32r/ide.h: CF support for Mappi-III. * arch/m32r/kernel/setup_mappi3.c: ditto. * arch/m32r/mappi3/defconfig.smp: A default config file for Mappi-III. * arch/m32r/mappi3/dot.gdbinit: A default .gdbinit file for Mappi-III. * arch/m32r/boot/compressed/m32r_sio.c: Modified for Mappi-III - At boot time, m32r-g00ff bootloader makes MMU off for Mappi-III, on the contrary it makes MMU on for Mappi-II. * arch/m32r/kernel/io_mappi2.c: Update comments. * arch/m32r/kernel/setup_mappi2.c: ditto. Signed-off-by: Mamoru Sakugawa <sakugawa@linux-m32r.org> Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/m32r/kernel/io_usrv.c')
-rw-r--r--arch/m32r/kernel/io_usrv.c51
1 files changed, 14 insertions, 37 deletions
diff --git a/arch/m32r/kernel/io_usrv.c b/arch/m32r/kernel/io_usrv.c
index 27928a0b99e..9eb161dcc10 100644
--- a/arch/m32r/kernel/io_usrv.c
+++ b/arch/m32r/kernel/io_usrv.c
@@ -3,8 +3,8 @@
*
* Typical I/O routines for uServer board.
*
- * Copyright (c) 2001 - 2003 Hiroyuki Kondo, Hirokazu Takata,
- * Hitoshi Yamamoto, Takeo Takahashi
+ * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata,
+ * Hitoshi Yamamoto, Takeo Takahashi
*
* This file is subject to the terms and conditions of the GNU General
* Public License. See the file "COPYING" in the main directory of this
@@ -39,7 +39,7 @@ extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int);
#define PORT2ADDR(port) _port2addr(port)
-static __inline__ void *_port2addr(unsigned long port)
+static inline void *_port2addr(unsigned long port)
{
#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
if (port >= UART0_IOSTART && port <= UART0_IOEND)
@@ -50,7 +50,7 @@ static __inline__ void *_port2addr(unsigned long port)
return (void *)(port + NONCACHE_OFFSET);
}
-static __inline__ void delay(void)
+static inline void delay(void)
{
__asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory");
}
@@ -87,39 +87,22 @@ unsigned long _inl(unsigned long port)
unsigned char _inb_p(unsigned long port)
{
- unsigned char b;
-
- if (port >= CFC_IOSTART && port <= CFC_IOEND) {
- pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
- return b;
- } else {
- b = *(volatile unsigned char *)PORT2ADDR(port);
- delay();
- return b;
- }
+ unsigned char v = _inb(port);
+ delay();
+ return v;
}
unsigned short _inw_p(unsigned long port)
{
- unsigned short w;
-
- if (port >= CFC_IOSTART && port <= CFC_IOEND) {
- pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
- return w;
- } else {
- w = *(volatile unsigned short *)PORT2ADDR(port);
- delay();
- return w;
- }
+ unsigned short v = _inw(port);
+ delay();
+ return v;
}
unsigned long _inl_p(unsigned long port)
{
- unsigned long v;
-
- v = *(volatile unsigned long *)PORT2ADDR(port);
+ unsigned long v = _inl(port);
delay();
-
return v;
}
@@ -149,25 +132,19 @@ void _outl(unsigned long l, unsigned long port)
void _outb_p(unsigned char b, unsigned long port)
{
- if (port >= CFC_IOSTART && port <= CFC_IOEND)
- pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
- else
- *(volatile unsigned char *)PORT2ADDR(port) = b;
+ _outb(b, port);
delay();
}
void _outw_p(unsigned short w, unsigned long port)
{
- if (port >= CFC_IOSTART && port <= CFC_IOEND)
- pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
- else
- *(volatile unsigned short *)PORT2ADDR(port) = w;
+ _outw(w, port);
delay();
}
void _outl_p(unsigned long l, unsigned long port)
{
- *(volatile unsigned long *)PORT2ADDR(port) = l;
+ _outl(l, port);
delay();
}