diff options
author | Hirokazu Takata <takata@linux-m32r.org> | 2005-06-21 20:16:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 22:07:30 -0400 |
commit | 2368086344c3d67b0f4aecac39d620fb9b8795c3 (patch) | |
tree | aa55003e311abf6049acd23f5ff7f8bfd24eca4c /arch/m32r/kernel/io_usrv.c | |
parent | d4c477ca5448f19afaaf6c0cfd655009ea9e614d (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.c | 51 |
1 files changed, 14 insertions, 37 deletions
diff --git a/arch/m32r/kernel/io_usrv.c b/arch/m32r/kernel/io_usrv.c index 27928a0b99ed..9eb161dcc104 100644 --- a/arch/m32r/kernel/io_usrv.c +++ b/arch/m32r/kernel/io_usrv.c | |||
@@ -3,8 +3,8 @@ | |||
3 | * | 3 | * |
4 | * Typical I/O routines for uServer board. | 4 | * Typical I/O routines for uServer board. |
5 | * | 5 | * |
6 | * Copyright (c) 2001 - 2003 Hiroyuki Kondo, Hirokazu Takata, | 6 | * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, |
7 | * Hitoshi Yamamoto, Takeo Takahashi | 7 | * Hitoshi Yamamoto, Takeo Takahashi |
8 | * | 8 | * |
9 | * This file is subject to the terms and conditions of the GNU General | 9 | * This file is subject to the terms and conditions of the GNU General |
10 | * Public License. See the file "COPYING" in the main directory of this | 10 | * 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); | |||
39 | 39 | ||
40 | #define PORT2ADDR(port) _port2addr(port) | 40 | #define PORT2ADDR(port) _port2addr(port) |
41 | 41 | ||
42 | static __inline__ void *_port2addr(unsigned long port) | 42 | static inline void *_port2addr(unsigned long port) |
43 | { | 43 | { |
44 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) | 44 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
45 | if (port >= UART0_IOSTART && port <= UART0_IOEND) | 45 | if (port >= UART0_IOSTART && port <= UART0_IOEND) |
@@ -50,7 +50,7 @@ static __inline__ void *_port2addr(unsigned long port) | |||
50 | return (void *)(port + NONCACHE_OFFSET); | 50 | return (void *)(port + NONCACHE_OFFSET); |
51 | } | 51 | } |
52 | 52 | ||
53 | static __inline__ void delay(void) | 53 | static inline void delay(void) |
54 | { | 54 | { |
55 | __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); | 55 | __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); |
56 | } | 56 | } |
@@ -87,39 +87,22 @@ unsigned long _inl(unsigned long port) | |||
87 | 87 | ||
88 | unsigned char _inb_p(unsigned long port) | 88 | unsigned char _inb_p(unsigned long port) |
89 | { | 89 | { |
90 | unsigned char b; | 90 | unsigned char v = _inb(port); |
91 | 91 | delay(); | |
92 | if (port >= CFC_IOSTART && port <= CFC_IOEND) { | 92 | return v; |
93 | pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); | ||
94 | return b; | ||
95 | } else { | ||
96 | b = *(volatile unsigned char *)PORT2ADDR(port); | ||
97 | delay(); | ||
98 | return b; | ||
99 | } | ||
100 | } | 93 | } |
101 | 94 | ||
102 | unsigned short _inw_p(unsigned long port) | 95 | unsigned short _inw_p(unsigned long port) |
103 | { | 96 | { |
104 | unsigned short w; | 97 | unsigned short v = _inw(port); |
105 | 98 | delay(); | |
106 | if (port >= CFC_IOSTART && port <= CFC_IOEND) { | 99 | return v; |
107 | pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); | ||
108 | return w; | ||
109 | } else { | ||
110 | w = *(volatile unsigned short *)PORT2ADDR(port); | ||
111 | delay(); | ||
112 | return w; | ||
113 | } | ||
114 | } | 100 | } |
115 | 101 | ||
116 | unsigned long _inl_p(unsigned long port) | 102 | unsigned long _inl_p(unsigned long port) |
117 | { | 103 | { |
118 | unsigned long v; | 104 | unsigned long v = _inl(port); |
119 | |||
120 | v = *(volatile unsigned long *)PORT2ADDR(port); | ||
121 | delay(); | 105 | delay(); |
122 | |||
123 | return v; | 106 | return v; |
124 | } | 107 | } |
125 | 108 | ||
@@ -149,25 +132,19 @@ void _outl(unsigned long l, unsigned long port) | |||
149 | 132 | ||
150 | void _outb_p(unsigned char b, unsigned long port) | 133 | void _outb_p(unsigned char b, unsigned long port) |
151 | { | 134 | { |
152 | if (port >= CFC_IOSTART && port <= CFC_IOEND) | 135 | _outb(b, port); |
153 | pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); | ||
154 | else | ||
155 | *(volatile unsigned char *)PORT2ADDR(port) = b; | ||
156 | delay(); | 136 | delay(); |
157 | } | 137 | } |
158 | 138 | ||
159 | void _outw_p(unsigned short w, unsigned long port) | 139 | void _outw_p(unsigned short w, unsigned long port) |
160 | { | 140 | { |
161 | if (port >= CFC_IOSTART && port <= CFC_IOEND) | 141 | _outw(w, port); |
162 | pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); | ||
163 | else | ||
164 | *(volatile unsigned short *)PORT2ADDR(port) = w; | ||
165 | delay(); | 142 | delay(); |
166 | } | 143 | } |
167 | 144 | ||
168 | void _outl_p(unsigned long l, unsigned long port) | 145 | void _outl_p(unsigned long l, unsigned long port) |
169 | { | 146 | { |
170 | *(volatile unsigned long *)PORT2ADDR(port) = l; | 147 | _outl(l, port); |
171 | delay(); | 148 | delay(); |
172 | } | 149 | } |
173 | 150 | ||