aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel/io_m32700ut.c
diff options
context:
space:
mode:
authorHirokazu Takata <takata@linux-m32r.org>2005-06-21 20:16:10 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-21 22:07:30 -0400
commit2368086344c3d67b0f4aecac39d620fb9b8795c3 (patch)
treeaa55003e311abf6049acd23f5ff7f8bfd24eca4c /arch/m32r/kernel/io_m32700ut.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_m32700ut.c')
-rw-r--r--arch/m32r/kernel/io_m32700ut.c92
1 files changed, 8 insertions, 84 deletions
diff --git a/arch/m32r/kernel/io_m32700ut.c b/arch/m32r/kernel/io_m32700ut.c
index 371ba904e968..e545b065f7e9 100644
--- a/arch/m32r/kernel/io_m32700ut.c
+++ b/arch/m32r/kernel/io_m32700ut.c
@@ -3,8 +3,8 @@
3 * 3 *
4 * Typical I/O routines for M32700UT board. 4 * Typical I/O routines for M32700UT board.
5 * 5 *
6 * Copyright (c) 2001, 2002 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
@@ -172,64 +172,21 @@ unsigned long _inl(unsigned long port)
172 172
173unsigned char _inb_p(unsigned long port) 173unsigned char _inb_p(unsigned long port)
174{ 174{
175 unsigned char v; 175 unsigned char v = _inb(port);
176
177 if (port >= LAN_IOSTART && port < LAN_IOEND)
178 v = _ne_inb(PORT2ADDR_NE(port));
179 else
180#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
181 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
182 return *(volatile unsigned char *)__port2addr_ata(port);
183 } else
184#endif
185#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
186 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
187 unsigned char b;
188 pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0);
189 return b;
190 } else
191#endif
192 v = *(volatile unsigned char *)PORT2ADDR(port);
193
194 delay(); 176 delay();
195 return (v); 177 return (v);
196} 178}
197 179
198unsigned short _inw_p(unsigned long port) 180unsigned short _inw_p(unsigned long port)
199{ 181{
200 unsigned short v; 182 unsigned short v = _inw(port);
201
202 if (port >= LAN_IOSTART && port < LAN_IOEND)
203 v = _ne_inw(PORT2ADDR_NE(port));
204 else
205#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
206 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
207 return *(volatile unsigned short *)__port2addr_ata(port);
208 } else
209#endif
210#if defined(CONFIG_USB)
211 if(port >= 0x340 && port < 0x3a0)
212 return *(volatile unsigned short *)PORT2ADDR_USB(port);
213 else
214#endif
215#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
216 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
217 unsigned short w;
218 pcc_ioread_word(0, port, &w, sizeof(w), 1, 0);
219 return w;
220 } else
221#endif
222 v = *(volatile unsigned short *)PORT2ADDR(port);
223
224 delay(); 183 delay();
225 return (v); 184 return (v);
226} 185}
227 186
228unsigned long _inl_p(unsigned long port) 187unsigned long _inl_p(unsigned long port)
229{ 188{
230 unsigned long v; 189 unsigned long v = _inl(port);
231
232 v = *(volatile unsigned long *)PORT2ADDR(port);
233 delay(); 190 delay();
234 return (v); 191 return (v);
235} 192}
@@ -287,52 +244,19 @@ void _outl(unsigned long l, unsigned long port)
287 244
288void _outb_p(unsigned char b, unsigned long port) 245void _outb_p(unsigned char b, unsigned long port)
289{ 246{
290 if (port >= LAN_IOSTART && port < LAN_IOEND) 247 _outb(b, port);
291 _ne_outb(b, PORT2ADDR_NE(port));
292 else
293#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
294 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
295 *(volatile unsigned char *)__port2addr_ata(port) = b;
296 } else
297#endif
298#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
299 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
300 pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0);
301 } else
302#endif
303 *(volatile unsigned char *)PORT2ADDR(port) = b;
304
305 delay(); 248 delay();
306} 249}
307 250
308void _outw_p(unsigned short w, unsigned long port) 251void _outw_p(unsigned short w, unsigned long port)
309{ 252{
310 if (port >= LAN_IOSTART && port < LAN_IOEND) 253 _outw(w, port);
311 _ne_outw(w, PORT2ADDR_NE(port));
312 else
313#if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC)
314 if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) {
315 *(volatile unsigned short *)__port2addr_ata(port) = w;
316 } else
317#endif
318#if defined(CONFIG_USB)
319 if(port >= 0x340 && port < 0x3a0)
320 *(volatile unsigned short *)PORT2ADDR_USB(port) = w;
321 else
322#endif
323#if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC)
324 if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) {
325 pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0);
326 } else
327#endif
328 *(volatile unsigned short *)PORT2ADDR(port) = w;
329
330 delay(); 254 delay();
331} 255}
332 256
333void _outl_p(unsigned long l, unsigned long port) 257void _outl_p(unsigned long l, unsigned long port)
334{ 258{
335 *(volatile unsigned long *)PORT2ADDR(port) = l; 259 _outl(l, port);
336 delay(); 260 delay();
337} 261}
338 262