diff options
Diffstat (limited to 'arch/m32r/kernel')
-rw-r--r-- | arch/m32r/kernel/io_opsput.c | 71 | ||||
-rw-r--r-- | arch/m32r/kernel/setup_opsput.c | 17 |
2 files changed, 76 insertions, 12 deletions
diff --git a/arch/m32r/kernel/io_opsput.c b/arch/m32r/kernel/io_opsput.c index da6c5f5c1f82..3cbb1f717e50 100644 --- a/arch/m32r/kernel/io_opsput.c +++ b/arch/m32r/kernel/io_opsput.c | |||
@@ -30,14 +30,34 @@ extern void pcc_iowrite_byte(int, unsigned long, void *, size_t, size_t, int); | |||
30 | extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); | 30 | extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); |
31 | #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ | 31 | #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ |
32 | 32 | ||
33 | #define PORT2ADDR(port) _port2addr(port) | 33 | #define PORT2ADDR(port) _port2addr(port) |
34 | #define PORT2ADDR_USB(port) _port2addr_usb(port) | 34 | #define PORT2ADDR_USB(port) _port2addr_usb(port) |
35 | 35 | ||
36 | static inline void *_port2addr(unsigned long port) | 36 | static inline void *_port2addr(unsigned long port) |
37 | { | 37 | { |
38 | return (void *)(port | NONCACHE_OFFSET); | 38 | return (void *)(port | NONCACHE_OFFSET); |
39 | } | 39 | } |
40 | 40 | ||
41 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
42 | static inline void *__port2addr_ata(unsigned long port) | ||
43 | { | ||
44 | static int dummy_reg; | ||
45 | |||
46 | switch (port) { | ||
47 | case 0x1f0: return (void *)(0x0c002000 | NONCACHE_OFFSET); | ||
48 | case 0x1f1: return (void *)(0x0c012800 | NONCACHE_OFFSET); | ||
49 | case 0x1f2: return (void *)(0x0c012002 | NONCACHE_OFFSET); | ||
50 | case 0x1f3: return (void *)(0x0c012802 | NONCACHE_OFFSET); | ||
51 | case 0x1f4: return (void *)(0x0c012004 | NONCACHE_OFFSET); | ||
52 | case 0x1f5: return (void *)(0x0c012804 | NONCACHE_OFFSET); | ||
53 | case 0x1f6: return (void *)(0x0c012006 | NONCACHE_OFFSET); | ||
54 | case 0x1f7: return (void *)(0x0c012806 | NONCACHE_OFFSET); | ||
55 | case 0x3f6: return (void *)(0x0c01200e | NONCACHE_OFFSET); | ||
56 | default: return (void *)&dummy_reg; | ||
57 | } | ||
58 | } | ||
59 | #endif | ||
60 | |||
41 | /* | 61 | /* |
42 | * OPSPUT-LAN is located in the extended bus space | 62 | * OPSPUT-LAN is located in the extended bus space |
43 | * from 0x10000000 to 0x13ffffff on physical address. | 63 | * from 0x10000000 to 0x13ffffff on physical address. |
@@ -97,6 +117,12 @@ unsigned char _inb(unsigned long port) | |||
97 | { | 117 | { |
98 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 118 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
99 | return _ne_inb(PORT2ADDR_NE(port)); | 119 | return _ne_inb(PORT2ADDR_NE(port)); |
120 | |||
121 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
122 | else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
123 | return *(volatile unsigned char *)__port2addr_ata(port); | ||
124 | } | ||
125 | #endif | ||
100 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 126 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
101 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 127 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
102 | unsigned char b; | 128 | unsigned char b; |
@@ -112,6 +138,11 @@ unsigned short _inw(unsigned long port) | |||
112 | { | 138 | { |
113 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 139 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
114 | return _ne_inw(PORT2ADDR_NE(port)); | 140 | return _ne_inw(PORT2ADDR_NE(port)); |
141 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
142 | else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
143 | return *(volatile unsigned short *)__port2addr_ata(port); | ||
144 | } | ||
145 | #endif | ||
115 | #if defined(CONFIG_USB) | 146 | #if defined(CONFIG_USB) |
116 | else if(port >= 0x340 && port < 0x3a0) | 147 | else if(port >= 0x340 && port < 0x3a0) |
117 | return *(volatile unsigned short *)PORT2ADDR_USB(port); | 148 | return *(volatile unsigned short *)PORT2ADDR_USB(port); |
@@ -164,6 +195,11 @@ void _outb(unsigned char b, unsigned long port) | |||
164 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 195 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
165 | _ne_outb(b, PORT2ADDR_NE(port)); | 196 | _ne_outb(b, PORT2ADDR_NE(port)); |
166 | else | 197 | else |
198 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
199 | if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
200 | *(volatile unsigned char *)__port2addr_ata(port) = b; | ||
201 | } else | ||
202 | #endif | ||
167 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 203 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
168 | if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 204 | if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
169 | pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); | 205 | pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); |
@@ -177,6 +213,11 @@ void _outw(unsigned short w, unsigned long port) | |||
177 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 213 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
178 | _ne_outw(w, PORT2ADDR_NE(port)); | 214 | _ne_outw(w, PORT2ADDR_NE(port)); |
179 | else | 215 | else |
216 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
217 | if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
218 | *(volatile unsigned short *)__port2addr_ata(port) = w; | ||
219 | } else | ||
220 | #endif | ||
180 | #if defined(CONFIG_USB) | 221 | #if defined(CONFIG_USB) |
181 | if(port >= 0x340 && port < 0x3a0) | 222 | if(port >= 0x340 && port < 0x3a0) |
182 | *(volatile unsigned short *)PORT2ADDR_USB(port) = w; | 223 | *(volatile unsigned short *)PORT2ADDR_USB(port) = w; |
@@ -222,6 +263,14 @@ void _insb(unsigned int port, void *addr, unsigned long count) | |||
222 | { | 263 | { |
223 | if (port >= LAN_IOSTART && port < LAN_IOEND) | 264 | if (port >= LAN_IOSTART && port < LAN_IOEND) |
224 | _ne_insb(PORT2ADDR_NE(port), addr, count); | 265 | _ne_insb(PORT2ADDR_NE(port), addr, count); |
266 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
267 | else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
268 | unsigned char *buf = addr; | ||
269 | unsigned char *portp = __port2addr_ata(port); | ||
270 | while (count--) | ||
271 | *buf++ = *(volatile unsigned char *)portp; | ||
272 | } | ||
273 | #endif | ||
225 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 274 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
226 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 275 | else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
227 | pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), | 276 | pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), |
@@ -254,6 +303,12 @@ void _insw(unsigned int port, void *addr, unsigned long count) | |||
254 | pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), | 303 | pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), |
255 | count, 1); | 304 | count, 1); |
256 | #endif | 305 | #endif |
306 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
307 | } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
308 | portp = __port2addr_ata(port); | ||
309 | while (count--) | ||
310 | *buf++ = *(volatile unsigned short *)portp; | ||
311 | #endif | ||
257 | } else { | 312 | } else { |
258 | portp = PORT2ADDR(port); | 313 | portp = PORT2ADDR(port); |
259 | while (count--) | 314 | while (count--) |
@@ -280,6 +335,12 @@ void _outsb(unsigned int port, const void *addr, unsigned long count) | |||
280 | portp = PORT2ADDR_NE(port); | 335 | portp = PORT2ADDR_NE(port); |
281 | while (count--) | 336 | while (count--) |
282 | _ne_outb(*buf++, portp); | 337 | _ne_outb(*buf++, portp); |
338 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
339 | } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
340 | portp = __port2addr_ata(port); | ||
341 | while (count--) | ||
342 | *(volatile unsigned char *)portp = *buf++; | ||
343 | #endif | ||
283 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 344 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
284 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 345 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
285 | pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), | 346 | pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), |
@@ -305,6 +366,12 @@ void _outsw(unsigned int port, const void *addr, unsigned long count) | |||
305 | portp = PORT2ADDR_NE(port); | 366 | portp = PORT2ADDR_NE(port); |
306 | while (count--) | 367 | while (count--) |
307 | *(volatile unsigned short *)portp = *buf++; | 368 | *(volatile unsigned short *)portp = *buf++; |
369 | #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) | ||
370 | } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { | ||
371 | portp = __port2addr_ata(port); | ||
372 | while (count--) | ||
373 | *(volatile unsigned short *)portp = *buf++; | ||
374 | #endif | ||
308 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) | 375 | #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) |
309 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { | 376 | } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { |
310 | pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), | 377 | pcc_iowrite_word(9, port, (void *)addr, sizeof(unsigned short), |
diff --git a/arch/m32r/kernel/setup_opsput.c b/arch/m32r/kernel/setup_opsput.c index 61d3b01cbe07..62d6b71de45f 100644 --- a/arch/m32r/kernel/setup_opsput.c +++ b/arch/m32r/kernel/setup_opsput.c | |||
@@ -218,13 +218,13 @@ static void shutdown_opsput_lanpld_irq(unsigned int irq) | |||
218 | 218 | ||
219 | static struct hw_interrupt_type opsput_lanpld_irq_type = | 219 | static struct hw_interrupt_type opsput_lanpld_irq_type = |
220 | { | 220 | { |
221 | "OPSPUT-PLD-LAN-IRQ", | 221 | .typename = "OPSPUT-PLD-LAN-IRQ", |
222 | startup_opsput_lanpld_irq, | 222 | .startup = startup_opsput_lanpld_irq, |
223 | shutdown_opsput_lanpld_irq, | 223 | .shutdown = shutdown_opsput_lanpld_irq, |
224 | enable_opsput_lanpld_irq, | 224 | .enable = enable_opsput_lanpld_irq, |
225 | disable_opsput_lanpld_irq, | 225 | .disable = disable_opsput_lanpld_irq, |
226 | mask_and_ack_opsput_lanpld, | 226 | .ack = mask_and_ack_opsput_lanpld, |
227 | end_opsput_lanpld_irq | 227 | .end = end_opsput_lanpld_irq |
228 | }; | 228 | }; |
229 | 229 | ||
230 | /* | 230 | /* |
@@ -374,7 +374,6 @@ void __init init_IRQ(void) | |||
374 | disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); | 374 | disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); |
375 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ | 375 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ |
376 | 376 | ||
377 | #if defined(CONFIG_M32R_CFC) | ||
378 | /* INT#1: CFC IREQ on PLD */ | 377 | /* INT#1: CFC IREQ on PLD */ |
379 | irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; | 378 | irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; |
380 | irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; | 379 | irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; |
@@ -398,8 +397,6 @@ void __init init_IRQ(void) | |||
398 | irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ | 397 | irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ |
399 | pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ | 398 | pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ |
400 | disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); | 399 | disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); |
401 | #endif /* CONFIG_M32R_CFC */ | ||
402 | |||
403 | 400 | ||
404 | /* | 401 | /* |
405 | * INT0# is used for LAN, DIO | 402 | * INT0# is used for LAN, DIO |