aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/se/770x/io.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2006-09-27 02:41:24 -0400
committerPaul Mundt <lethal@linux-sh.org>2006-09-27 02:41:24 -0400
commit373e68b5472d421cbd2703e7a77caf053f78c005 (patch)
tree6fed51fdf1b89f80a1ec9ea4aab285c1af649945 /arch/sh/boards/se/770x/io.c
parentf647d33f879d258de4ab2559975bd6eebda2033e (diff)
sh: Board updates for I/O routine rework.
This updates the various boards for some of the recent I/O routine updates. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards/se/770x/io.c')
-rw-r--r--arch/sh/boards/se/770x/io.c52
1 files changed, 8 insertions, 44 deletions
diff --git a/arch/sh/boards/se/770x/io.c b/arch/sh/boards/se/770x/io.c
index 9a39ee963143..5102201c97ab 100644
--- a/arch/sh/boards/se/770x/io.c
+++ b/arch/sh/boards/se/770x/io.c
@@ -1,4 +1,4 @@
1/* $Id: io.c,v 1.5 2004/02/22 23:08:43 kkojima Exp $ 1/* $Id: io.c,v 1.6 2006/01/04 17:53:54 lethal Exp $
2 * 2 *
3 * linux/arch/sh/kernel/io_se.c 3 * linux/arch/sh/kernel/io_se.c
4 * 4 *
@@ -11,7 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <asm/io.h> 13#include <asm/io.h>
14#include <asm/se/se.h> 14#include <asm/se.h>
15 15
16/* SH pcmcia io window base, start and end. */ 16/* SH pcmcia io window base, start and end. */
17int sh_pcic_io_wbase = 0xb8400000; 17int sh_pcic_io_wbase = 0xb8400000;
@@ -52,10 +52,6 @@ shifted_port(unsigned long port)
52 return 1; 52 return 1;
53} 53}
54 54
55#define maybebadio(name,port) \
56 printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \
57 #name, (port), (__u32) __builtin_return_address(0))
58
59unsigned char se_inb(unsigned long port) 55unsigned char se_inb(unsigned long port)
60{ 56{
61 if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop) 57 if (sh_pcic_io_start <= port && port <= sh_pcic_io_stop)
@@ -86,13 +82,13 @@ unsigned short se_inw(unsigned long port)
86 (sh_pcic_io_start <= port && port <= sh_pcic_io_stop)) 82 (sh_pcic_io_start <= port && port <= sh_pcic_io_stop))
87 return *port2adr(port); 83 return *port2adr(port);
88 else 84 else
89 maybebadio(inw, port); 85 maybebadio(port);
90 return 0; 86 return 0;
91} 87}
92 88
93unsigned int se_inl(unsigned long port) 89unsigned int se_inl(unsigned long port)
94{ 90{
95 maybebadio(inl, port); 91 maybebadio(port);
96 return 0; 92 return 0;
97} 93}
98 94
@@ -123,12 +119,12 @@ void se_outw(unsigned short value, unsigned long port)
123 (sh_pcic_io_start <= port && port <= sh_pcic_io_stop)) 119 (sh_pcic_io_start <= port && port <= sh_pcic_io_stop))
124 *port2adr(port) = value; 120 *port2adr(port) = value;
125 else 121 else
126 maybebadio(outw, port); 122 maybebadio(port);
127} 123}
128 124
129void se_outl(unsigned int value, unsigned long port) 125void se_outl(unsigned int value, unsigned long port)
130{ 126{
131 maybebadio(outl, port); 127 maybebadio(port);
132} 128}
133 129
134void se_insb(unsigned long port, void *addr, unsigned long count) 130void se_insb(unsigned long port, void *addr, unsigned long count)
@@ -159,7 +155,7 @@ void se_insw(unsigned long port, void *addr, unsigned long count)
159 155
160void se_insl(unsigned long port, void *addr, unsigned long count) 156void se_insl(unsigned long port, void *addr, unsigned long count)
161{ 157{
162 maybebadio(insl, port); 158 maybebadio(port);
163} 159}
164 160
165void se_outsb(unsigned long port, const void *addr, unsigned long count) 161void se_outsb(unsigned long port, const void *addr, unsigned long count)
@@ -190,37 +186,5 @@ void se_outsw(unsigned long port, const void *addr, unsigned long count)
190 186
191void se_outsl(unsigned long port, const void *addr, unsigned long count) 187void se_outsl(unsigned long port, const void *addr, unsigned long count)
192{ 188{
193 maybebadio(outsw, port); 189 maybebadio(port);
194}
195
196/* Map ISA bus address to the real address. Only for PCMCIA. */
197
198/* ISA page descriptor. */
199static __u32 sh_isa_memmap[256];
200
201static int
202sh_isa_mmap(__u32 start, __u32 length, __u32 offset)
203{
204 int idx;
205
206 if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000))
207 return -1;
208
209 idx = start >> 12;
210 sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff);
211#if 0
212 printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n",
213 start, length, offset, idx, sh_isa_memmap[idx]);
214#endif
215 return 0;
216}
217
218unsigned long
219se_isa_port2addr(unsigned long offset)
220{
221 int idx;
222
223 idx = (offset >> 12) & 0xff;
224 offset &= 0xfff;
225 return sh_isa_memmap[idx] + offset;
226} 190}