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