diff options
author | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 02:41:24 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 02:41:24 -0400 |
commit | 373e68b5472d421cbd2703e7a77caf053f78c005 (patch) | |
tree | 6fed51fdf1b89f80a1ec9ea4aab285c1af649945 /arch/sh/boards/renesas/systemh | |
parent | f647d33f879d258de4ab2559975bd6eebda2033e (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/renesas/systemh')
-rw-r--r-- | arch/sh/boards/renesas/systemh/io.c | 96 | ||||
-rw-r--r-- | arch/sh/boards/renesas/systemh/irq.c | 2 | ||||
-rw-r--r-- | arch/sh/boards/renesas/systemh/setup.c | 14 |
3 files changed, 11 insertions, 101 deletions
diff --git a/arch/sh/boards/renesas/systemh/io.c b/arch/sh/boards/renesas/systemh/io.c index 85511576d414..0befd4f9894c 100644 --- a/arch/sh/boards/renesas/systemh/io.c +++ b/arch/sh/boards/renesas/systemh/io.c | |||
@@ -10,11 +10,10 @@ | |||
10 | 10 | ||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <asm/systemh/7751systemh.h> | 13 | #include <linux/pci.h> |
14 | #include <asm/systemh7751.h> | ||
14 | #include <asm/addrspace.h> | 15 | #include <asm/addrspace.h> |
15 | #include <asm/io.h> | 16 | #include <asm/io.h> |
16 | |||
17 | #include <linux/pci.h> | ||
18 | #include "../../../drivers/pci/pci-sh7751.h" | 17 | #include "../../../drivers/pci/pci-sh7751.h" |
19 | 18 | ||
20 | /* | 19 | /* |
@@ -31,11 +30,6 @@ | |||
31 | #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK)) | 30 | #define PCI_IOMAP(adr) (PCI_IO_AREA + (adr & ~SH7751_PCIIOBR_MASK)) |
32 | #define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area | 31 | #define ETHER_IOMAP(adr) (0xB3000000 + (adr)) /*map to 16bits access area |
33 | of smc lan chip*/ | 32 | of smc lan chip*/ |
34 | |||
35 | #define maybebadio(name,port) \ | ||
36 | printk("bad PC-like io %s for port 0x%lx at 0x%08x\n", \ | ||
37 | #name, (port), (__u32) __builtin_return_address(0)) | ||
38 | |||
39 | static inline void delay(void) | 33 | static inline void delay(void) |
40 | { | 34 | { |
41 | ctrl_inw(0xa0000000); | 35 | ctrl_inw(0xa0000000); |
@@ -46,11 +40,7 @@ port2adr(unsigned int port) | |||
46 | { | 40 | { |
47 | if (port >= 0x2000) | 41 | if (port >= 0x2000) |
48 | return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); | 42 | return (volatile __u16 *) (PA_MRSHPC + (port - 0x2000)); |
49 | #if 0 | 43 | maybebadio((unsigned long)port); |
50 | else | ||
51 | return (volatile __u16 *) (PA_SUPERIO + (port << 1)); | ||
52 | #endif | ||
53 | maybebadio(name,(unsigned long)port); | ||
54 | return (volatile __u16*)port; | 44 | return (volatile __u16*)port; |
55 | } | 45 | } |
56 | 46 | ||
@@ -111,7 +101,7 @@ unsigned short sh7751systemh_inw(unsigned long port) | |||
111 | else if (port <= 0x3F1) | 101 | else if (port <= 0x3F1) |
112 | return *(volatile unsigned int *)ETHER_IOMAP(port); | 102 | return *(volatile unsigned int *)ETHER_IOMAP(port); |
113 | else | 103 | else |
114 | maybebadio(inw, port); | 104 | maybebadio(port); |
115 | return 0; | 105 | return 0; |
116 | } | 106 | } |
117 | 107 | ||
@@ -126,7 +116,7 @@ unsigned int sh7751systemh_inl(unsigned long port) | |||
126 | else if (port <= 0x3F1) | 116 | else if (port <= 0x3F1) |
127 | return *(volatile unsigned int *)ETHER_IOMAP(port); | 117 | return *(volatile unsigned int *)ETHER_IOMAP(port); |
128 | else | 118 | else |
129 | maybebadio(inl, port); | 119 | maybebadio(port); |
130 | return 0; | 120 | return 0; |
131 | } | 121 | } |
132 | 122 | ||
@@ -167,7 +157,7 @@ void sh7751systemh_outw(unsigned short value, unsigned long port) | |||
167 | else if (port <= 0x3F1) | 157 | else if (port <= 0x3F1) |
168 | *(volatile unsigned short *)ETHER_IOMAP(port) = value; | 158 | *(volatile unsigned short *)ETHER_IOMAP(port) = value; |
169 | else | 159 | else |
170 | maybebadio(outw, port); | 160 | maybebadio(port); |
171 | } | 161 | } |
172 | 162 | ||
173 | void sh7751systemh_outl(unsigned int value, unsigned long port) | 163 | void sh7751systemh_outl(unsigned int value, unsigned long port) |
@@ -177,7 +167,7 @@ void sh7751systemh_outl(unsigned int value, unsigned long port) | |||
177 | else if (CHECK_SH7751_PCIIO(port)) | 167 | else if (CHECK_SH7751_PCIIO(port)) |
178 | *((unsigned long*)PCI_IOMAP(port)) = value; | 168 | *((unsigned long*)PCI_IOMAP(port)) = value; |
179 | else | 169 | else |
180 | maybebadio(outl, port); | 170 | maybebadio(port); |
181 | } | 171 | } |
182 | 172 | ||
183 | void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count) | 173 | void sh7751systemh_insb(unsigned long port, void *addr, unsigned long count) |
@@ -194,7 +184,7 @@ void sh7751systemh_insw(unsigned long port, void *addr, unsigned long count) | |||
194 | 184 | ||
195 | void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count) | 185 | void sh7751systemh_insl(unsigned long port, void *addr, unsigned long count) |
196 | { | 186 | { |
197 | maybebadio(insl, port); | 187 | maybebadio(port); |
198 | } | 188 | } |
199 | 189 | ||
200 | void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count) | 190 | void sh7751systemh_outsb(unsigned long port, const void *addr, unsigned long count) |
@@ -211,73 +201,5 @@ void sh7751systemh_outsw(unsigned long port, const void *addr, unsigned long cou | |||
211 | 201 | ||
212 | void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count) | 202 | void sh7751systemh_outsl(unsigned long port, const void *addr, unsigned long count) |
213 | { | 203 | { |
214 | maybebadio(outsw, port); | 204 | maybebadio(port); |
215 | } | ||
216 | |||
217 | /* For read/write calls, just copy generic (pass-thru); PCIMBR is */ | ||
218 | /* already set up. For a larger memory space, these would need to */ | ||
219 | /* reset PCIMBR as needed on a per-call basis... */ | ||
220 | |||
221 | unsigned char sh7751systemh_readb(unsigned long addr) | ||
222 | { | ||
223 | return *(volatile unsigned char*)addr; | ||
224 | } | ||
225 | |||
226 | unsigned short sh7751systemh_readw(unsigned long addr) | ||
227 | { | ||
228 | return *(volatile unsigned short*)addr; | ||
229 | } | ||
230 | |||
231 | unsigned int sh7751systemh_readl(unsigned long addr) | ||
232 | { | ||
233 | return *(volatile unsigned long*)addr; | ||
234 | } | ||
235 | |||
236 | void sh7751systemh_writeb(unsigned char b, unsigned long addr) | ||
237 | { | ||
238 | *(volatile unsigned char*)addr = b; | ||
239 | } | ||
240 | |||
241 | void sh7751systemh_writew(unsigned short b, unsigned long addr) | ||
242 | { | ||
243 | *(volatile unsigned short*)addr = b; | ||
244 | } | ||
245 | |||
246 | void sh7751systemh_writel(unsigned int b, unsigned long addr) | ||
247 | { | ||
248 | *(volatile unsigned long*)addr = b; | ||
249 | } | ||
250 | |||
251 | |||
252 | |||
253 | /* Map ISA bus address to the real address. Only for PCMCIA. */ | ||
254 | |||
255 | /* ISA page descriptor. */ | ||
256 | static __u32 sh_isa_memmap[256]; | ||
257 | |||
258 | #if 0 | ||
259 | static int | ||
260 | sh_isa_mmap(__u32 start, __u32 length, __u32 offset) | ||
261 | { | ||
262 | int idx; | ||
263 | |||
264 | if (start >= 0x100000 || (start & 0xfff) || (length != 0x1000)) | ||
265 | return -1; | ||
266 | |||
267 | idx = start >> 12; | ||
268 | sh_isa_memmap[idx] = 0xb8000000 + (offset &~ 0xfff); | ||
269 | printk("sh_isa_mmap: start %x len %x offset %x (idx %x paddr %x)\n", | ||
270 | start, length, offset, idx, sh_isa_memmap[idx]); | ||
271 | return 0; | ||
272 | } | ||
273 | #endif | ||
274 | |||
275 | unsigned long | ||
276 | sh7751systemh_isa_port2addr(unsigned long offset) | ||
277 | { | ||
278 | int idx; | ||
279 | |||
280 | idx = (offset >> 12) & 0xff; | ||
281 | offset &= 0xfff; | ||
282 | return sh_isa_memmap[idx] + offset; | ||
283 | } | 205 | } |
diff --git a/arch/sh/boards/renesas/systemh/irq.c b/arch/sh/boards/renesas/systemh/irq.c index 8372d967f601..53731a0abb8f 100644 --- a/arch/sh/boards/renesas/systemh/irq.c +++ b/arch/sh/boards/renesas/systemh/irq.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/hdreg.h> | 15 | #include <linux/hdreg.h> |
16 | #include <linux/ide.h> | 16 | #include <linux/ide.h> |
17 | #include <asm/io.h> | 17 | #include <asm/io.h> |
18 | #include <asm/mach/7751systemh.h> | 18 | #include <asm/systemh7751.h> |
19 | #include <asm/smc37c93x.h> | 19 | #include <asm/smc37c93x.h> |
20 | 20 | ||
21 | /* address of external interrupt mask register | 21 | /* address of external interrupt mask register |
diff --git a/arch/sh/boards/renesas/systemh/setup.c b/arch/sh/boards/renesas/systemh/setup.c index 826fa3d7669c..433c7c3f35e2 100644 --- a/arch/sh/boards/renesas/systemh/setup.c +++ b/arch/sh/boards/renesas/systemh/setup.c | |||
@@ -15,9 +15,8 @@ | |||
15 | * for more details. | 15 | * for more details. |
16 | */ | 16 | */ |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <asm/mach/7751systemh.h> | ||
19 | #include <asm/mach/io.h> | ||
20 | #include <asm/machvec.h> | 18 | #include <asm/machvec.h> |
19 | #include <asm/systemh7751.h> | ||
21 | 20 | ||
22 | extern void make_systemh_irq(unsigned int irq); | 21 | extern void make_systemh_irq(unsigned int irq); |
23 | 22 | ||
@@ -31,8 +30,6 @@ const char *get_system_type(void) | |||
31 | */ | 30 | */ |
32 | void __init init_7751systemh_IRQ(void) | 31 | void __init init_7751systemh_IRQ(void) |
33 | { | 32 | { |
34 | /* make_ipr_irq(10, BCR_ILCRD, 1, 0x0f-10); LAN */ | ||
35 | /* make_ipr_irq(14, BCR_ILCRA, 2, 0x0f-4); */ | ||
36 | make_systemh_irq(0xb); /* Ethernet interrupt */ | 33 | make_systemh_irq(0xb); /* Ethernet interrupt */ |
37 | } | 34 | } |
38 | 35 | ||
@@ -60,15 +57,6 @@ struct sh_machine_vector mv_7751systemh __initmv = { | |||
60 | .mv_outsw = sh7751systemh_outsw, | 57 | .mv_outsw = sh7751systemh_outsw, |
61 | .mv_outsl = sh7751systemh_outsl, | 58 | .mv_outsl = sh7751systemh_outsl, |
62 | 59 | ||
63 | .mv_readb = sh7751systemh_readb, | ||
64 | .mv_readw = sh7751systemh_readw, | ||
65 | .mv_readl = sh7751systemh_readl, | ||
66 | .mv_writeb = sh7751systemh_writeb, | ||
67 | .mv_writew = sh7751systemh_writew, | ||
68 | .mv_writel = sh7751systemh_writel, | ||
69 | |||
70 | .mv_isa_port2addr = sh7751systemh_isa_port2addr, | ||
71 | |||
72 | .mv_init_irq = init_7751systemh_IRQ, | 60 | .mv_init_irq = init_7751systemh_IRQ, |
73 | }; | 61 | }; |
74 | ALIAS_MV(7751systemh) | 62 | ALIAS_MV(7751systemh) |