m32r: Rearrange platform-dependent codes

Rearrange platform-dependent codes from arch/m32r/kernel/*.c
to arch/m32r/platforms/{platform}/.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>

+698 -689
+2 -1
arch/m32r/Makefile
··· 36 36 libs-y += arch/m32r/lib/ $(LIBGCC) 37 37 core-y += arch/m32r/kernel/ \ 38 38 arch/m32r/mm/ \ 39 - arch/m32r/boot/ 39 + arch/m32r/boot/ \ 40 + arch/m32r/platforms/ 40 41 41 42 drivers-$(CONFIG_OPROFILE) += arch/m32r/oprofile/ 42 43
-8
arch/m32r/kernel/Makefile
··· 8 8 m32r_ksyms.o sys_m32r.o semaphore.o signal.o ptrace.o 9 9 10 10 obj-$(CONFIG_SMP) += smp.o smpboot.o 11 - obj-$(CONFIG_PLAT_MAPPI) += setup_mappi.o io_mappi.o 12 - obj-$(CONFIG_PLAT_MAPPI2) += setup_mappi2.o io_mappi2.o 13 - obj-$(CONFIG_PLAT_MAPPI3) += setup_mappi3.o io_mappi3.o 14 - obj-$(CONFIG_PLAT_USRV) += setup_usrv.o io_usrv.o 15 - obj-$(CONFIG_PLAT_M32700UT) += setup_m32700ut.o io_m32700ut.o 16 - obj-$(CONFIG_PLAT_OPSPUT) += setup_opsput.o io_opsput.o 17 11 obj-$(CONFIG_MODULES) += module.o 18 - obj-$(CONFIG_PLAT_OAKS32R) += setup_oaks32r.o io_oaks32r.o 19 - obj-$(CONFIG_PLAT_M32104UT) += setup_m32104ut.o io_m32104ut.o 20 12 21 13 EXTRA_AFLAGS := -traditional
+107 -9
arch/m32r/kernel/io_m32104ut.c arch/m32r/platforms/opsput/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_m32104ut.c 2 + * linux/arch/m32r/platforms/opsput/io.c 3 3 * 4 - * Typical I/O routines for M32104UT board. 4 + * Typical I/O routines for OPSPUT board. 5 5 * 6 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, 7 - * Hitoshi Yamamoto, Mamoru Sakugawa, 8 - * Naoto Sugai, Hayato Fujiwara 7 + * Hitoshi Yamamoto, Takeo Takahashi 8 + * 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 11 + * archive for more details. 9 12 */ 10 13 11 14 #include <asm/m32r.h> ··· 30 27 extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); 31 28 #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ 32 29 33 - #define PORT2ADDR(port) _port2addr(port) 30 + #define PORT2ADDR(port) _port2addr(port) 31 + #define PORT2ADDR_USB(port) _port2addr_usb(port) 34 32 35 33 static inline void *_port2addr(unsigned long port) 36 34 { ··· 59 55 #endif 60 56 61 57 /* 62 - * M32104T-LAN is located in the extended bus space 63 - * from 0x01000000 to 0x01ffffff on physical address. 58 + * OPSPUT-LAN is located in the extended bus space 59 + * from 0x10000000 to 0x13ffffff on physical address. 64 60 * The base address of LAN controller(LAN91C111) is 0x300. 65 61 */ 66 62 #define LAN_IOSTART (0x300 | NONCACHE_OFFSET) 67 63 #define LAN_IOEND (0x320 | NONCACHE_OFFSET) 68 64 static inline void *_port2addr_ne(unsigned long port) 69 65 { 70 - return (void *)(port + NONCACHE_OFFSET + 0x01000000); 66 + return (void *)(port + 0x10000000); 67 + } 68 + static inline void *_port2addr_usb(unsigned long port) 69 + { 70 + return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); 71 71 } 72 72 73 73 static inline void delay(void) ··· 118 110 if (port >= LAN_IOSTART && port < LAN_IOEND) 119 111 return _ne_inb(PORT2ADDR_NE(port)); 120 112 113 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 114 + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 115 + return *(volatile unsigned char *)__port2addr_ata(port); 116 + } 117 + #endif 118 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 119 + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 120 + unsigned char b; 121 + pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); 122 + return b; 123 + } else 124 + #endif 125 + 121 126 return *(volatile unsigned char *)PORT2ADDR(port); 122 127 } 123 128 ··· 138 117 { 139 118 if (port >= LAN_IOSTART && port < LAN_IOEND) 140 119 return _ne_inw(PORT2ADDR_NE(port)); 141 - 120 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 121 + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 122 + return *(volatile unsigned short *)__port2addr_ata(port); 123 + } 124 + #endif 125 + #if defined(CONFIG_USB) 126 + else if(port >= 0x340 && port < 0x3a0) 127 + return *(volatile unsigned short *)PORT2ADDR_USB(port); 128 + #endif 129 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 130 + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 131 + unsigned short w; 132 + pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); 133 + return w; 134 + } else 135 + #endif 142 136 return *(volatile unsigned short *)PORT2ADDR(port); 143 137 } 144 138 145 139 unsigned long _inl(unsigned long port) 146 140 { 141 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 142 + if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 143 + unsigned long l; 144 + pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); 145 + return l; 146 + } else 147 + #endif 147 148 return *(volatile unsigned long *)PORT2ADDR(port); 148 149 } 149 150 ··· 195 152 if (port >= LAN_IOSTART && port < LAN_IOEND) 196 153 _ne_outb(b, PORT2ADDR_NE(port)); 197 154 else 155 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 156 + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 157 + *(volatile unsigned char *)__port2addr_ata(port) = b; 158 + } else 159 + #endif 160 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 161 + if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 162 + pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); 163 + } else 164 + #endif 198 165 *(volatile unsigned char *)PORT2ADDR(port) = b; 199 166 } 200 167 ··· 213 160 if (port >= LAN_IOSTART && port < LAN_IOEND) 214 161 _ne_outw(w, PORT2ADDR_NE(port)); 215 162 else 163 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 164 + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 165 + *(volatile unsigned short *)__port2addr_ata(port) = w; 166 + } else 167 + #endif 168 + #if defined(CONFIG_USB) 169 + if(port >= 0x340 && port < 0x3a0) 170 + *(volatile unsigned short *)PORT2ADDR_USB(port) = w; 171 + else 172 + #endif 173 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 174 + if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 175 + pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); 176 + } else 177 + #endif 216 178 *(volatile unsigned short *)PORT2ADDR(port) = w; 217 179 } 218 180 219 181 void _outl(unsigned long l, unsigned long port) 220 182 { 183 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 184 + if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 185 + pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); 186 + } else 187 + #endif 221 188 *(volatile unsigned long *)PORT2ADDR(port) = l; 222 189 } 223 190 ··· 263 190 { 264 191 if (port >= LAN_IOSTART && port < LAN_IOEND) 265 192 _ne_insb(PORT2ADDR_NE(port), addr, count); 193 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 194 + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 195 + unsigned char *buf = addr; 196 + unsigned char *portp = __port2addr_ata(port); 197 + while (count--) 198 + *buf++ = *(volatile unsigned char *)portp; 199 + } 200 + #endif 201 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 202 + else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 203 + pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), 204 + count, 1); 205 + } 206 + #endif 266 207 else { 267 208 unsigned char *buf = addr; 268 209 unsigned char *portp = PORT2ADDR(port); ··· 335 248 portp = PORT2ADDR_NE(port); 336 249 while (count--) 337 250 _ne_outb(*buf++, portp); 251 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 252 + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 253 + portp = __port2addr_ata(port); 254 + while (count--) 255 + *(volatile unsigned char *)portp = *buf++; 256 + #endif 257 + #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 258 + } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 259 + pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), 260 + count, 1); 261 + #endif 338 262 } else { 339 263 portp = PORT2ADDR(port); 340 264 while (count--)
+1 -1
arch/m32r/kernel/io_m32700ut.c arch/m32r/platforms/m32700ut/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_m32700ut.c 2 + * linux/arch/m32r/platforms/m32700ut/io.c 3 3 * 4 4 * Typical I/O routines for M32700UT board. 5 5 *
+1 -1
arch/m32r/kernel/io_mappi.c arch/m32r/platforms/mappi/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_mappi.c 2 + * linux/arch/m32r/platforms/mappi/io.c 3 3 * 4 4 * Typical I/O routines for Mappi board. 5 5 *
+33 -119
arch/m32r/kernel/io_mappi2.c arch/m32r/platforms/m32104ut/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_mappi2.c 2 + * linux/arch/m32r/platforms/m32104ut/io.c 3 3 * 4 - * Typical I/O routines for Mappi2 board. 4 + * Typical I/O routines for M32104UT board. 5 5 * 6 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, 7 - * Hitoshi Yamamoto, Mamoru Sakugawa 7 + * Hitoshi Yamamoto, Mamoru Sakugawa, 8 + * Naoto Sugai, Hayato Fujiwara 8 9 */ 9 10 10 11 #include <asm/m32r.h> ··· 27 26 extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); 28 27 #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ 29 28 30 - #define PORT2ADDR(port) _port2addr(port) 31 - #define PORT2ADDR_NE(port) _port2addr_ne(port) 32 - #define PORT2ADDR_USB(port) _port2addr_usb(port) 29 + #define PORT2ADDR(port) _port2addr(port) 33 30 34 31 static inline void *_port2addr(unsigned long port) 35 32 { ··· 54 55 } 55 56 #endif 56 57 58 + /* 59 + * M32104T-LAN is located in the extended bus space 60 + * from 0x01000000 to 0x01ffffff on physical address. 61 + * The base address of LAN controller(LAN91C111) is 0x300. 62 + */ 57 63 #define LAN_IOSTART (0x300 | NONCACHE_OFFSET) 58 64 #define LAN_IOEND (0x320 | NONCACHE_OFFSET) 59 - #ifdef CONFIG_CHIP_OPSP 60 65 static inline void *_port2addr_ne(unsigned long port) 61 66 { 62 - return (void *)(port + 0x10000000); 67 + return (void *)(port + NONCACHE_OFFSET + 0x01000000); 63 68 } 64 - #else 65 - static inline void *_port2addr_ne(unsigned long port) 66 - { 67 - return (void *)(port + 0x04000000); 68 - } 69 - #endif 70 - static inline void *_port2addr_usb(unsigned long port) 71 - { 72 - return (void *)(port + NONCACHE_OFFSET + 0x14000000); 73 - } 69 + 74 70 static inline void delay(void) 75 71 { 76 72 __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); ··· 75 81 * NIC I/O function 76 82 */ 77 83 84 + #define PORT2ADDR_NE(port) _port2addr_ne(port) 85 + 78 86 static inline unsigned char _ne_inb(void *portp) 79 87 { 80 - return (unsigned char) *(volatile unsigned char *)portp; 88 + return *(volatile unsigned char *)portp; 81 89 } 82 90 83 91 static inline unsigned short _ne_inw(void *portp) ··· 87 91 return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); 88 92 } 89 93 90 - static inline void _ne_insb(void *portp, void * addr, unsigned long count) 94 + static inline void _ne_insb(void *portp, void *addr, unsigned long count) 91 95 { 92 - unsigned char *buf = addr; 96 + unsigned char *buf = (unsigned char *)addr; 93 97 94 98 while (count--) 95 - *buf++ = *(volatile unsigned char *)portp; 99 + *buf++ = _ne_inb(portp); 96 100 } 97 101 98 102 static inline void _ne_outb(unsigned char b, void *portp) 99 103 { 100 - *(volatile unsigned char *)portp = (unsigned char)b; 104 + *(volatile unsigned char *)portp = b; 101 105 } 102 106 103 107 static inline void _ne_outw(unsigned short w, void *portp) ··· 109 113 { 110 114 if (port >= LAN_IOSTART && port < LAN_IOEND) 111 115 return _ne_inb(PORT2ADDR_NE(port)); 112 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 113 - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 114 - return *(volatile unsigned char *)__port2addr_ata(port); 115 - } 116 - #endif 117 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 118 - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 119 - unsigned char b; 120 - pcc_ioread_byte(0, port, &b, sizeof(b), 1, 0); 121 - return b; 122 - } else 123 - #endif 124 116 125 117 return *(volatile unsigned char *)PORT2ADDR(port); 126 118 } ··· 117 133 { 118 134 if (port >= LAN_IOSTART && port < LAN_IOEND) 119 135 return _ne_inw(PORT2ADDR_NE(port)); 120 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 121 - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 122 - return *(volatile unsigned short *)__port2addr_ata(port); 123 - } 124 - #endif 125 - #if defined(CONFIG_USB) 126 - else if (port >= 0x340 && port < 0x3a0) 127 - return *(volatile unsigned short *)PORT2ADDR_USB(port); 128 - #endif 129 136 130 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 131 - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 132 - unsigned short w; 133 - pcc_ioread_word(0, port, &w, sizeof(w), 1, 0); 134 - return w; 135 - } else 136 - #endif 137 137 return *(volatile unsigned short *)PORT2ADDR(port); 138 138 } 139 139 140 140 unsigned long _inl(unsigned long port) 141 141 { 142 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 143 - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 144 - unsigned long l; 145 - pcc_ioread_word(0, port, &l, sizeof(l), 1, 0); 146 - return l; 147 - } else 148 - #endif 149 142 return *(volatile unsigned long *)PORT2ADDR(port); 150 143 } 151 144 ··· 152 191 if (port >= LAN_IOSTART && port < LAN_IOEND) 153 192 _ne_outb(b, PORT2ADDR_NE(port)); 154 193 else 155 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 156 - if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 157 - *(volatile unsigned char *)__port2addr_ata(port) = b; 158 - } else 159 - #endif 160 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 161 - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 162 - pcc_iowrite_byte(0, port, &b, sizeof(b), 1, 0); 163 - } else 164 - #endif 165 194 *(volatile unsigned char *)PORT2ADDR(port) = b; 166 195 } 167 196 ··· 160 209 if (port >= LAN_IOSTART && port < LAN_IOEND) 161 210 _ne_outw(w, PORT2ADDR_NE(port)); 162 211 else 163 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 164 - if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 165 - *(volatile unsigned short *)__port2addr_ata(port) = w; 166 - } else 167 - #endif 168 - #if defined(CONFIG_USB) 169 - if (port >= 0x340 && port < 0x3a0) 170 - *(volatile unsigned short *)PORT2ADDR_USB(port) = w; 171 - else 172 - #endif 173 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 174 - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 175 - pcc_iowrite_word(0, port, &w, sizeof(w), 1, 0); 176 - } else 177 - #endif 178 212 *(volatile unsigned short *)PORT2ADDR(port) = w; 179 213 } 180 214 181 215 void _outl(unsigned long l, unsigned long port) 182 216 { 183 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 184 - if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 185 - pcc_iowrite_word(0, port, &l, sizeof(l), 1, 0); 186 - } else 187 - #endif 188 217 *(volatile unsigned long *)PORT2ADDR(port) = l; 189 218 } 190 219 ··· 186 255 delay(); 187 256 } 188 257 189 - void _insb(unsigned int port, void * addr, unsigned long count) 258 + void _insb(unsigned int port, void *addr, unsigned long count) 190 259 { 191 260 if (port >= LAN_IOSTART && port < LAN_IOEND) 192 261 _ne_insb(PORT2ADDR_NE(port), addr, count); 193 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 194 - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 195 - unsigned char *buf = addr; 196 - unsigned char *portp = __port2addr_ata(port); 197 - while (count--) 198 - *buf++ = *(volatile unsigned char *)portp; 199 - } 200 - #endif 201 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 202 - else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 203 - pcc_ioread_byte(0, port, (void *)addr, sizeof(unsigned char), 204 - count, 1); 205 - } 206 - #endif 207 262 else { 208 263 unsigned char *buf = addr; 209 264 unsigned char *portp = PORT2ADDR(port); ··· 198 281 } 199 282 } 200 283 201 - void _insw(unsigned int port, void * addr, unsigned long count) 284 + void _insw(unsigned int port, void *addr, unsigned long count) 202 285 { 203 286 unsigned short *buf = addr; 204 287 unsigned short *portp; 205 288 206 289 if (port >= LAN_IOSTART && port < LAN_IOEND) { 290 + /* 291 + * This portion is only used by smc91111.c to read data 292 + * from the DATA_REG. Do not swap the data. 293 + */ 207 294 portp = PORT2ADDR_NE(port); 208 295 while (count--) 209 296 *buf++ = *(volatile unsigned short *)portp; ··· 229 308 } 230 309 } 231 310 232 - void _insl(unsigned int port, void * addr, unsigned long count) 311 + void _insl(unsigned int port, void *addr, unsigned long count) 233 312 { 234 313 unsigned long *buf = addr; 235 314 unsigned long *portp; ··· 239 318 *buf++ = *(volatile unsigned long *)portp; 240 319 } 241 320 242 - void _outsb(unsigned int port, const void * addr, unsigned long count) 321 + void _outsb(unsigned int port, const void *addr, unsigned long count) 243 322 { 244 323 const unsigned char *buf = addr; 245 324 unsigned char *portp; ··· 248 327 portp = PORT2ADDR_NE(port); 249 328 while (count--) 250 329 _ne_outb(*buf++, portp); 251 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 252 - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 253 - portp = __port2addr_ata(port); 254 - while (count--) 255 - *(volatile unsigned char *)portp = *buf++; 256 - #endif 257 - #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 258 - } else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 259 - pcc_iowrite_byte(0, port, (void *)addr, sizeof(unsigned char), 260 - count, 1); 261 - #endif 262 330 } else { 263 331 portp = PORT2ADDR(port); 264 332 while (count--) ··· 255 345 } 256 346 } 257 347 258 - void _outsw(unsigned int port, const void * addr, unsigned long count) 348 + void _outsw(unsigned int port, const void *addr, unsigned long count) 259 349 { 260 350 const unsigned short *buf = addr; 261 351 unsigned short *portp; 262 352 263 353 if (port >= LAN_IOSTART && port < LAN_IOEND) { 354 + /* 355 + * This portion is only used by smc91111.c to write data 356 + * into the DATA_REG. Do not swap the data. 357 + */ 264 358 portp = PORT2ADDR_NE(port); 265 359 while (count--) 266 360 *(volatile unsigned short *)portp = *buf++; ··· 286 372 } 287 373 } 288 374 289 - void _outsl(unsigned int port, const void * addr, unsigned long count) 375 + void _outsl(unsigned int port, const void *addr, unsigned long count) 290 376 { 291 377 const unsigned long *buf = addr; 292 378 unsigned char *portp;
+37 -59
arch/m32r/kernel/io_mappi3.c arch/m32r/platforms/mappi2/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_mappi3.c 2 + * linux/arch/m32r/platforms/mappi2/io.c 3 3 * 4 - * Typical I/O routines for Mappi3 board. 4 + * Typical I/O routines for Mappi2 board. 5 5 * 6 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, 7 7 * Hitoshi Yamamoto, Mamoru Sakugawa ··· 35 35 return (void *)(port | NONCACHE_OFFSET); 36 36 } 37 37 38 - #if defined(CONFIG_IDE) 38 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 39 39 static inline void *__port2addr_ata(unsigned long port) 40 40 { 41 41 static int dummy_reg; 42 42 43 43 switch (port) { 44 - /* IDE0 CF */ 45 - case 0x1f0: return (void *)(0x14002000 | NONCACHE_OFFSET); 46 - case 0x1f1: return (void *)(0x14012800 | NONCACHE_OFFSET); 47 - case 0x1f2: return (void *)(0x14012002 | NONCACHE_OFFSET); 48 - case 0x1f3: return (void *)(0x14012802 | NONCACHE_OFFSET); 49 - case 0x1f4: return (void *)(0x14012004 | NONCACHE_OFFSET); 50 - case 0x1f5: return (void *)(0x14012804 | NONCACHE_OFFSET); 51 - case 0x1f6: return (void *)(0x14012006 | NONCACHE_OFFSET); 52 - case 0x1f7: return (void *)(0x14012806 | NONCACHE_OFFSET); 53 - case 0x3f6: return (void *)(0x1401200e | NONCACHE_OFFSET); 54 - /* IDE1 IDE */ 55 - case 0x170: /* Data 16bit */ 56 - return (void *)(0x14810000 | NONCACHE_OFFSET); 57 - case 0x171: /* Features / Error */ 58 - return (void *)(0x14810002 | NONCACHE_OFFSET); 59 - case 0x172: /* Sector count */ 60 - return (void *)(0x14810004 | NONCACHE_OFFSET); 61 - case 0x173: /* Sector number */ 62 - return (void *)(0x14810006 | NONCACHE_OFFSET); 63 - case 0x174: /* Cylinder low */ 64 - return (void *)(0x14810008 | NONCACHE_OFFSET); 65 - case 0x175: /* Cylinder high */ 66 - return (void *)(0x1481000a | NONCACHE_OFFSET); 67 - case 0x176: /* Device head */ 68 - return (void *)(0x1481000c | NONCACHE_OFFSET); 69 - case 0x177: /* Command */ 70 - return (void *)(0x1481000e | NONCACHE_OFFSET); 71 - case 0x376: /* Device control / Alt status */ 72 - return (void *)(0x1480800c | NONCACHE_OFFSET); 73 - 44 + case 0x1f0: return (void *)(0x0c002000 | NONCACHE_OFFSET); 45 + case 0x1f1: return (void *)(0x0c012800 | NONCACHE_OFFSET); 46 + case 0x1f2: return (void *)(0x0c012002 | NONCACHE_OFFSET); 47 + case 0x1f3: return (void *)(0x0c012802 | NONCACHE_OFFSET); 48 + case 0x1f4: return (void *)(0x0c012004 | NONCACHE_OFFSET); 49 + case 0x1f5: return (void *)(0x0c012804 | NONCACHE_OFFSET); 50 + case 0x1f6: return (void *)(0x0c012006 | NONCACHE_OFFSET); 51 + case 0x1f7: return (void *)(0x0c012806 | NONCACHE_OFFSET); 52 + case 0x3f6: return (void *)(0x0c01200e | NONCACHE_OFFSET); 74 53 default: return (void *)&dummy_reg; 75 54 } 76 55 } ··· 57 78 58 79 #define LAN_IOSTART (0x300 | NONCACHE_OFFSET) 59 80 #define LAN_IOEND (0x320 | NONCACHE_OFFSET) 81 + #ifdef CONFIG_CHIP_OPSP 60 82 static inline void *_port2addr_ne(unsigned long port) 61 83 { 62 84 return (void *)(port + 0x10000000); 63 85 } 64 - 86 + #else 87 + static inline void *_port2addr_ne(unsigned long port) 88 + { 89 + return (void *)(port + 0x04000000); 90 + } 91 + #endif 65 92 static inline void *_port2addr_usb(unsigned long port) 66 93 { 67 - return (void *)(port + NONCACHE_OFFSET + 0x12000000); 94 + return (void *)(port + NONCACHE_OFFSET + 0x14000000); 68 95 } 69 96 static inline void delay(void) 70 97 { ··· 113 128 { 114 129 if (port >= LAN_IOSTART && port < LAN_IOEND) 115 130 return _ne_inb(PORT2ADDR_NE(port)); 116 - #if defined(CONFIG_IDE) 117 - else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 118 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 131 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 132 + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 119 133 return *(volatile unsigned char *)__port2addr_ata(port); 120 134 } 121 135 #endif ··· 125 141 return b; 126 142 } else 127 143 #endif 144 + 128 145 return *(volatile unsigned char *)PORT2ADDR(port); 129 146 } 130 147 ··· 133 148 { 134 149 if (port >= LAN_IOSTART && port < LAN_IOEND) 135 150 return _ne_inw(PORT2ADDR_NE(port)); 136 - #if defined(CONFIG_IDE) 137 - else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 138 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 151 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 152 + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 139 153 return *(volatile unsigned short *)__port2addr_ata(port); 140 154 } 141 155 #endif ··· 191 207 if (port >= LAN_IOSTART && port < LAN_IOEND) 192 208 _ne_outb(b, PORT2ADDR_NE(port)); 193 209 else 194 - #if defined(CONFIG_IDE) 195 - if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 196 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 210 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 211 + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 197 212 *(volatile unsigned char *)__port2addr_ata(port) = b; 198 213 } else 199 214 #endif ··· 209 226 if (port >= LAN_IOSTART && port < LAN_IOEND) 210 227 _ne_outw(w, PORT2ADDR_NE(port)); 211 228 else 212 - #if defined(CONFIG_IDE) 213 - if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 214 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 229 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 230 + if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 215 231 *(volatile unsigned short *)__port2addr_ata(port) = w; 216 232 } else 217 233 #endif ··· 259 277 { 260 278 if (port >= LAN_IOSTART && port < LAN_IOEND) 261 279 _ne_insb(PORT2ADDR_NE(port), addr, count); 262 - #if defined(CONFIG_IDE) 263 - else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 264 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 280 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 281 + else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 265 282 unsigned char *buf = addr; 266 283 unsigned char *portp = __port2addr_ata(port); 267 284 while (count--) ··· 295 314 pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), 296 315 count, 1); 297 316 #endif 298 - #if defined(CONFIG_IDE) 299 - } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 300 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 317 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 318 + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 301 319 portp = __port2addr_ata(port); 302 320 while (count--) 303 321 *buf++ = *(volatile unsigned short *)portp; ··· 327 347 portp = PORT2ADDR_NE(port); 328 348 while (count--) 329 349 _ne_outb(*buf++, portp); 330 - #if defined(CONFIG_IDE) 331 - } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 332 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 350 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 351 + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 333 352 portp = __port2addr_ata(port); 334 353 while (count--) 335 354 *(volatile unsigned char *)portp = *buf++; ··· 354 375 portp = PORT2ADDR_NE(port); 355 376 while (count--) 356 377 *(volatile unsigned short *)portp = *buf++; 357 - #if defined(CONFIG_IDE) 358 - } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 359 - ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 378 + #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 379 + } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 360 380 portp = __port2addr_ata(port); 361 381 while (count--) 362 382 *(volatile unsigned short *)portp = *buf++;
+1 -1
arch/m32r/kernel/io_oaks32r.c arch/m32r/platforms/oaks32r/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_oaks32r.c 2 + * linux/arch/m32r/platforms/oaks32r/io.c 3 3 * 4 4 * Typical I/O routines for OAKS32R board. 5 5 *
+77 -67
arch/m32r/kernel/io_opsput.c arch/m32r/platforms/mappi3/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_opsput.c 2 + * linux/arch/m32r/platforms/mappi3/io.c 3 3 * 4 - * Typical I/O routines for OPSPUT board. 4 + * Typical I/O routines for Mappi3 board. 5 5 * 6 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, 7 - * Hitoshi Yamamoto, Takeo Takahashi 8 - * 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 11 - * archive for more details. 7 + * Hitoshi Yamamoto, Mamoru Sakugawa 12 8 */ 13 9 14 10 #include <asm/m32r.h> ··· 26 30 extern void pcc_iowrite_word(int, unsigned long, void *, size_t, size_t, int); 27 31 #endif /* CONFIG_PCMCIA && CONFIG_M32R_CFC */ 28 32 29 - #define PORT2ADDR(port) _port2addr(port) 30 - #define PORT2ADDR_USB(port) _port2addr_usb(port) 33 + #define PORT2ADDR(port) _port2addr(port) 34 + #define PORT2ADDR_NE(port) _port2addr_ne(port) 35 + #define PORT2ADDR_USB(port) _port2addr_usb(port) 31 36 32 37 static inline void *_port2addr(unsigned long port) 33 38 { 34 39 return (void *)(port | NONCACHE_OFFSET); 35 40 } 36 41 37 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 42 + #if defined(CONFIG_IDE) 38 43 static inline void *__port2addr_ata(unsigned long port) 39 44 { 40 45 static int dummy_reg; 41 46 42 47 switch (port) { 43 - case 0x1f0: return (void *)(0x0c002000 | NONCACHE_OFFSET); 44 - case 0x1f1: return (void *)(0x0c012800 | NONCACHE_OFFSET); 45 - case 0x1f2: return (void *)(0x0c012002 | NONCACHE_OFFSET); 46 - case 0x1f3: return (void *)(0x0c012802 | NONCACHE_OFFSET); 47 - case 0x1f4: return (void *)(0x0c012004 | NONCACHE_OFFSET); 48 - case 0x1f5: return (void *)(0x0c012804 | NONCACHE_OFFSET); 49 - case 0x1f6: return (void *)(0x0c012006 | NONCACHE_OFFSET); 50 - case 0x1f7: return (void *)(0x0c012806 | NONCACHE_OFFSET); 51 - case 0x3f6: return (void *)(0x0c01200e | NONCACHE_OFFSET); 48 + /* IDE0 CF */ 49 + case 0x1f0: return (void *)(0x14002000 | NONCACHE_OFFSET); 50 + case 0x1f1: return (void *)(0x14012800 | NONCACHE_OFFSET); 51 + case 0x1f2: return (void *)(0x14012002 | NONCACHE_OFFSET); 52 + case 0x1f3: return (void *)(0x14012802 | NONCACHE_OFFSET); 53 + case 0x1f4: return (void *)(0x14012004 | NONCACHE_OFFSET); 54 + case 0x1f5: return (void *)(0x14012804 | NONCACHE_OFFSET); 55 + case 0x1f6: return (void *)(0x14012006 | NONCACHE_OFFSET); 56 + case 0x1f7: return (void *)(0x14012806 | NONCACHE_OFFSET); 57 + case 0x3f6: return (void *)(0x1401200e | NONCACHE_OFFSET); 58 + /* IDE1 IDE */ 59 + case 0x170: /* Data 16bit */ 60 + return (void *)(0x14810000 | NONCACHE_OFFSET); 61 + case 0x171: /* Features / Error */ 62 + return (void *)(0x14810002 | NONCACHE_OFFSET); 63 + case 0x172: /* Sector count */ 64 + return (void *)(0x14810004 | NONCACHE_OFFSET); 65 + case 0x173: /* Sector number */ 66 + return (void *)(0x14810006 | NONCACHE_OFFSET); 67 + case 0x174: /* Cylinder low */ 68 + return (void *)(0x14810008 | NONCACHE_OFFSET); 69 + case 0x175: /* Cylinder high */ 70 + return (void *)(0x1481000a | NONCACHE_OFFSET); 71 + case 0x176: /* Device head */ 72 + return (void *)(0x1481000c | NONCACHE_OFFSET); 73 + case 0x177: /* Command */ 74 + return (void *)(0x1481000e | NONCACHE_OFFSET); 75 + case 0x376: /* Device control / Alt status */ 76 + return (void *)(0x1480800c | NONCACHE_OFFSET); 77 + 52 78 default: return (void *)&dummy_reg; 53 79 } 54 80 } 55 81 #endif 56 82 57 - /* 58 - * OPSPUT-LAN is located in the extended bus space 59 - * from 0x10000000 to 0x13ffffff on physical address. 60 - * The base address of LAN controller(LAN91C111) is 0x300. 61 - */ 62 83 #define LAN_IOSTART (0x300 | NONCACHE_OFFSET) 63 84 #define LAN_IOEND (0x320 | NONCACHE_OFFSET) 64 85 static inline void *_port2addr_ne(unsigned long port) 65 86 { 66 87 return (void *)(port + 0x10000000); 67 88 } 89 + 68 90 static inline void *_port2addr_usb(unsigned long port) 69 91 { 70 - return (void *)((port & 0x0f) + NONCACHE_OFFSET + 0x10303000); 92 + return (void *)(port + NONCACHE_OFFSET + 0x12000000); 71 93 } 72 - 73 94 static inline void delay(void) 74 95 { 75 96 __asm__ __volatile__ ("push r0; \n\t pop r0;" : : :"memory"); ··· 96 83 * NIC I/O function 97 84 */ 98 85 99 - #define PORT2ADDR_NE(port) _port2addr_ne(port) 100 - 101 86 static inline unsigned char _ne_inb(void *portp) 102 87 { 103 - return *(volatile unsigned char *)portp; 88 + return (unsigned char) *(volatile unsigned char *)portp; 104 89 } 105 90 106 91 static inline unsigned short _ne_inw(void *portp) ··· 106 95 return (unsigned short)le16_to_cpu(*(volatile unsigned short *)portp); 107 96 } 108 97 109 - static inline void _ne_insb(void *portp, void *addr, unsigned long count) 98 + static inline void _ne_insb(void *portp, void * addr, unsigned long count) 110 99 { 111 - unsigned char *buf = (unsigned char *)addr; 100 + unsigned char *buf = addr; 112 101 113 102 while (count--) 114 - *buf++ = _ne_inb(portp); 103 + *buf++ = *(volatile unsigned char *)portp; 115 104 } 116 105 117 106 static inline void _ne_outb(unsigned char b, void *portp) 118 107 { 119 - *(volatile unsigned char *)portp = b; 108 + *(volatile unsigned char *)portp = (unsigned char)b; 120 109 } 121 110 122 111 static inline void _ne_outw(unsigned short w, void *portp) ··· 128 117 { 129 118 if (port >= LAN_IOSTART && port < LAN_IOEND) 130 119 return _ne_inb(PORT2ADDR_NE(port)); 131 - 132 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 133 - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 120 + #if defined(CONFIG_IDE) 121 + else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 122 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 134 123 return *(volatile unsigned char *)__port2addr_ata(port); 135 124 } 136 125 #endif ··· 141 130 return b; 142 131 } else 143 132 #endif 144 - 145 133 return *(volatile unsigned char *)PORT2ADDR(port); 146 134 } 147 135 ··· 148 138 { 149 139 if (port >= LAN_IOSTART && port < LAN_IOEND) 150 140 return _ne_inw(PORT2ADDR_NE(port)); 151 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 152 - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 141 + #if defined(CONFIG_IDE) 142 + else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 143 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 153 144 return *(volatile unsigned short *)__port2addr_ata(port); 154 145 } 155 146 #endif 156 147 #if defined(CONFIG_USB) 157 - else if(port >= 0x340 && port < 0x3a0) 148 + else if (port >= 0x340 && port < 0x3a0) 158 149 return *(volatile unsigned short *)PORT2ADDR_USB(port); 159 150 #endif 151 + 160 152 #if defined(CONFIG_PCMCIA) && defined(CONFIG_M32R_CFC) 161 153 else if (port >= M32R_PCC_IOSTART0 && port <= M32R_PCC_IOEND0) { 162 154 unsigned short w; ··· 207 195 if (port >= LAN_IOSTART && port < LAN_IOEND) 208 196 _ne_outb(b, PORT2ADDR_NE(port)); 209 197 else 210 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 211 - if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 198 + #if defined(CONFIG_IDE) 199 + if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 200 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 212 201 *(volatile unsigned char *)__port2addr_ata(port) = b; 213 202 } else 214 203 #endif ··· 226 213 if (port >= LAN_IOSTART && port < LAN_IOEND) 227 214 _ne_outw(w, PORT2ADDR_NE(port)); 228 215 else 229 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 230 - if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 216 + #if defined(CONFIG_IDE) 217 + if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 218 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 231 219 *(volatile unsigned short *)__port2addr_ata(port) = w; 232 220 } else 233 221 #endif 234 222 #if defined(CONFIG_USB) 235 - if(port >= 0x340 && port < 0x3a0) 223 + if (port >= 0x340 && port < 0x3a0) 236 224 *(volatile unsigned short *)PORT2ADDR_USB(port) = w; 237 225 else 238 226 #endif ··· 273 259 delay(); 274 260 } 275 261 276 - void _insb(unsigned int port, void *addr, unsigned long count) 262 + void _insb(unsigned int port, void * addr, unsigned long count) 277 263 { 278 264 if (port >= LAN_IOSTART && port < LAN_IOEND) 279 265 _ne_insb(PORT2ADDR_NE(port), addr, count); 280 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 281 - else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 266 + #if defined(CONFIG_IDE) 267 + else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 268 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 282 269 unsigned char *buf = addr; 283 270 unsigned char *portp = __port2addr_ata(port); 284 271 while (count--) ··· 300 285 } 301 286 } 302 287 303 - void _insw(unsigned int port, void *addr, unsigned long count) 288 + void _insw(unsigned int port, void * addr, unsigned long count) 304 289 { 305 290 unsigned short *buf = addr; 306 291 unsigned short *portp; 307 292 308 293 if (port >= LAN_IOSTART && port < LAN_IOEND) { 309 - /* 310 - * This portion is only used by smc91111.c to read data 311 - * from the DATA_REG. Do not swap the data. 312 - */ 313 294 portp = PORT2ADDR_NE(port); 314 295 while (count--) 315 296 *buf++ = *(volatile unsigned short *)portp; ··· 314 303 pcc_ioread_word(9, port, (void *)addr, sizeof(unsigned short), 315 304 count, 1); 316 305 #endif 317 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 318 - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 306 + #if defined(CONFIG_IDE) 307 + } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 308 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 319 309 portp = __port2addr_ata(port); 320 310 while (count--) 321 311 *buf++ = *(volatile unsigned short *)portp; ··· 328 316 } 329 317 } 330 318 331 - void _insl(unsigned int port, void *addr, unsigned long count) 319 + void _insl(unsigned int port, void * addr, unsigned long count) 332 320 { 333 321 unsigned long *buf = addr; 334 322 unsigned long *portp; ··· 338 326 *buf++ = *(volatile unsigned long *)portp; 339 327 } 340 328 341 - void _outsb(unsigned int port, const void *addr, unsigned long count) 329 + void _outsb(unsigned int port, const void * addr, unsigned long count) 342 330 { 343 331 const unsigned char *buf = addr; 344 332 unsigned char *portp; ··· 347 335 portp = PORT2ADDR_NE(port); 348 336 while (count--) 349 337 _ne_outb(*buf++, portp); 350 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 351 - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 338 + #if defined(CONFIG_IDE) 339 + } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 340 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 352 341 portp = __port2addr_ata(port); 353 342 while (count--) 354 343 *(volatile unsigned char *)portp = *buf++; ··· 366 353 } 367 354 } 368 355 369 - void _outsw(unsigned int port, const void *addr, unsigned long count) 356 + void _outsw(unsigned int port, const void * addr, unsigned long count) 370 357 { 371 358 const unsigned short *buf = addr; 372 359 unsigned short *portp; 373 360 374 361 if (port >= LAN_IOSTART && port < LAN_IOEND) { 375 - /* 376 - * This portion is only used by smc91111.c to write data 377 - * into the DATA_REG. Do not swap the data. 378 - */ 379 362 portp = PORT2ADDR_NE(port); 380 363 while (count--) 381 364 *(volatile unsigned short *)portp = *buf++; 382 - #if defined(CONFIG_IDE) && !defined(CONFIG_M32R_CFC) 383 - } else if ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) { 365 + #if defined(CONFIG_IDE) 366 + } else if ( ((port >= 0x170 && port <=0x177) || port == 0x376) || 367 + ((port >= 0x1f0 && port <=0x1f7) || port == 0x3f6) ){ 384 368 portp = __port2addr_ata(port); 385 369 while (count--) 386 370 *(volatile unsigned short *)portp = *buf++; ··· 394 384 } 395 385 } 396 386 397 - void _outsl(unsigned int port, const void *addr, unsigned long count) 387 + void _outsl(unsigned int port, const void * addr, unsigned long count) 398 388 { 399 389 const unsigned long *buf = addr; 400 390 unsigned char *portp;
+2 -2
arch/m32r/kernel/io_usrv.c arch/m32r/platforms/usrv/io.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/io_usrv.c 2 + * linux/arch/m32r/platforms/usrv/io.c 3 3 * 4 4 * Typical I/O routines for uServer board. 5 5 * ··· 17 17 #include <asm/io.h> 18 18 19 19 #include <linux/types.h> 20 - #include "../drivers/m32r_cfc.h" 20 + #include "../../../../drivers/pcmcia/m32r_cfc.h" 21 21 22 22 extern void pcc_ioread_byte(int, unsigned long, void *, size_t, size_t, int); 23 23 extern void pcc_ioread_word(int, unsigned long, void *, size_t, size_t, int);
+1 -1
arch/m32r/kernel/setup_m32104ut.c arch/m32r/platforms/m32104ut/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_m32104ut.c 2 + * linux/arch/m32r/platforms/m32104ut/setup.c 3 3 * 4 4 * Setup routines for M32104UT Board 5 5 *
+136 -135
arch/m32r/kernel/setup_m32700ut.c arch/m32r/platforms/opsput/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_m32700ut.c 2 + * linux/arch/m32r/platforms/opsput/setup.c 3 3 * 4 - * Setup routines for Renesas M32700UT Board 4 + * Setup routines for Renesas OPSPUT Board 5 5 * 6 - * Copyright (c) 2002-2005 Hiroyuki Kondo, Hirokazu Takata, 7 - * Hitoshi Yamamoto, Takeo Takahashi 6 + * Copyright (c) 2002-2005 7 + * Hiroyuki Kondo, Hirokazu Takata, 8 + * Hitoshi Yamamoto, Takeo Takahashi, Mamoru Sakugawa 8 9 * 9 10 * This file is subject to the terms and conditions of the GNU General 10 11 * Public License. See the file "COPYING" in the main directory of this ··· 22 21 #include <asm/io.h> 23 22 24 23 /* 25 - * M32700 Interrupt Control Unit (Level 1) 24 + * OPSP Interrupt Control Unit (Level 1) 26 25 */ 27 26 #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long))) 28 27 29 - icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; 28 + icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ]; 30 29 31 - static void disable_m32700ut_irq(unsigned int irq) 30 + static void disable_opsput_irq(unsigned int irq) 32 31 { 33 32 unsigned long port, data; 34 33 ··· 37 36 outl(data, port); 38 37 } 39 38 40 - static void enable_m32700ut_irq(unsigned int irq) 39 + static void enable_opsput_irq(unsigned int irq) 41 40 { 42 41 unsigned long port, data; 43 42 ··· 46 45 outl(data, port); 47 46 } 48 47 49 - static void mask_and_ack_m32700ut(unsigned int irq) 48 + static void mask_and_ack_opsput(unsigned int irq) 50 49 { 51 - disable_m32700ut_irq(irq); 50 + disable_opsput_irq(irq); 52 51 } 53 52 54 - static void end_m32700ut_irq(unsigned int irq) 53 + static void end_opsput_irq(unsigned int irq) 55 54 { 56 - enable_m32700ut_irq(irq); 55 + enable_opsput_irq(irq); 57 56 } 58 57 59 - static unsigned int startup_m32700ut_irq(unsigned int irq) 58 + static unsigned int startup_opsput_irq(unsigned int irq) 60 59 { 61 - enable_m32700ut_irq(irq); 60 + enable_opsput_irq(irq); 62 61 return (0); 63 62 } 64 63 65 - static void shutdown_m32700ut_irq(unsigned int irq) 64 + static void shutdown_opsput_irq(unsigned int irq) 66 65 { 67 66 unsigned long port; 68 67 ··· 70 69 outl(M32R_ICUCR_ILEVEL7, port); 71 70 } 72 71 73 - static struct hw_interrupt_type m32700ut_irq_type = 72 + static struct hw_interrupt_type opsput_irq_type = 74 73 { 75 - .typename = "M32700UT-IRQ", 76 - .startup = startup_m32700ut_irq, 77 - .shutdown = shutdown_m32700ut_irq, 78 - .enable = enable_m32700ut_irq, 79 - .disable = disable_m32700ut_irq, 80 - .ack = mask_and_ack_m32700ut, 81 - .end = end_m32700ut_irq 74 + .typename = "OPSPUT-IRQ", 75 + .startup = startup_opsput_irq, 76 + .shutdown = shutdown_opsput_irq, 77 + .enable = enable_opsput_irq, 78 + .disable = disable_opsput_irq, 79 + .ack = mask_and_ack_opsput, 80 + .end = end_opsput_irq 82 81 }; 83 82 84 83 /* 85 - * Interrupt Control Unit of PLD on M32700UT (Level 2) 84 + * Interrupt Control Unit of PLD on OPSPUT (Level 2) 86 85 */ 87 - #define irq2pldirq(x) ((x) - M32700UT_PLD_IRQ_BASE) 86 + #define irq2pldirq(x) ((x) - OPSPUT_PLD_IRQ_BASE) 88 87 #define pldirq2port(x) (unsigned long)((int)PLD_ICUCR1 + \ 89 88 (((x) - 1) * sizeof(unsigned short))) 90 89 ··· 92 91 unsigned short icucr; /* ICU Control Register */ 93 92 } pld_icu_data_t; 94 93 95 - static pld_icu_data_t pld_icu_data[M32700UT_NUM_PLD_IRQ]; 94 + static pld_icu_data_t pld_icu_data[OPSPUT_NUM_PLD_IRQ]; 96 95 97 - static void disable_m32700ut_pld_irq(unsigned int irq) 96 + static void disable_opsput_pld_irq(unsigned int irq) 98 97 { 99 98 unsigned long port, data; 100 99 unsigned int pldirq; 101 100 102 101 pldirq = irq2pldirq(irq); 103 - // disable_m32700ut_irq(M32R_IRQ_INT1); 102 + // disable_opsput_irq(M32R_IRQ_INT1); 104 103 port = pldirq2port(pldirq); 105 104 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; 106 105 outw(data, port); 107 106 } 108 107 109 - static void enable_m32700ut_pld_irq(unsigned int irq) 108 + static void enable_opsput_pld_irq(unsigned int irq) 110 109 { 111 110 unsigned long port, data; 112 111 unsigned int pldirq; 113 112 114 113 pldirq = irq2pldirq(irq); 115 - // enable_m32700ut_irq(M32R_IRQ_INT1); 114 + // enable_opsput_irq(M32R_IRQ_INT1); 116 115 port = pldirq2port(pldirq); 117 116 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; 118 117 outw(data, port); 119 118 } 120 119 121 - static void mask_and_ack_m32700ut_pld(unsigned int irq) 120 + static void mask_and_ack_opsput_pld(unsigned int irq) 122 121 { 123 - disable_m32700ut_pld_irq(irq); 124 - // mask_and_ack_m32700ut(M32R_IRQ_INT1); 122 + disable_opsput_pld_irq(irq); 123 + // mask_and_ack_opsput(M32R_IRQ_INT1); 125 124 } 126 125 127 - static void end_m32700ut_pld_irq(unsigned int irq) 126 + static void end_opsput_pld_irq(unsigned int irq) 128 127 { 129 - enable_m32700ut_pld_irq(irq); 130 - end_m32700ut_irq(M32R_IRQ_INT1); 128 + enable_opsput_pld_irq(irq); 129 + end_opsput_irq(M32R_IRQ_INT1); 131 130 } 132 131 133 - static unsigned int startup_m32700ut_pld_irq(unsigned int irq) 132 + static unsigned int startup_opsput_pld_irq(unsigned int irq) 134 133 { 135 - enable_m32700ut_pld_irq(irq); 134 + enable_opsput_pld_irq(irq); 136 135 return (0); 137 136 } 138 137 139 - static void shutdown_m32700ut_pld_irq(unsigned int irq) 138 + static void shutdown_opsput_pld_irq(unsigned int irq) 140 139 { 141 140 unsigned long port; 142 141 unsigned int pldirq; 143 142 144 143 pldirq = irq2pldirq(irq); 145 - // shutdown_m32700ut_irq(M32R_IRQ_INT1); 144 + // shutdown_opsput_irq(M32R_IRQ_INT1); 146 145 port = pldirq2port(pldirq); 147 146 outw(PLD_ICUCR_ILEVEL7, port); 148 147 } 149 148 150 - static struct hw_interrupt_type m32700ut_pld_irq_type = 149 + static struct hw_interrupt_type opsput_pld_irq_type = 151 150 { 152 - .typename = "M32700UT-PLD-IRQ", 153 - .startup = startup_m32700ut_pld_irq, 154 - .shutdown = shutdown_m32700ut_pld_irq, 155 - .enable = enable_m32700ut_pld_irq, 156 - .disable = disable_m32700ut_pld_irq, 157 - .ack = mask_and_ack_m32700ut_pld, 158 - .end = end_m32700ut_pld_irq 151 + .typename = "OPSPUT-PLD-IRQ", 152 + .startup = startup_opsput_pld_irq, 153 + .shutdown = shutdown_opsput_pld_irq, 154 + .enable = enable_opsput_pld_irq, 155 + .disable = disable_opsput_pld_irq, 156 + .ack = mask_and_ack_opsput_pld, 157 + .end = end_opsput_pld_irq 159 158 }; 160 159 161 160 /* 162 - * Interrupt Control Unit of PLD on M32700UT-LAN (Level 2) 161 + * Interrupt Control Unit of PLD on OPSPUT-LAN (Level 2) 163 162 */ 164 - #define irq2lanpldirq(x) ((x) - M32700UT_LAN_PLD_IRQ_BASE) 165 - #define lanpldirq2port(x) (unsigned long)((int)M32700UT_LAN_ICUCR1 + \ 163 + #define irq2lanpldirq(x) ((x) - OPSPUT_LAN_PLD_IRQ_BASE) 164 + #define lanpldirq2port(x) (unsigned long)((int)OPSPUT_LAN_ICUCR1 + \ 166 165 (((x) - 1) * sizeof(unsigned short))) 167 166 168 - static pld_icu_data_t lanpld_icu_data[M32700UT_NUM_LAN_PLD_IRQ]; 167 + static pld_icu_data_t lanpld_icu_data[OPSPUT_NUM_LAN_PLD_IRQ]; 169 168 170 - static void disable_m32700ut_lanpld_irq(unsigned int irq) 169 + static void disable_opsput_lanpld_irq(unsigned int irq) 171 170 { 172 171 unsigned long port, data; 173 172 unsigned int pldirq; ··· 178 177 outw(data, port); 179 178 } 180 179 181 - static void enable_m32700ut_lanpld_irq(unsigned int irq) 180 + static void enable_opsput_lanpld_irq(unsigned int irq) 182 181 { 183 182 unsigned long port, data; 184 183 unsigned int pldirq; ··· 189 188 outw(data, port); 190 189 } 191 190 192 - static void mask_and_ack_m32700ut_lanpld(unsigned int irq) 191 + static void mask_and_ack_opsput_lanpld(unsigned int irq) 193 192 { 194 - disable_m32700ut_lanpld_irq(irq); 193 + disable_opsput_lanpld_irq(irq); 195 194 } 196 195 197 - static void end_m32700ut_lanpld_irq(unsigned int irq) 196 + static void end_opsput_lanpld_irq(unsigned int irq) 198 197 { 199 - enable_m32700ut_lanpld_irq(irq); 200 - end_m32700ut_irq(M32R_IRQ_INT0); 198 + enable_opsput_lanpld_irq(irq); 199 + end_opsput_irq(M32R_IRQ_INT0); 201 200 } 202 201 203 - static unsigned int startup_m32700ut_lanpld_irq(unsigned int irq) 202 + static unsigned int startup_opsput_lanpld_irq(unsigned int irq) 204 203 { 205 - enable_m32700ut_lanpld_irq(irq); 204 + enable_opsput_lanpld_irq(irq); 206 205 return (0); 207 206 } 208 207 209 - static void shutdown_m32700ut_lanpld_irq(unsigned int irq) 208 + static void shutdown_opsput_lanpld_irq(unsigned int irq) 210 209 { 211 210 unsigned long port; 212 211 unsigned int pldirq; ··· 216 215 outw(PLD_ICUCR_ILEVEL7, port); 217 216 } 218 217 219 - static struct hw_interrupt_type m32700ut_lanpld_irq_type = 218 + static struct hw_interrupt_type opsput_lanpld_irq_type = 220 219 { 221 - .typename = "M32700UT-PLD-LAN-IRQ", 222 - .startup = startup_m32700ut_lanpld_irq, 223 - .shutdown = shutdown_m32700ut_lanpld_irq, 224 - .enable = enable_m32700ut_lanpld_irq, 225 - .disable = disable_m32700ut_lanpld_irq, 226 - .ack = mask_and_ack_m32700ut_lanpld, 227 - .end = end_m32700ut_lanpld_irq 220 + .typename = "OPSPUT-PLD-LAN-IRQ", 221 + .startup = startup_opsput_lanpld_irq, 222 + .shutdown = shutdown_opsput_lanpld_irq, 223 + .enable = enable_opsput_lanpld_irq, 224 + .disable = disable_opsput_lanpld_irq, 225 + .ack = mask_and_ack_opsput_lanpld, 226 + .end = end_opsput_lanpld_irq 228 227 }; 229 228 230 229 /* 231 - * Interrupt Control Unit of PLD on M32700UT-LCD (Level 2) 230 + * Interrupt Control Unit of PLD on OPSPUT-LCD (Level 2) 232 231 */ 233 - #define irq2lcdpldirq(x) ((x) - M32700UT_LCD_PLD_IRQ_BASE) 234 - #define lcdpldirq2port(x) (unsigned long)((int)M32700UT_LCD_ICUCR1 + \ 232 + #define irq2lcdpldirq(x) ((x) - OPSPUT_LCD_PLD_IRQ_BASE) 233 + #define lcdpldirq2port(x) (unsigned long)((int)OPSPUT_LCD_ICUCR1 + \ 235 234 (((x) - 1) * sizeof(unsigned short))) 236 235 237 - static pld_icu_data_t lcdpld_icu_data[M32700UT_NUM_LCD_PLD_IRQ]; 236 + static pld_icu_data_t lcdpld_icu_data[OPSPUT_NUM_LCD_PLD_IRQ]; 238 237 239 - static void disable_m32700ut_lcdpld_irq(unsigned int irq) 238 + static void disable_opsput_lcdpld_irq(unsigned int irq) 240 239 { 241 240 unsigned long port, data; 242 241 unsigned int pldirq; ··· 247 246 outw(data, port); 248 247 } 249 248 250 - static void enable_m32700ut_lcdpld_irq(unsigned int irq) 249 + static void enable_opsput_lcdpld_irq(unsigned int irq) 251 250 { 252 251 unsigned long port, data; 253 252 unsigned int pldirq; ··· 258 257 outw(data, port); 259 258 } 260 259 261 - static void mask_and_ack_m32700ut_lcdpld(unsigned int irq) 260 + static void mask_and_ack_opsput_lcdpld(unsigned int irq) 262 261 { 263 - disable_m32700ut_lcdpld_irq(irq); 262 + disable_opsput_lcdpld_irq(irq); 264 263 } 265 264 266 - static void end_m32700ut_lcdpld_irq(unsigned int irq) 265 + static void end_opsput_lcdpld_irq(unsigned int irq) 267 266 { 268 - enable_m32700ut_lcdpld_irq(irq); 269 - end_m32700ut_irq(M32R_IRQ_INT2); 267 + enable_opsput_lcdpld_irq(irq); 268 + end_opsput_irq(M32R_IRQ_INT2); 270 269 } 271 270 272 - static unsigned int startup_m32700ut_lcdpld_irq(unsigned int irq) 271 + static unsigned int startup_opsput_lcdpld_irq(unsigned int irq) 273 272 { 274 - enable_m32700ut_lcdpld_irq(irq); 273 + enable_opsput_lcdpld_irq(irq); 275 274 return (0); 276 275 } 277 276 278 - static void shutdown_m32700ut_lcdpld_irq(unsigned int irq) 277 + static void shutdown_opsput_lcdpld_irq(unsigned int irq) 279 278 { 280 279 unsigned long port; 281 280 unsigned int pldirq; ··· 285 284 outw(PLD_ICUCR_ILEVEL7, port); 286 285 } 287 286 288 - static struct hw_interrupt_type m32700ut_lcdpld_irq_type = 287 + static struct hw_interrupt_type opsput_lcdpld_irq_type = 289 288 { 290 - .typename = "M32700UT-PLD-LCD-IRQ", 291 - .startup = startup_m32700ut_lcdpld_irq, 292 - .shutdown = shutdown_m32700ut_lcdpld_irq, 293 - .enable = enable_m32700ut_lcdpld_irq, 294 - .disable = disable_m32700ut_lcdpld_irq, 295 - .ack = mask_and_ack_m32700ut_lcdpld, 296 - .end = end_m32700ut_lcdpld_irq 289 + "OPSPUT-PLD-LCD-IRQ", 290 + startup_opsput_lcdpld_irq, 291 + shutdown_opsput_lcdpld_irq, 292 + enable_opsput_lcdpld_irq, 293 + disable_opsput_lcdpld_irq, 294 + mask_and_ack_opsput_lcdpld, 295 + end_opsput_lcdpld_irq 297 296 }; 298 297 299 298 void __init init_IRQ(void) 300 299 { 301 300 #if defined(CONFIG_SMC91X) 302 - /* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/ 303 - irq_desc[M32700UT_LAN_IRQ_LAN].status = IRQ_DISABLED; 304 - irq_desc[M32700UT_LAN_IRQ_LAN].chip = &m32700ut_lanpld_irq_type; 305 - irq_desc[M32700UT_LAN_IRQ_LAN].action = 0; 306 - irq_desc[M32700UT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */ 307 - lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ 308 - disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN); 301 + /* INT#0: LAN controller on OPSPUT-LAN (SMC91C111)*/ 302 + irq_desc[OPSPUT_LAN_IRQ_LAN].status = IRQ_DISABLED; 303 + irq_desc[OPSPUT_LAN_IRQ_LAN].chip = &opsput_lanpld_irq_type; 304 + irq_desc[OPSPUT_LAN_IRQ_LAN].action = 0; 305 + irq_desc[OPSPUT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */ 306 + lanpld_icu_data[irq2lanpldirq(OPSPUT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ 307 + disable_opsput_lanpld_irq(OPSPUT_LAN_IRQ_LAN); 309 308 #endif /* CONFIG_SMC91X */ 310 309 311 310 /* MFT2 : system timer */ 312 311 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 313 - irq_desc[M32R_IRQ_MFT2].chip = &m32700ut_irq_type; 312 + irq_desc[M32R_IRQ_MFT2].chip = &opsput_irq_type; 314 313 irq_desc[M32R_IRQ_MFT2].action = 0; 315 314 irq_desc[M32R_IRQ_MFT2].depth = 1; 316 315 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 317 - disable_m32700ut_irq(M32R_IRQ_MFT2); 316 + disable_opsput_irq(M32R_IRQ_MFT2); 318 317 319 318 /* SIO0 : receive */ 320 319 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 321 - irq_desc[M32R_IRQ_SIO0_R].chip = &m32700ut_irq_type; 320 + irq_desc[M32R_IRQ_SIO0_R].chip = &opsput_irq_type; 322 321 irq_desc[M32R_IRQ_SIO0_R].action = 0; 323 322 irq_desc[M32R_IRQ_SIO0_R].depth = 1; 324 323 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 325 - disable_m32700ut_irq(M32R_IRQ_SIO0_R); 324 + disable_opsput_irq(M32R_IRQ_SIO0_R); 326 325 327 326 /* SIO0 : send */ 328 327 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 329 - irq_desc[M32R_IRQ_SIO0_S].chip = &m32700ut_irq_type; 328 + irq_desc[M32R_IRQ_SIO0_S].chip = &opsput_irq_type; 330 329 irq_desc[M32R_IRQ_SIO0_S].action = 0; 331 330 irq_desc[M32R_IRQ_SIO0_S].depth = 1; 332 331 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 333 - disable_m32700ut_irq(M32R_IRQ_SIO0_S); 332 + disable_opsput_irq(M32R_IRQ_SIO0_S); 334 333 335 334 /* SIO1 : receive */ 336 335 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 337 - irq_desc[M32R_IRQ_SIO1_R].chip = &m32700ut_irq_type; 336 + irq_desc[M32R_IRQ_SIO1_R].chip = &opsput_irq_type; 338 337 irq_desc[M32R_IRQ_SIO1_R].action = 0; 339 338 irq_desc[M32R_IRQ_SIO1_R].depth = 1; 340 339 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 341 - disable_m32700ut_irq(M32R_IRQ_SIO1_R); 340 + disable_opsput_irq(M32R_IRQ_SIO1_R); 342 341 343 342 /* SIO1 : send */ 344 343 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 345 - irq_desc[M32R_IRQ_SIO1_S].chip = &m32700ut_irq_type; 344 + irq_desc[M32R_IRQ_SIO1_S].chip = &opsput_irq_type; 346 345 irq_desc[M32R_IRQ_SIO1_S].action = 0; 347 346 irq_desc[M32R_IRQ_SIO1_S].depth = 1; 348 347 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 349 - disable_m32700ut_irq(M32R_IRQ_SIO1_S); 348 + disable_opsput_irq(M32R_IRQ_SIO1_S); 350 349 351 350 /* DMA1 : */ 352 351 irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED; 353 - irq_desc[M32R_IRQ_DMA1].chip = &m32700ut_irq_type; 352 + irq_desc[M32R_IRQ_DMA1].chip = &opsput_irq_type; 354 353 irq_desc[M32R_IRQ_DMA1].action = 0; 355 354 irq_desc[M32R_IRQ_DMA1].depth = 1; 356 355 icu_data[M32R_IRQ_DMA1].icucr = 0; 357 - disable_m32700ut_irq(M32R_IRQ_DMA1); 356 + disable_opsput_irq(M32R_IRQ_DMA1); 358 357 359 358 #ifdef CONFIG_SERIAL_M32R_PLDSIO 360 359 /* INT#1: SIO0 Receive on PLD */ 361 360 irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED; 362 - irq_desc[PLD_IRQ_SIO0_RCV].chip = &m32700ut_pld_irq_type; 361 + irq_desc[PLD_IRQ_SIO0_RCV].chip = &opsput_pld_irq_type; 363 362 irq_desc[PLD_IRQ_SIO0_RCV].action = 0; 364 363 irq_desc[PLD_IRQ_SIO0_RCV].depth = 1; /* disable nested irq */ 365 364 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 366 - disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV); 365 + disable_opsput_pld_irq(PLD_IRQ_SIO0_RCV); 367 366 368 367 /* INT#1: SIO0 Send on PLD */ 369 368 irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED; 370 - irq_desc[PLD_IRQ_SIO0_SND].chip = &m32700ut_pld_irq_type; 369 + irq_desc[PLD_IRQ_SIO0_SND].chip = &opsput_pld_irq_type; 371 370 irq_desc[PLD_IRQ_SIO0_SND].action = 0; 372 371 irq_desc[PLD_IRQ_SIO0_SND].depth = 1; /* disable nested irq */ 373 372 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 374 - disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND); 373 + disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); 375 374 #endif /* CONFIG_SERIAL_M32R_PLDSIO */ 376 375 377 376 /* INT#1: CFC IREQ on PLD */ 378 377 irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 379 - irq_desc[PLD_IRQ_CFIREQ].chip = &m32700ut_pld_irq_type; 378 + irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; 380 379 irq_desc[PLD_IRQ_CFIREQ].action = 0; 381 380 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 382 381 pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */ 383 - disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ); 382 + disable_opsput_pld_irq(PLD_IRQ_CFIREQ); 384 383 385 384 /* INT#1: CFC Insert on PLD */ 386 385 irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 387 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &m32700ut_pld_irq_type; 386 + irq_desc[PLD_IRQ_CFC_INSERT].chip = &opsput_pld_irq_type; 388 387 irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 389 388 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 390 389 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */ 391 - disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT); 390 + disable_opsput_pld_irq(PLD_IRQ_CFC_INSERT); 392 391 393 392 /* INT#1: CFC Eject on PLD */ 394 393 irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 395 - irq_desc[PLD_IRQ_CFC_EJECT].chip = &m32700ut_pld_irq_type; 394 + irq_desc[PLD_IRQ_CFC_EJECT].chip = &opsput_pld_irq_type; 396 395 irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 397 396 irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 398 397 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ 399 - disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT); 398 + disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); 400 399 401 400 /* 402 401 * INT0# is used for LAN, DIO 403 402 * We enable it here. 404 403 */ 405 404 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; 406 - enable_m32700ut_irq(M32R_IRQ_INT0); 405 + enable_opsput_irq(M32R_IRQ_INT0); 407 406 408 407 /* 409 408 * INT1# is used for UART, MMC, CF Controller in FPGA. 410 409 * We enable it here. 411 410 */ 412 411 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; 413 - enable_m32700ut_irq(M32R_IRQ_INT1); 412 + enable_opsput_irq(M32R_IRQ_INT1); 414 413 415 414 #if defined(CONFIG_USB) 416 415 outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ 417 416 418 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED; 419 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].chip = &m32700ut_lcdpld_irq_type; 420 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].action = 0; 421 - irq_desc[M32700UT_LCD_IRQ_USB_INT1].depth = 1; 422 - lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 423 - disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1); 417 + irq_desc[OPSPUT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED; 418 + irq_desc[OPSPUT_LCD_IRQ_USB_INT1].chip = &opsput_lcdpld_irq_type; 419 + irq_desc[OPSPUT_LCD_IRQ_USB_INT1].action = 0; 420 + irq_desc[OPSPUT_LCD_IRQ_USB_INT1].depth = 1; 421 + lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 422 + disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1); 424 423 #endif 425 424 /* 426 425 * INT2# is used for BAT, USB, AUDIO 427 426 * We enable it here. 428 427 */ 429 428 icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 430 - enable_m32700ut_irq(M32R_IRQ_INT2); 429 + enable_opsput_irq(M32R_IRQ_INT2); 431 430 432 431 #if defined(CONFIG_VIDEO_M32R_AR) 433 432 /* 434 433 * INT3# is used for AR 435 434 */ 436 435 irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED; 437 - irq_desc[M32R_IRQ_INT3].chip = &m32700ut_irq_type; 436 + irq_desc[M32R_IRQ_INT3].chip = &opsput_irq_type; 438 437 irq_desc[M32R_IRQ_INT3].action = 0; 439 438 irq_desc[M32R_IRQ_INT3].depth = 1; 440 439 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 441 - disable_m32700ut_irq(M32R_IRQ_INT3); 442 - #endif /* CONFIG_VIDEO_M32R_AR */ 440 + disable_opsput_irq(M32R_IRQ_INT3); 441 + #endif /* CONFIG_VIDEO_M32R_AR */ 443 442 } 444 443 445 444 #if defined(CONFIG_SMC91X) ··· 453 452 .flags = IORESOURCE_MEM, 454 453 }, 455 454 [1] = { 456 - .start = M32700UT_LAN_IRQ_LAN, 457 - .end = M32700UT_LAN_IRQ_LAN, 455 + .start = OPSPUT_LAN_IRQ_LAN, 456 + .end = OPSPUT_LAN_IRQ_LAN, 458 457 .flags = IORESOURCE_IRQ, 459 458 } 460 459 };
+1 -1
arch/m32r/kernel/setup_mappi.c arch/m32r/platforms/mappi/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_mappi.c 2 + * linux/arch/m32r/platforms/mappi/setup.c 3 3 * 4 4 * Setup routines for Renesas MAPPI Board 5 5 *
+97 -47
arch/m32r/kernel/setup_mappi2.c arch/m32r/platforms/mappi3/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_mappi2.c 2 + * linux/arch/m32r/platforms/mappi3/setup.c 3 3 * 4 - * Setup routines for Renesas MAPPI-II(M3A-ZA36) Board 4 + * Setup routines for Renesas MAPPI-III(M3A-2170) Board 5 5 * 6 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, 7 7 * Hitoshi Yamamoto, Mamoru Sakugawa ··· 20 20 21 21 icu_data_t icu_data[NR_IRQS]; 22 22 23 - static void disable_mappi2_irq(unsigned int irq) 23 + static void disable_mappi3_irq(unsigned int irq) 24 24 { 25 25 unsigned long port, data; 26 26 ··· 33 33 outl(data, port); 34 34 } 35 35 36 - static void enable_mappi2_irq(unsigned int irq) 36 + static void enable_mappi3_irq(unsigned int irq) 37 37 { 38 38 unsigned long port, data; 39 39 ··· 46 46 outl(data, port); 47 47 } 48 48 49 - static void mask_and_ack_mappi2(unsigned int irq) 49 + static void mask_and_ack_mappi3(unsigned int irq) 50 50 { 51 - disable_mappi2_irq(irq); 51 + disable_mappi3_irq(irq); 52 52 } 53 53 54 - static void end_mappi2_irq(unsigned int irq) 54 + static void end_mappi3_irq(unsigned int irq) 55 55 { 56 - enable_mappi2_irq(irq); 56 + enable_mappi3_irq(irq); 57 57 } 58 58 59 - static unsigned int startup_mappi2_irq(unsigned int irq) 59 + static unsigned int startup_mappi3_irq(unsigned int irq) 60 60 { 61 - enable_mappi2_irq(irq); 61 + enable_mappi3_irq(irq); 62 62 return (0); 63 63 } 64 64 65 - static void shutdown_mappi2_irq(unsigned int irq) 65 + static void shutdown_mappi3_irq(unsigned int irq) 66 66 { 67 67 unsigned long port; 68 68 ··· 70 70 outl(M32R_ICUCR_ILEVEL7, port); 71 71 } 72 72 73 - static struct hw_interrupt_type mappi2_irq_type = 73 + static struct hw_interrupt_type mappi3_irq_type = 74 74 { 75 - .typename = "MAPPI2-IRQ", 76 - .startup = startup_mappi2_irq, 77 - .shutdown = shutdown_mappi2_irq, 78 - .enable = enable_mappi2_irq, 79 - .disable = disable_mappi2_irq, 80 - .ack = mask_and_ack_mappi2, 81 - .end = end_mappi2_irq 75 + .typename = "MAPPI3-IRQ", 76 + .startup = startup_mappi3_irq, 77 + .shutdown = shutdown_mappi3_irq, 78 + .enable = enable_mappi3_irq, 79 + .disable = disable_mappi3_irq, 80 + .ack = mask_and_ack_mappi3, 81 + .end = end_mappi3_irq 82 82 }; 83 83 84 84 void __init init_IRQ(void) ··· 86 86 #if defined(CONFIG_SMC91X) 87 87 /* INT0 : LAN controller (SMC91111) */ 88 88 irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; 89 - irq_desc[M32R_IRQ_INT0].chip = &mappi2_irq_type; 89 + irq_desc[M32R_IRQ_INT0].chip = &mappi3_irq_type; 90 90 irq_desc[M32R_IRQ_INT0].action = 0; 91 91 irq_desc[M32R_IRQ_INT0].depth = 1; 92 92 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 93 - disable_mappi2_irq(M32R_IRQ_INT0); 93 + disable_mappi3_irq(M32R_IRQ_INT0); 94 94 #endif /* CONFIG_SMC91X */ 95 95 96 96 /* MFT2 : system timer */ 97 97 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 98 - irq_desc[M32R_IRQ_MFT2].chip = &mappi2_irq_type; 98 + irq_desc[M32R_IRQ_MFT2].chip = &mappi3_irq_type; 99 99 irq_desc[M32R_IRQ_MFT2].action = 0; 100 100 irq_desc[M32R_IRQ_MFT2].depth = 1; 101 101 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 102 - disable_mappi2_irq(M32R_IRQ_MFT2); 102 + disable_mappi3_irq(M32R_IRQ_MFT2); 103 103 104 104 #ifdef CONFIG_SERIAL_M32R_SIO 105 105 /* SIO0_R : uart receive data */ 106 106 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 107 - irq_desc[M32R_IRQ_SIO0_R].chip = &mappi2_irq_type; 107 + irq_desc[M32R_IRQ_SIO0_R].chip = &mappi3_irq_type; 108 108 irq_desc[M32R_IRQ_SIO0_R].action = 0; 109 109 irq_desc[M32R_IRQ_SIO0_R].depth = 1; 110 110 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 111 - disable_mappi2_irq(M32R_IRQ_SIO0_R); 111 + disable_mappi3_irq(M32R_IRQ_SIO0_R); 112 112 113 113 /* SIO0_S : uart send data */ 114 114 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 115 - irq_desc[M32R_IRQ_SIO0_S].chip = &mappi2_irq_type; 115 + irq_desc[M32R_IRQ_SIO0_S].chip = &mappi3_irq_type; 116 116 irq_desc[M32R_IRQ_SIO0_S].action = 0; 117 117 irq_desc[M32R_IRQ_SIO0_S].depth = 1; 118 118 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 119 - disable_mappi2_irq(M32R_IRQ_SIO0_S); 119 + disable_mappi3_irq(M32R_IRQ_SIO0_S); 120 120 /* SIO1_R : uart receive data */ 121 121 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 122 - irq_desc[M32R_IRQ_SIO1_R].chip = &mappi2_irq_type; 122 + irq_desc[M32R_IRQ_SIO1_R].chip = &mappi3_irq_type; 123 123 irq_desc[M32R_IRQ_SIO1_R].action = 0; 124 124 irq_desc[M32R_IRQ_SIO1_R].depth = 1; 125 125 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 126 - disable_mappi2_irq(M32R_IRQ_SIO1_R); 126 + disable_mappi3_irq(M32R_IRQ_SIO1_R); 127 127 128 128 /* SIO1_S : uart send data */ 129 129 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 130 - irq_desc[M32R_IRQ_SIO1_S].chip = &mappi2_irq_type; 130 + irq_desc[M32R_IRQ_SIO1_S].chip = &mappi3_irq_type; 131 131 irq_desc[M32R_IRQ_SIO1_S].action = 0; 132 132 irq_desc[M32R_IRQ_SIO1_S].depth = 1; 133 133 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 134 - disable_mappi2_irq(M32R_IRQ_SIO1_S); 134 + disable_mappi3_irq(M32R_IRQ_SIO1_S); 135 135 #endif /* CONFIG_M32R_USE_DBG_CONSOLE */ 136 136 137 137 #if defined(CONFIG_USB) 138 138 /* INT1 : USB Host controller interrupt */ 139 139 irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; 140 - irq_desc[M32R_IRQ_INT1].chip = &mappi2_irq_type; 140 + irq_desc[M32R_IRQ_INT1].chip = &mappi3_irq_type; 141 141 irq_desc[M32R_IRQ_INT1].action = 0; 142 142 irq_desc[M32R_IRQ_INT1].depth = 1; 143 143 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01; 144 - disable_mappi2_irq(M32R_IRQ_INT1); 144 + disable_mappi3_irq(M32R_IRQ_INT1); 145 145 #endif /* CONFIG_USB */ 146 146 147 - /* ICUCR40: CFC IREQ */ 147 + /* CFC IREQ */ 148 148 irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 149 - irq_desc[PLD_IRQ_CFIREQ].chip = &mappi2_irq_type; 149 + irq_desc[PLD_IRQ_CFIREQ].chip = &mappi3_irq_type; 150 150 irq_desc[PLD_IRQ_CFIREQ].action = 0; 151 151 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 152 152 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 153 - disable_mappi2_irq(PLD_IRQ_CFIREQ); 153 + disable_mappi3_irq(PLD_IRQ_CFIREQ); 154 154 155 155 #if defined(CONFIG_M32R_CFC) 156 - /* ICUCR41: CFC Insert */ 156 + /* ICUCR41: CFC Insert & eject */ 157 157 irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 158 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi2_irq_type; 158 + irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi3_irq_type; 159 159 irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 160 160 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 161 161 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; 162 - disable_mappi2_irq(PLD_IRQ_CFC_INSERT); 162 + disable_mappi3_irq(PLD_IRQ_CFC_INSERT); 163 163 164 - /* ICUCR42: CFC Eject */ 165 - irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 166 - irq_desc[PLD_IRQ_CFC_EJECT].chip = &mappi2_irq_type; 167 - irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 168 - irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 169 - icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 170 - disable_mappi2_irq(PLD_IRQ_CFC_EJECT); 171 - #endif /* CONFIG_MAPPI2_CFC */ 164 + #endif /* CONFIG_M32R_CFC */ 165 + 166 + /* IDE IREQ */ 167 + irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED; 168 + irq_desc[PLD_IRQ_IDEIREQ].chip = &mappi3_irq_type; 169 + irq_desc[PLD_IRQ_IDEIREQ].action = 0; 170 + irq_desc[PLD_IRQ_IDEIREQ].depth = 1; /* disable nested irq */ 171 + icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 172 + disable_mappi3_irq(PLD_IRQ_IDEIREQ); 173 + 172 174 } 175 + 176 + #if defined(CONFIG_SMC91X) 173 177 174 178 #define LAN_IOSTART 0x300 175 179 #define LAN_IOEND 0x320 ··· 197 193 .resource = smc91x_resources, 198 194 }; 199 195 196 + #endif 197 + 198 + #if defined(CONFIG_FB_S1D13XXX) 199 + 200 + #include <video/s1d13xxxfb.h> 201 + #include <asm/s1d13806.h> 202 + 203 + static struct s1d13xxxfb_pdata s1d13xxxfb_data = { 204 + .initregs = s1d13xxxfb_initregs, 205 + .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs), 206 + .platform_init_video = NULL, 207 + #ifdef CONFIG_PM 208 + .platform_suspend_video = NULL, 209 + .platform_resume_video = NULL, 210 + #endif 211 + }; 212 + 213 + static struct resource s1d13xxxfb_resources[] = { 214 + [0] = { 215 + .start = 0x1d600000UL, 216 + .end = 0x1d73FFFFUL, 217 + .flags = IORESOURCE_MEM, 218 + }, 219 + [1] = { 220 + .start = 0x1d400000UL, 221 + .end = 0x1d4001FFUL, 222 + .flags = IORESOURCE_MEM, 223 + } 224 + }; 225 + 226 + static struct platform_device s1d13xxxfb_device = { 227 + .name = S1D_DEVICENAME, 228 + .id = 0, 229 + .dev = { 230 + .platform_data = &s1d13xxxfb_data, 231 + }, 232 + .num_resources = ARRAY_SIZE(s1d13xxxfb_resources), 233 + .resource = s1d13xxxfb_resources, 234 + }; 235 + #endif 236 + 200 237 static int __init platform_init(void) 201 238 { 239 + #if defined(CONFIG_SMC91X) 202 240 platform_device_register(&smc91x_device); 241 + #endif 242 + #if defined(CONFIG_FB_S1D13XXX) 243 + platform_device_register(&s1d13xxxfb_device); 244 + #endif 203 245 return 0; 204 246 } 205 247 arch_initcall(platform_init);
+47 -97
arch/m32r/kernel/setup_mappi3.c arch/m32r/platforms/mappi2/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_mappi3.c 2 + * linux/arch/m32r/platforms/mappi2/setup.c 3 3 * 4 - * Setup routines for Renesas MAPPI-III(M3A-2170) Board 4 + * Setup routines for Renesas MAPPI-II(M3A-ZA36) Board 5 5 * 6 6 * Copyright (c) 2001-2005 Hiroyuki Kondo, Hirokazu Takata, 7 7 * Hitoshi Yamamoto, Mamoru Sakugawa ··· 20 20 21 21 icu_data_t icu_data[NR_IRQS]; 22 22 23 - static void disable_mappi3_irq(unsigned int irq) 23 + static void disable_mappi2_irq(unsigned int irq) 24 24 { 25 25 unsigned long port, data; 26 26 ··· 33 33 outl(data, port); 34 34 } 35 35 36 - static void enable_mappi3_irq(unsigned int irq) 36 + static void enable_mappi2_irq(unsigned int irq) 37 37 { 38 38 unsigned long port, data; 39 39 ··· 46 46 outl(data, port); 47 47 } 48 48 49 - static void mask_and_ack_mappi3(unsigned int irq) 49 + static void mask_and_ack_mappi2(unsigned int irq) 50 50 { 51 - disable_mappi3_irq(irq); 51 + disable_mappi2_irq(irq); 52 52 } 53 53 54 - static void end_mappi3_irq(unsigned int irq) 54 + static void end_mappi2_irq(unsigned int irq) 55 55 { 56 - enable_mappi3_irq(irq); 56 + enable_mappi2_irq(irq); 57 57 } 58 58 59 - static unsigned int startup_mappi3_irq(unsigned int irq) 59 + static unsigned int startup_mappi2_irq(unsigned int irq) 60 60 { 61 - enable_mappi3_irq(irq); 61 + enable_mappi2_irq(irq); 62 62 return (0); 63 63 } 64 64 65 - static void shutdown_mappi3_irq(unsigned int irq) 65 + static void shutdown_mappi2_irq(unsigned int irq) 66 66 { 67 67 unsigned long port; 68 68 ··· 70 70 outl(M32R_ICUCR_ILEVEL7, port); 71 71 } 72 72 73 - static struct hw_interrupt_type mappi3_irq_type = 73 + static struct hw_interrupt_type mappi2_irq_type = 74 74 { 75 - .typename = "MAPPI3-IRQ", 76 - .startup = startup_mappi3_irq, 77 - .shutdown = shutdown_mappi3_irq, 78 - .enable = enable_mappi3_irq, 79 - .disable = disable_mappi3_irq, 80 - .ack = mask_and_ack_mappi3, 81 - .end = end_mappi3_irq 75 + .typename = "MAPPI2-IRQ", 76 + .startup = startup_mappi2_irq, 77 + .shutdown = shutdown_mappi2_irq, 78 + .enable = enable_mappi2_irq, 79 + .disable = disable_mappi2_irq, 80 + .ack = mask_and_ack_mappi2, 81 + .end = end_mappi2_irq 82 82 }; 83 83 84 84 void __init init_IRQ(void) ··· 86 86 #if defined(CONFIG_SMC91X) 87 87 /* INT0 : LAN controller (SMC91111) */ 88 88 irq_desc[M32R_IRQ_INT0].status = IRQ_DISABLED; 89 - irq_desc[M32R_IRQ_INT0].chip = &mappi3_irq_type; 89 + irq_desc[M32R_IRQ_INT0].chip = &mappi2_irq_type; 90 90 irq_desc[M32R_IRQ_INT0].action = 0; 91 91 irq_desc[M32R_IRQ_INT0].depth = 1; 92 92 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 93 - disable_mappi3_irq(M32R_IRQ_INT0); 93 + disable_mappi2_irq(M32R_IRQ_INT0); 94 94 #endif /* CONFIG_SMC91X */ 95 95 96 96 /* MFT2 : system timer */ 97 97 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 98 - irq_desc[M32R_IRQ_MFT2].chip = &mappi3_irq_type; 98 + irq_desc[M32R_IRQ_MFT2].chip = &mappi2_irq_type; 99 99 irq_desc[M32R_IRQ_MFT2].action = 0; 100 100 irq_desc[M32R_IRQ_MFT2].depth = 1; 101 101 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 102 - disable_mappi3_irq(M32R_IRQ_MFT2); 102 + disable_mappi2_irq(M32R_IRQ_MFT2); 103 103 104 104 #ifdef CONFIG_SERIAL_M32R_SIO 105 105 /* SIO0_R : uart receive data */ 106 106 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 107 - irq_desc[M32R_IRQ_SIO0_R].chip = &mappi3_irq_type; 107 + irq_desc[M32R_IRQ_SIO0_R].chip = &mappi2_irq_type; 108 108 irq_desc[M32R_IRQ_SIO0_R].action = 0; 109 109 irq_desc[M32R_IRQ_SIO0_R].depth = 1; 110 110 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 111 - disable_mappi3_irq(M32R_IRQ_SIO0_R); 111 + disable_mappi2_irq(M32R_IRQ_SIO0_R); 112 112 113 113 /* SIO0_S : uart send data */ 114 114 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 115 - irq_desc[M32R_IRQ_SIO0_S].chip = &mappi3_irq_type; 115 + irq_desc[M32R_IRQ_SIO0_S].chip = &mappi2_irq_type; 116 116 irq_desc[M32R_IRQ_SIO0_S].action = 0; 117 117 irq_desc[M32R_IRQ_SIO0_S].depth = 1; 118 118 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 119 - disable_mappi3_irq(M32R_IRQ_SIO0_S); 119 + disable_mappi2_irq(M32R_IRQ_SIO0_S); 120 120 /* SIO1_R : uart receive data */ 121 121 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 122 - irq_desc[M32R_IRQ_SIO1_R].chip = &mappi3_irq_type; 122 + irq_desc[M32R_IRQ_SIO1_R].chip = &mappi2_irq_type; 123 123 irq_desc[M32R_IRQ_SIO1_R].action = 0; 124 124 irq_desc[M32R_IRQ_SIO1_R].depth = 1; 125 125 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 126 - disable_mappi3_irq(M32R_IRQ_SIO1_R); 126 + disable_mappi2_irq(M32R_IRQ_SIO1_R); 127 127 128 128 /* SIO1_S : uart send data */ 129 129 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 130 - irq_desc[M32R_IRQ_SIO1_S].chip = &mappi3_irq_type; 130 + irq_desc[M32R_IRQ_SIO1_S].chip = &mappi2_irq_type; 131 131 irq_desc[M32R_IRQ_SIO1_S].action = 0; 132 132 irq_desc[M32R_IRQ_SIO1_S].depth = 1; 133 133 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 134 - disable_mappi3_irq(M32R_IRQ_SIO1_S); 134 + disable_mappi2_irq(M32R_IRQ_SIO1_S); 135 135 #endif /* CONFIG_M32R_USE_DBG_CONSOLE */ 136 136 137 137 #if defined(CONFIG_USB) 138 138 /* INT1 : USB Host controller interrupt */ 139 139 irq_desc[M32R_IRQ_INT1].status = IRQ_DISABLED; 140 - irq_desc[M32R_IRQ_INT1].chip = &mappi3_irq_type; 140 + irq_desc[M32R_IRQ_INT1].chip = &mappi2_irq_type; 141 141 irq_desc[M32R_IRQ_INT1].action = 0; 142 142 irq_desc[M32R_IRQ_INT1].depth = 1; 143 143 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD01; 144 - disable_mappi3_irq(M32R_IRQ_INT1); 144 + disable_mappi2_irq(M32R_IRQ_INT1); 145 145 #endif /* CONFIG_USB */ 146 146 147 - /* CFC IREQ */ 147 + /* ICUCR40: CFC IREQ */ 148 148 irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 149 - irq_desc[PLD_IRQ_CFIREQ].chip = &mappi3_irq_type; 149 + irq_desc[PLD_IRQ_CFIREQ].chip = &mappi2_irq_type; 150 150 irq_desc[PLD_IRQ_CFIREQ].action = 0; 151 151 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 152 152 icu_data[PLD_IRQ_CFIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 153 - disable_mappi3_irq(PLD_IRQ_CFIREQ); 153 + disable_mappi2_irq(PLD_IRQ_CFIREQ); 154 154 155 155 #if defined(CONFIG_M32R_CFC) 156 - /* ICUCR41: CFC Insert & eject */ 156 + /* ICUCR41: CFC Insert */ 157 157 irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 158 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi3_irq_type; 158 + irq_desc[PLD_IRQ_CFC_INSERT].chip = &mappi2_irq_type; 159 159 irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 160 160 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 161 161 icu_data[PLD_IRQ_CFC_INSERT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD00; 162 - disable_mappi3_irq(PLD_IRQ_CFC_INSERT); 162 + disable_mappi2_irq(PLD_IRQ_CFC_INSERT); 163 163 164 - #endif /* CONFIG_M32R_CFC */ 165 - 166 - /* IDE IREQ */ 167 - irq_desc[PLD_IRQ_IDEIREQ].status = IRQ_DISABLED; 168 - irq_desc[PLD_IRQ_IDEIREQ].chip = &mappi3_irq_type; 169 - irq_desc[PLD_IRQ_IDEIREQ].action = 0; 170 - irq_desc[PLD_IRQ_IDEIREQ].depth = 1; /* disable nested irq */ 171 - icu_data[PLD_IRQ_IDEIREQ].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 172 - disable_mappi3_irq(PLD_IRQ_IDEIREQ); 173 - 164 + /* ICUCR42: CFC Eject */ 165 + irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 166 + irq_desc[PLD_IRQ_CFC_EJECT].chip = &mappi2_irq_type; 167 + irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 168 + irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 169 + icu_data[PLD_IRQ_CFC_EJECT].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 170 + disable_mappi2_irq(PLD_IRQ_CFC_EJECT); 171 + #endif /* CONFIG_MAPPI2_CFC */ 174 172 } 175 - 176 - #if defined(CONFIG_SMC91X) 177 173 178 174 #define LAN_IOSTART 0x300 179 175 #define LAN_IOEND 0x320 ··· 193 197 .resource = smc91x_resources, 194 198 }; 195 199 196 - #endif 197 - 198 - #if defined(CONFIG_FB_S1D13XXX) 199 - 200 - #include <video/s1d13xxxfb.h> 201 - #include <asm/s1d13806.h> 202 - 203 - static struct s1d13xxxfb_pdata s1d13xxxfb_data = { 204 - .initregs = s1d13xxxfb_initregs, 205 - .initregssize = ARRAY_SIZE(s1d13xxxfb_initregs), 206 - .platform_init_video = NULL, 207 - #ifdef CONFIG_PM 208 - .platform_suspend_video = NULL, 209 - .platform_resume_video = NULL, 210 - #endif 211 - }; 212 - 213 - static struct resource s1d13xxxfb_resources[] = { 214 - [0] = { 215 - .start = 0x1d600000UL, 216 - .end = 0x1d73FFFFUL, 217 - .flags = IORESOURCE_MEM, 218 - }, 219 - [1] = { 220 - .start = 0x1d400000UL, 221 - .end = 0x1d4001FFUL, 222 - .flags = IORESOURCE_MEM, 223 - } 224 - }; 225 - 226 - static struct platform_device s1d13xxxfb_device = { 227 - .name = S1D_DEVICENAME, 228 - .id = 0, 229 - .dev = { 230 - .platform_data = &s1d13xxxfb_data, 231 - }, 232 - .num_resources = ARRAY_SIZE(s1d13xxxfb_resources), 233 - .resource = s1d13xxxfb_resources, 234 - }; 235 - #endif 236 - 237 200 static int __init platform_init(void) 238 201 { 239 - #if defined(CONFIG_SMC91X) 240 202 platform_device_register(&smc91x_device); 241 - #endif 242 - #if defined(CONFIG_FB_S1D13XXX) 243 - platform_device_register(&s1d13xxxfb_device); 244 - #endif 245 203 return 0; 246 204 } 247 205 arch_initcall(platform_init);
+1 -1
arch/m32r/kernel/setup_oaks32r.c arch/m32r/platforms/oaks32r/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_oaks32r.c 2 + * linux/arch/m32r/platforms/oaks32r/setup.c 3 3 * 4 4 * Setup routines for OAKS32R Board 5 5 *
+135 -136
arch/m32r/kernel/setup_opsput.c arch/m32r/platforms/m32700ut/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_opsput.c 2 + * linux/arch/m32r/platforms/m32700ut/setup.c 3 3 * 4 - * Setup routines for Renesas OPSPUT Board 4 + * Setup routines for Renesas M32700UT Board 5 5 * 6 - * Copyright (c) 2002-2005 7 - * Hiroyuki Kondo, Hirokazu Takata, 8 - * Hitoshi Yamamoto, Takeo Takahashi, Mamoru Sakugawa 6 + * Copyright (c) 2002-2005 Hiroyuki Kondo, Hirokazu Takata, 7 + * Hitoshi Yamamoto, Takeo Takahashi 9 8 * 10 9 * This file is subject to the terms and conditions of the GNU General 11 10 * Public License. See the file "COPYING" in the main directory of this ··· 21 22 #include <asm/io.h> 22 23 23 24 /* 24 - * OPSP Interrupt Control Unit (Level 1) 25 + * M32700 Interrupt Control Unit (Level 1) 25 26 */ 26 27 #define irq2port(x) (M32R_ICU_CR1_PORTL + ((x - 1) * sizeof(unsigned long))) 27 28 28 - icu_data_t icu_data[OPSPUT_NUM_CPU_IRQ]; 29 + icu_data_t icu_data[M32700UT_NUM_CPU_IRQ]; 29 30 30 - static void disable_opsput_irq(unsigned int irq) 31 + static void disable_m32700ut_irq(unsigned int irq) 31 32 { 32 33 unsigned long port, data; 33 34 ··· 36 37 outl(data, port); 37 38 } 38 39 39 - static void enable_opsput_irq(unsigned int irq) 40 + static void enable_m32700ut_irq(unsigned int irq) 40 41 { 41 42 unsigned long port, data; 42 43 ··· 45 46 outl(data, port); 46 47 } 47 48 48 - static void mask_and_ack_opsput(unsigned int irq) 49 + static void mask_and_ack_m32700ut(unsigned int irq) 49 50 { 50 - disable_opsput_irq(irq); 51 + disable_m32700ut_irq(irq); 51 52 } 52 53 53 - static void end_opsput_irq(unsigned int irq) 54 + static void end_m32700ut_irq(unsigned int irq) 54 55 { 55 - enable_opsput_irq(irq); 56 + enable_m32700ut_irq(irq); 56 57 } 57 58 58 - static unsigned int startup_opsput_irq(unsigned int irq) 59 + static unsigned int startup_m32700ut_irq(unsigned int irq) 59 60 { 60 - enable_opsput_irq(irq); 61 + enable_m32700ut_irq(irq); 61 62 return (0); 62 63 } 63 64 64 - static void shutdown_opsput_irq(unsigned int irq) 65 + static void shutdown_m32700ut_irq(unsigned int irq) 65 66 { 66 67 unsigned long port; 67 68 ··· 69 70 outl(M32R_ICUCR_ILEVEL7, port); 70 71 } 71 72 72 - static struct hw_interrupt_type opsput_irq_type = 73 + static struct hw_interrupt_type m32700ut_irq_type = 73 74 { 74 - .typename = "OPSPUT-IRQ", 75 - .startup = startup_opsput_irq, 76 - .shutdown = shutdown_opsput_irq, 77 - .enable = enable_opsput_irq, 78 - .disable = disable_opsput_irq, 79 - .ack = mask_and_ack_opsput, 80 - .end = end_opsput_irq 75 + .typename = "M32700UT-IRQ", 76 + .startup = startup_m32700ut_irq, 77 + .shutdown = shutdown_m32700ut_irq, 78 + .enable = enable_m32700ut_irq, 79 + .disable = disable_m32700ut_irq, 80 + .ack = mask_and_ack_m32700ut, 81 + .end = end_m32700ut_irq 81 82 }; 82 83 83 84 /* 84 - * Interrupt Control Unit of PLD on OPSPUT (Level 2) 85 + * Interrupt Control Unit of PLD on M32700UT (Level 2) 85 86 */ 86 - #define irq2pldirq(x) ((x) - OPSPUT_PLD_IRQ_BASE) 87 + #define irq2pldirq(x) ((x) - M32700UT_PLD_IRQ_BASE) 87 88 #define pldirq2port(x) (unsigned long)((int)PLD_ICUCR1 + \ 88 89 (((x) - 1) * sizeof(unsigned short))) 89 90 ··· 91 92 unsigned short icucr; /* ICU Control Register */ 92 93 } pld_icu_data_t; 93 94 94 - static pld_icu_data_t pld_icu_data[OPSPUT_NUM_PLD_IRQ]; 95 + static pld_icu_data_t pld_icu_data[M32700UT_NUM_PLD_IRQ]; 95 96 96 - static void disable_opsput_pld_irq(unsigned int irq) 97 + static void disable_m32700ut_pld_irq(unsigned int irq) 97 98 { 98 99 unsigned long port, data; 99 100 unsigned int pldirq; 100 101 101 102 pldirq = irq2pldirq(irq); 102 - // disable_opsput_irq(M32R_IRQ_INT1); 103 + // disable_m32700ut_irq(M32R_IRQ_INT1); 103 104 port = pldirq2port(pldirq); 104 105 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_ILEVEL7; 105 106 outw(data, port); 106 107 } 107 108 108 - static void enable_opsput_pld_irq(unsigned int irq) 109 + static void enable_m32700ut_pld_irq(unsigned int irq) 109 110 { 110 111 unsigned long port, data; 111 112 unsigned int pldirq; 112 113 113 114 pldirq = irq2pldirq(irq); 114 - // enable_opsput_irq(M32R_IRQ_INT1); 115 + // enable_m32700ut_irq(M32R_IRQ_INT1); 115 116 port = pldirq2port(pldirq); 116 117 data = pld_icu_data[pldirq].icucr|PLD_ICUCR_IEN|PLD_ICUCR_ILEVEL6; 117 118 outw(data, port); 118 119 } 119 120 120 - static void mask_and_ack_opsput_pld(unsigned int irq) 121 + static void mask_and_ack_m32700ut_pld(unsigned int irq) 121 122 { 122 - disable_opsput_pld_irq(irq); 123 - // mask_and_ack_opsput(M32R_IRQ_INT1); 123 + disable_m32700ut_pld_irq(irq); 124 + // mask_and_ack_m32700ut(M32R_IRQ_INT1); 124 125 } 125 126 126 - static void end_opsput_pld_irq(unsigned int irq) 127 + static void end_m32700ut_pld_irq(unsigned int irq) 127 128 { 128 - enable_opsput_pld_irq(irq); 129 - end_opsput_irq(M32R_IRQ_INT1); 129 + enable_m32700ut_pld_irq(irq); 130 + end_m32700ut_irq(M32R_IRQ_INT1); 130 131 } 131 132 132 - static unsigned int startup_opsput_pld_irq(unsigned int irq) 133 + static unsigned int startup_m32700ut_pld_irq(unsigned int irq) 133 134 { 134 - enable_opsput_pld_irq(irq); 135 + enable_m32700ut_pld_irq(irq); 135 136 return (0); 136 137 } 137 138 138 - static void shutdown_opsput_pld_irq(unsigned int irq) 139 + static void shutdown_m32700ut_pld_irq(unsigned int irq) 139 140 { 140 141 unsigned long port; 141 142 unsigned int pldirq; 142 143 143 144 pldirq = irq2pldirq(irq); 144 - // shutdown_opsput_irq(M32R_IRQ_INT1); 145 + // shutdown_m32700ut_irq(M32R_IRQ_INT1); 145 146 port = pldirq2port(pldirq); 146 147 outw(PLD_ICUCR_ILEVEL7, port); 147 148 } 148 149 149 - static struct hw_interrupt_type opsput_pld_irq_type = 150 + static struct hw_interrupt_type m32700ut_pld_irq_type = 150 151 { 151 - .typename = "OPSPUT-PLD-IRQ", 152 - .startup = startup_opsput_pld_irq, 153 - .shutdown = shutdown_opsput_pld_irq, 154 - .enable = enable_opsput_pld_irq, 155 - .disable = disable_opsput_pld_irq, 156 - .ack = mask_and_ack_opsput_pld, 157 - .end = end_opsput_pld_irq 152 + .typename = "M32700UT-PLD-IRQ", 153 + .startup = startup_m32700ut_pld_irq, 154 + .shutdown = shutdown_m32700ut_pld_irq, 155 + .enable = enable_m32700ut_pld_irq, 156 + .disable = disable_m32700ut_pld_irq, 157 + .ack = mask_and_ack_m32700ut_pld, 158 + .end = end_m32700ut_pld_irq 158 159 }; 159 160 160 161 /* 161 - * Interrupt Control Unit of PLD on OPSPUT-LAN (Level 2) 162 + * Interrupt Control Unit of PLD on M32700UT-LAN (Level 2) 162 163 */ 163 - #define irq2lanpldirq(x) ((x) - OPSPUT_LAN_PLD_IRQ_BASE) 164 - #define lanpldirq2port(x) (unsigned long)((int)OPSPUT_LAN_ICUCR1 + \ 164 + #define irq2lanpldirq(x) ((x) - M32700UT_LAN_PLD_IRQ_BASE) 165 + #define lanpldirq2port(x) (unsigned long)((int)M32700UT_LAN_ICUCR1 + \ 165 166 (((x) - 1) * sizeof(unsigned short))) 166 167 167 - static pld_icu_data_t lanpld_icu_data[OPSPUT_NUM_LAN_PLD_IRQ]; 168 + static pld_icu_data_t lanpld_icu_data[M32700UT_NUM_LAN_PLD_IRQ]; 168 169 169 - static void disable_opsput_lanpld_irq(unsigned int irq) 170 + static void disable_m32700ut_lanpld_irq(unsigned int irq) 170 171 { 171 172 unsigned long port, data; 172 173 unsigned int pldirq; ··· 177 178 outw(data, port); 178 179 } 179 180 180 - static void enable_opsput_lanpld_irq(unsigned int irq) 181 + static void enable_m32700ut_lanpld_irq(unsigned int irq) 181 182 { 182 183 unsigned long port, data; 183 184 unsigned int pldirq; ··· 188 189 outw(data, port); 189 190 } 190 191 191 - static void mask_and_ack_opsput_lanpld(unsigned int irq) 192 + static void mask_and_ack_m32700ut_lanpld(unsigned int irq) 192 193 { 193 - disable_opsput_lanpld_irq(irq); 194 + disable_m32700ut_lanpld_irq(irq); 194 195 } 195 196 196 - static void end_opsput_lanpld_irq(unsigned int irq) 197 + static void end_m32700ut_lanpld_irq(unsigned int irq) 197 198 { 198 - enable_opsput_lanpld_irq(irq); 199 - end_opsput_irq(M32R_IRQ_INT0); 199 + enable_m32700ut_lanpld_irq(irq); 200 + end_m32700ut_irq(M32R_IRQ_INT0); 200 201 } 201 202 202 - static unsigned int startup_opsput_lanpld_irq(unsigned int irq) 203 + static unsigned int startup_m32700ut_lanpld_irq(unsigned int irq) 203 204 { 204 - enable_opsput_lanpld_irq(irq); 205 + enable_m32700ut_lanpld_irq(irq); 205 206 return (0); 206 207 } 207 208 208 - static void shutdown_opsput_lanpld_irq(unsigned int irq) 209 + static void shutdown_m32700ut_lanpld_irq(unsigned int irq) 209 210 { 210 211 unsigned long port; 211 212 unsigned int pldirq; ··· 215 216 outw(PLD_ICUCR_ILEVEL7, port); 216 217 } 217 218 218 - static struct hw_interrupt_type opsput_lanpld_irq_type = 219 + static struct hw_interrupt_type m32700ut_lanpld_irq_type = 219 220 { 220 - .typename = "OPSPUT-PLD-LAN-IRQ", 221 - .startup = startup_opsput_lanpld_irq, 222 - .shutdown = shutdown_opsput_lanpld_irq, 223 - .enable = enable_opsput_lanpld_irq, 224 - .disable = disable_opsput_lanpld_irq, 225 - .ack = mask_and_ack_opsput_lanpld, 226 - .end = end_opsput_lanpld_irq 221 + .typename = "M32700UT-PLD-LAN-IRQ", 222 + .startup = startup_m32700ut_lanpld_irq, 223 + .shutdown = shutdown_m32700ut_lanpld_irq, 224 + .enable = enable_m32700ut_lanpld_irq, 225 + .disable = disable_m32700ut_lanpld_irq, 226 + .ack = mask_and_ack_m32700ut_lanpld, 227 + .end = end_m32700ut_lanpld_irq 227 228 }; 228 229 229 230 /* 230 - * Interrupt Control Unit of PLD on OPSPUT-LCD (Level 2) 231 + * Interrupt Control Unit of PLD on M32700UT-LCD (Level 2) 231 232 */ 232 - #define irq2lcdpldirq(x) ((x) - OPSPUT_LCD_PLD_IRQ_BASE) 233 - #define lcdpldirq2port(x) (unsigned long)((int)OPSPUT_LCD_ICUCR1 + \ 233 + #define irq2lcdpldirq(x) ((x) - M32700UT_LCD_PLD_IRQ_BASE) 234 + #define lcdpldirq2port(x) (unsigned long)((int)M32700UT_LCD_ICUCR1 + \ 234 235 (((x) - 1) * sizeof(unsigned short))) 235 236 236 - static pld_icu_data_t lcdpld_icu_data[OPSPUT_NUM_LCD_PLD_IRQ]; 237 + static pld_icu_data_t lcdpld_icu_data[M32700UT_NUM_LCD_PLD_IRQ]; 237 238 238 - static void disable_opsput_lcdpld_irq(unsigned int irq) 239 + static void disable_m32700ut_lcdpld_irq(unsigned int irq) 239 240 { 240 241 unsigned long port, data; 241 242 unsigned int pldirq; ··· 246 247 outw(data, port); 247 248 } 248 249 249 - static void enable_opsput_lcdpld_irq(unsigned int irq) 250 + static void enable_m32700ut_lcdpld_irq(unsigned int irq) 250 251 { 251 252 unsigned long port, data; 252 253 unsigned int pldirq; ··· 257 258 outw(data, port); 258 259 } 259 260 260 - static void mask_and_ack_opsput_lcdpld(unsigned int irq) 261 + static void mask_and_ack_m32700ut_lcdpld(unsigned int irq) 261 262 { 262 - disable_opsput_lcdpld_irq(irq); 263 + disable_m32700ut_lcdpld_irq(irq); 263 264 } 264 265 265 - static void end_opsput_lcdpld_irq(unsigned int irq) 266 + static void end_m32700ut_lcdpld_irq(unsigned int irq) 266 267 { 267 - enable_opsput_lcdpld_irq(irq); 268 - end_opsput_irq(M32R_IRQ_INT2); 268 + enable_m32700ut_lcdpld_irq(irq); 269 + end_m32700ut_irq(M32R_IRQ_INT2); 269 270 } 270 271 271 - static unsigned int startup_opsput_lcdpld_irq(unsigned int irq) 272 + static unsigned int startup_m32700ut_lcdpld_irq(unsigned int irq) 272 273 { 273 - enable_opsput_lcdpld_irq(irq); 274 + enable_m32700ut_lcdpld_irq(irq); 274 275 return (0); 275 276 } 276 277 277 - static void shutdown_opsput_lcdpld_irq(unsigned int irq) 278 + static void shutdown_m32700ut_lcdpld_irq(unsigned int irq) 278 279 { 279 280 unsigned long port; 280 281 unsigned int pldirq; ··· 284 285 outw(PLD_ICUCR_ILEVEL7, port); 285 286 } 286 287 287 - static struct hw_interrupt_type opsput_lcdpld_irq_type = 288 + static struct hw_interrupt_type m32700ut_lcdpld_irq_type = 288 289 { 289 - "OPSPUT-PLD-LCD-IRQ", 290 - startup_opsput_lcdpld_irq, 291 - shutdown_opsput_lcdpld_irq, 292 - enable_opsput_lcdpld_irq, 293 - disable_opsput_lcdpld_irq, 294 - mask_and_ack_opsput_lcdpld, 295 - end_opsput_lcdpld_irq 290 + .typename = "M32700UT-PLD-LCD-IRQ", 291 + .startup = startup_m32700ut_lcdpld_irq, 292 + .shutdown = shutdown_m32700ut_lcdpld_irq, 293 + .enable = enable_m32700ut_lcdpld_irq, 294 + .disable = disable_m32700ut_lcdpld_irq, 295 + .ack = mask_and_ack_m32700ut_lcdpld, 296 + .end = end_m32700ut_lcdpld_irq 296 297 }; 297 298 298 299 void __init init_IRQ(void) 299 300 { 300 301 #if defined(CONFIG_SMC91X) 301 - /* INT#0: LAN controller on OPSPUT-LAN (SMC91C111)*/ 302 - irq_desc[OPSPUT_LAN_IRQ_LAN].status = IRQ_DISABLED; 303 - irq_desc[OPSPUT_LAN_IRQ_LAN].chip = &opsput_lanpld_irq_type; 304 - irq_desc[OPSPUT_LAN_IRQ_LAN].action = 0; 305 - irq_desc[OPSPUT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */ 306 - lanpld_icu_data[irq2lanpldirq(OPSPUT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ 307 - disable_opsput_lanpld_irq(OPSPUT_LAN_IRQ_LAN); 302 + /* INT#0: LAN controller on M32700UT-LAN (SMC91C111)*/ 303 + irq_desc[M32700UT_LAN_IRQ_LAN].status = IRQ_DISABLED; 304 + irq_desc[M32700UT_LAN_IRQ_LAN].chip = &m32700ut_lanpld_irq_type; 305 + irq_desc[M32700UT_LAN_IRQ_LAN].action = 0; 306 + irq_desc[M32700UT_LAN_IRQ_LAN].depth = 1; /* disable nested irq */ 307 + lanpld_icu_data[irq2lanpldirq(M32700UT_LAN_IRQ_LAN)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* "H" edge sense */ 308 + disable_m32700ut_lanpld_irq(M32700UT_LAN_IRQ_LAN); 308 309 #endif /* CONFIG_SMC91X */ 309 310 310 311 /* MFT2 : system timer */ 311 312 irq_desc[M32R_IRQ_MFT2].status = IRQ_DISABLED; 312 - irq_desc[M32R_IRQ_MFT2].chip = &opsput_irq_type; 313 + irq_desc[M32R_IRQ_MFT2].chip = &m32700ut_irq_type; 313 314 irq_desc[M32R_IRQ_MFT2].action = 0; 314 315 irq_desc[M32R_IRQ_MFT2].depth = 1; 315 316 icu_data[M32R_IRQ_MFT2].icucr = M32R_ICUCR_IEN; 316 - disable_opsput_irq(M32R_IRQ_MFT2); 317 + disable_m32700ut_irq(M32R_IRQ_MFT2); 317 318 318 319 /* SIO0 : receive */ 319 320 irq_desc[M32R_IRQ_SIO0_R].status = IRQ_DISABLED; 320 - irq_desc[M32R_IRQ_SIO0_R].chip = &opsput_irq_type; 321 + irq_desc[M32R_IRQ_SIO0_R].chip = &m32700ut_irq_type; 321 322 irq_desc[M32R_IRQ_SIO0_R].action = 0; 322 323 irq_desc[M32R_IRQ_SIO0_R].depth = 1; 323 324 icu_data[M32R_IRQ_SIO0_R].icucr = 0; 324 - disable_opsput_irq(M32R_IRQ_SIO0_R); 325 + disable_m32700ut_irq(M32R_IRQ_SIO0_R); 325 326 326 327 /* SIO0 : send */ 327 328 irq_desc[M32R_IRQ_SIO0_S].status = IRQ_DISABLED; 328 - irq_desc[M32R_IRQ_SIO0_S].chip = &opsput_irq_type; 329 + irq_desc[M32R_IRQ_SIO0_S].chip = &m32700ut_irq_type; 329 330 irq_desc[M32R_IRQ_SIO0_S].action = 0; 330 331 irq_desc[M32R_IRQ_SIO0_S].depth = 1; 331 332 icu_data[M32R_IRQ_SIO0_S].icucr = 0; 332 - disable_opsput_irq(M32R_IRQ_SIO0_S); 333 + disable_m32700ut_irq(M32R_IRQ_SIO0_S); 333 334 334 335 /* SIO1 : receive */ 335 336 irq_desc[M32R_IRQ_SIO1_R].status = IRQ_DISABLED; 336 - irq_desc[M32R_IRQ_SIO1_R].chip = &opsput_irq_type; 337 + irq_desc[M32R_IRQ_SIO1_R].chip = &m32700ut_irq_type; 337 338 irq_desc[M32R_IRQ_SIO1_R].action = 0; 338 339 irq_desc[M32R_IRQ_SIO1_R].depth = 1; 339 340 icu_data[M32R_IRQ_SIO1_R].icucr = 0; 340 - disable_opsput_irq(M32R_IRQ_SIO1_R); 341 + disable_m32700ut_irq(M32R_IRQ_SIO1_R); 341 342 342 343 /* SIO1 : send */ 343 344 irq_desc[M32R_IRQ_SIO1_S].status = IRQ_DISABLED; 344 - irq_desc[M32R_IRQ_SIO1_S].chip = &opsput_irq_type; 345 + irq_desc[M32R_IRQ_SIO1_S].chip = &m32700ut_irq_type; 345 346 irq_desc[M32R_IRQ_SIO1_S].action = 0; 346 347 irq_desc[M32R_IRQ_SIO1_S].depth = 1; 347 348 icu_data[M32R_IRQ_SIO1_S].icucr = 0; 348 - disable_opsput_irq(M32R_IRQ_SIO1_S); 349 + disable_m32700ut_irq(M32R_IRQ_SIO1_S); 349 350 350 351 /* DMA1 : */ 351 352 irq_desc[M32R_IRQ_DMA1].status = IRQ_DISABLED; 352 - irq_desc[M32R_IRQ_DMA1].chip = &opsput_irq_type; 353 + irq_desc[M32R_IRQ_DMA1].chip = &m32700ut_irq_type; 353 354 irq_desc[M32R_IRQ_DMA1].action = 0; 354 355 irq_desc[M32R_IRQ_DMA1].depth = 1; 355 356 icu_data[M32R_IRQ_DMA1].icucr = 0; 356 - disable_opsput_irq(M32R_IRQ_DMA1); 357 + disable_m32700ut_irq(M32R_IRQ_DMA1); 357 358 358 359 #ifdef CONFIG_SERIAL_M32R_PLDSIO 359 360 /* INT#1: SIO0 Receive on PLD */ 360 361 irq_desc[PLD_IRQ_SIO0_RCV].status = IRQ_DISABLED; 361 - irq_desc[PLD_IRQ_SIO0_RCV].chip = &opsput_pld_irq_type; 362 + irq_desc[PLD_IRQ_SIO0_RCV].chip = &m32700ut_pld_irq_type; 362 363 irq_desc[PLD_IRQ_SIO0_RCV].action = 0; 363 364 irq_desc[PLD_IRQ_SIO0_RCV].depth = 1; /* disable nested irq */ 364 365 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_RCV)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 365 - disable_opsput_pld_irq(PLD_IRQ_SIO0_RCV); 366 + disable_m32700ut_pld_irq(PLD_IRQ_SIO0_RCV); 366 367 367 368 /* INT#1: SIO0 Send on PLD */ 368 369 irq_desc[PLD_IRQ_SIO0_SND].status = IRQ_DISABLED; 369 - irq_desc[PLD_IRQ_SIO0_SND].chip = &opsput_pld_irq_type; 370 + irq_desc[PLD_IRQ_SIO0_SND].chip = &m32700ut_pld_irq_type; 370 371 irq_desc[PLD_IRQ_SIO0_SND].action = 0; 371 372 irq_desc[PLD_IRQ_SIO0_SND].depth = 1; /* disable nested irq */ 372 373 pld_icu_data[irq2pldirq(PLD_IRQ_SIO0_SND)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD03; 373 - disable_opsput_pld_irq(PLD_IRQ_SIO0_SND); 374 + disable_m32700ut_pld_irq(PLD_IRQ_SIO0_SND); 374 375 #endif /* CONFIG_SERIAL_M32R_PLDSIO */ 375 376 376 377 /* INT#1: CFC IREQ on PLD */ 377 378 irq_desc[PLD_IRQ_CFIREQ].status = IRQ_DISABLED; 378 - irq_desc[PLD_IRQ_CFIREQ].chip = &opsput_pld_irq_type; 379 + irq_desc[PLD_IRQ_CFIREQ].chip = &m32700ut_pld_irq_type; 379 380 irq_desc[PLD_IRQ_CFIREQ].action = 0; 380 381 irq_desc[PLD_IRQ_CFIREQ].depth = 1; /* disable nested irq */ 381 382 pld_icu_data[irq2pldirq(PLD_IRQ_CFIREQ)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* 'L' level sense */ 382 - disable_opsput_pld_irq(PLD_IRQ_CFIREQ); 383 + disable_m32700ut_pld_irq(PLD_IRQ_CFIREQ); 383 384 384 385 /* INT#1: CFC Insert on PLD */ 385 386 irq_desc[PLD_IRQ_CFC_INSERT].status = IRQ_DISABLED; 386 - irq_desc[PLD_IRQ_CFC_INSERT].chip = &opsput_pld_irq_type; 387 + irq_desc[PLD_IRQ_CFC_INSERT].chip = &m32700ut_pld_irq_type; 387 388 irq_desc[PLD_IRQ_CFC_INSERT].action = 0; 388 389 irq_desc[PLD_IRQ_CFC_INSERT].depth = 1; /* disable nested irq */ 389 390 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_INSERT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD00; /* 'L' edge sense */ 390 - disable_opsput_pld_irq(PLD_IRQ_CFC_INSERT); 391 + disable_m32700ut_pld_irq(PLD_IRQ_CFC_INSERT); 391 392 392 393 /* INT#1: CFC Eject on PLD */ 393 394 irq_desc[PLD_IRQ_CFC_EJECT].status = IRQ_DISABLED; 394 - irq_desc[PLD_IRQ_CFC_EJECT].chip = &opsput_pld_irq_type; 395 + irq_desc[PLD_IRQ_CFC_EJECT].chip = &m32700ut_pld_irq_type; 395 396 irq_desc[PLD_IRQ_CFC_EJECT].action = 0; 396 397 irq_desc[PLD_IRQ_CFC_EJECT].depth = 1; /* disable nested irq */ 397 398 pld_icu_data[irq2pldirq(PLD_IRQ_CFC_EJECT)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD02; /* 'H' edge sense */ 398 - disable_opsput_pld_irq(PLD_IRQ_CFC_EJECT); 399 + disable_m32700ut_pld_irq(PLD_IRQ_CFC_EJECT); 399 400 400 401 /* 401 402 * INT0# is used for LAN, DIO 402 403 * We enable it here. 403 404 */ 404 405 icu_data[M32R_IRQ_INT0].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; 405 - enable_opsput_irq(M32R_IRQ_INT0); 406 + enable_m32700ut_irq(M32R_IRQ_INT0); 406 407 407 408 /* 408 409 * INT1# is used for UART, MMC, CF Controller in FPGA. 409 410 * We enable it here. 410 411 */ 411 412 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD11; 412 - enable_opsput_irq(M32R_IRQ_INT1); 413 + enable_m32700ut_irq(M32R_IRQ_INT1); 413 414 414 415 #if defined(CONFIG_USB) 415 416 outw(USBCR_OTGS, USBCR); /* USBCR: non-OTG */ 416 417 417 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED; 418 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].chip = &opsput_lcdpld_irq_type; 419 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].action = 0; 420 - irq_desc[OPSPUT_LCD_IRQ_USB_INT1].depth = 1; 421 - lcdpld_icu_data[irq2lcdpldirq(OPSPUT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 422 - disable_opsput_lcdpld_irq(OPSPUT_LCD_IRQ_USB_INT1); 418 + irq_desc[M32700UT_LCD_IRQ_USB_INT1].status = IRQ_DISABLED; 419 + irq_desc[M32700UT_LCD_IRQ_USB_INT1].chip = &m32700ut_lcdpld_irq_type; 420 + irq_desc[M32700UT_LCD_IRQ_USB_INT1].action = 0; 421 + irq_desc[M32700UT_LCD_IRQ_USB_INT1].depth = 1; 422 + lcdpld_icu_data[irq2lcdpldirq(M32700UT_LCD_IRQ_USB_INT1)].icucr = PLD_ICUCR_IEN|PLD_ICUCR_ISMOD01; /* "L" level sense */ 423 + disable_m32700ut_lcdpld_irq(M32700UT_LCD_IRQ_USB_INT1); 423 424 #endif 424 425 /* 425 426 * INT2# is used for BAT, USB, AUDIO 426 427 * We enable it here. 427 428 */ 428 429 icu_data[M32R_IRQ_INT2].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD01; 429 - enable_opsput_irq(M32R_IRQ_INT2); 430 + enable_m32700ut_irq(M32R_IRQ_INT2); 430 431 431 432 #if defined(CONFIG_VIDEO_M32R_AR) 432 433 /* 433 434 * INT3# is used for AR 434 435 */ 435 436 irq_desc[M32R_IRQ_INT3].status = IRQ_DISABLED; 436 - irq_desc[M32R_IRQ_INT3].chip = &opsput_irq_type; 437 + irq_desc[M32R_IRQ_INT3].chip = &m32700ut_irq_type; 437 438 irq_desc[M32R_IRQ_INT3].action = 0; 438 439 irq_desc[M32R_IRQ_INT3].depth = 1; 439 440 icu_data[M32R_IRQ_INT3].icucr = M32R_ICUCR_IEN|M32R_ICUCR_ISMOD10; 440 - disable_opsput_irq(M32R_IRQ_INT3); 441 - #endif /* CONFIG_VIDEO_M32R_AR */ 441 + disable_m32700ut_irq(M32R_IRQ_INT3); 442 + #endif /* CONFIG_VIDEO_M32R_AR */ 442 443 } 443 444 444 445 #if defined(CONFIG_SMC91X) ··· 452 453 .flags = IORESOURCE_MEM, 453 454 }, 454 455 [1] = { 455 - .start = OPSPUT_LAN_IRQ_LAN, 456 - .end = OPSPUT_LAN_IRQ_LAN, 456 + .start = M32700UT_LAN_IRQ_LAN, 457 + .end = M32700UT_LAN_IRQ_LAN, 457 458 .flags = IORESOURCE_IRQ, 458 459 } 459 460 };
+2 -3
arch/m32r/kernel/setup_usrv.c arch/m32r/platforms/usrv/setup.c
··· 1 1 /* 2 - * linux/arch/m32r/kernel/setup_usrv.c 2 + * linux/arch/m32r/platforms/usrv/setup.c 3 3 * 4 4 * Setup routines for MITSUBISHI uServer 5 5 * ··· 198 198 #endif /* CONFIG_SERIAL_M32R_SIO */ 199 199 200 200 /* INT#67-#71: CFC#0 IREQ on PLD */ 201 - for (i = 0 ; i < CONFIG_CFC_NUM ; i++ ) { 201 + for (i = 0 ; i < CONFIG_M32R_CFC_NUM ; i++ ) { 202 202 irq_desc[PLD_IRQ_CF0 + i].status = IRQ_DISABLED; 203 203 irq_desc[PLD_IRQ_CF0 + i].chip = &m32700ut_pld_irq_type; 204 204 irq_desc[PLD_IRQ_CF0 + i].action = 0; ··· 246 246 icu_data[M32R_IRQ_INT1].icucr = M32R_ICUCR_ISMOD11; 247 247 enable_mappi_irq(M32R_IRQ_INT1); 248 248 } 249 -
+9
arch/m32r/platforms/Makefile
··· 1 + # arch/m32r/platforms/Makefile 2 + obj-$(CONFIG_PLAT_M32104UT) += m32104ut/ 3 + obj-$(CONFIG_PLAT_M32700UT) += m32700ut/ 4 + obj-$(CONFIG_PLAT_MAPPI) += mappi/ 5 + obj-$(CONFIG_PLAT_MAPPI2) += mappi2/ 6 + obj-$(CONFIG_PLAT_MAPPI3) += mappi3/ 7 + obj-$(CONFIG_PLAT_OAKS32R) += oaks32r/ 8 + obj-$(CONFIG_PLAT_OPSPUT) += opsput/ 9 + obj-$(CONFIG_PLAT_USRV) += usrv/
+1
arch/m32r/platforms/m32104ut/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/m32700ut/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/mappi/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/mappi2/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/mappi3/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/oaks32r/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/opsput/Makefile
··· 1 + obj-y := setup.o io.o
+1
arch/m32r/platforms/usrv/Makefile
··· 1 + obj-y := setup.o io.o