Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus

* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] Increase cp0 compare clockevent min_delta_ns from 0x30 to 0x300.
[MIPS] Cache: Provide more information on cache policy on bootup.
[MIPS] Fix aliasing bug in copy_user_highpage, take 2.
[MIPS] VPE loader: convert from struct class_ device to struct device
[MIPS] MIPSsim: Fix booting from NFS root
[MIPS] Alchemy: Get rid of au1xxx_irq_map_t.
[MIPS] Alchemy: Get rid of au_ffz().
[MIPS] Alchemy: Get rid of au_ffs().
[MIPS] Alchemy: cleanup interrupt code.
[MIPS] Lasat: Fix build by conversion to irq_cpu.c.
[MIPS] Lasat: Add #ifndef ... #endif include warpper to lasatint.h.
[MIPS] IP22: Enable -Werror.
[MIPS] IP22: Fix warning.
[MIPS] IP22: Complain if requesting the front panel irq failed.
[MIPS] vmlinux.lds.S: Handle KPROBES_TEXT.
[MIPS] vmlinux.lds.S: Fix handling of .notes in final link.
[MIPS] vmlinux.lds.S: Remove duplicate comment.
[MIPS] MSP71XX: Add workarounds file.
[MIPS] IP32: Fix build by conversion to irq_cpu.c.

+779 -750
+2
arch/mips/Kconfig
··· 133 133 select DMA_NONCOHERENT 134 134 select SYS_HAS_EARLY_PRINTK 135 135 select HW_HAS_PCI 136 + select IRQ_CPU 136 137 select PCI_GT64XXX_PCI0 137 138 select MIPS_NILE4 138 139 select R5000_CPU_SCACHE ··· 411 410 select BOOT_ELF32 412 411 select DMA_NONCOHERENT 413 412 select HW_HAS_PCI 413 + select IRQ_CPU 414 414 select R5000_CPU_SCACHE 415 415 select RM7000_CPU_SCACHE 416 416 select SYS_HAS_CPU_R5000
+1 -1
arch/mips/au1000/common/au1xxx_irqmap.c
··· 54 54 * Careful if you change match 2 request! 55 55 * The interrupt handler is called directly from the low level dispatch code. 56 56 */ 57 - au1xxx_irq_map_t __initdata au1xxx_ic0_map[] = { 57 + struct au1xxx_irqmap __initdata au1xxx_ic0_map[] = { 58 58 59 59 #if defined(CONFIG_SOC_AU1000) 60 60 { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0},
+1 -1
arch/mips/au1000/common/dbdma.c
··· 859 859 860 860 intstat = dbdma_gptr->ddma_intstat; 861 861 au_sync(); 862 - chan_index = au_ffs(intstat) - 1; 862 + chan_index = ffs(intstat); 863 863 864 864 ctp = chan_tab_ptr[chan_index]; 865 865 cp = ctp->chan_ptr;
+479 -507
arch/mips/au1000/common/irq.c
··· 26 26 * with this program; if not, write to the Free Software Foundation, Inc., 27 27 * 675 Mass Ave, Cambridge, MA 02139, USA. 28 28 */ 29 - #include <linux/errno.h> 30 - #include <linux/init.h> 31 - #include <linux/irq.h> 32 - #include <linux/kernel_stat.h> 33 - #include <linux/module.h> 34 - #include <linux/signal.h> 35 - #include <linux/sched.h> 36 - #include <linux/types.h> 37 - #include <linux/interrupt.h> 38 - #include <linux/ioport.h> 39 - #include <linux/timex.h> 40 - #include <linux/slab.h> 41 - #include <linux/random.h> 42 - #include <linux/delay.h> 43 29 #include <linux/bitops.h> 30 + #include <linux/init.h> 31 + #include <linux/io.h> 32 + #include <linux/interrupt.h> 33 + #include <linux/irq.h> 44 34 45 - #include <asm/bootinfo.h> 46 - #include <asm/io.h> 47 35 #include <asm/mipsregs.h> 48 - #include <asm/system.h> 49 36 #include <asm/mach-au1x00/au1000.h> 50 37 #ifdef CONFIG_MIPS_PB1000 51 38 #include <asm/mach-pb1x00/pb1000.h> 52 - #endif 53 - 54 - #undef DEBUG_IRQ 55 - #ifdef DEBUG_IRQ 56 - /* note: prints function name for you */ 57 - #define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args) 58 - #else 59 - #define DPRINTK(fmt, args...) 60 39 #endif 61 40 62 41 #define EXT_INTC0_REQ0 2 /* IP 2 */ ··· 48 69 49 70 static DEFINE_SPINLOCK(irq_lock); 50 71 51 - 52 - inline void local_enable_irq(unsigned int irq_nr) 53 - { 54 - if (irq_nr > AU1000_LAST_INTC0_INT) { 55 - au_writel(1<<(irq_nr-32), IC1_MASKSET); 56 - au_writel(1<<(irq_nr-32), IC1_WAKESET); 57 - } 58 - else { 59 - au_writel(1<<irq_nr, IC0_MASKSET); 60 - au_writel(1<<irq_nr, IC0_WAKESET); 61 - } 62 - au_sync(); 63 - } 64 - 65 - 66 - inline void local_disable_irq(unsigned int irq_nr) 67 - { 68 - if (irq_nr > AU1000_LAST_INTC0_INT) { 69 - au_writel(1<<(irq_nr-32), IC1_MASKCLR); 70 - au_writel(1<<(irq_nr-32), IC1_WAKECLR); 71 - } 72 - else { 73 - au_writel(1<<irq_nr, IC0_MASKCLR); 74 - au_writel(1<<irq_nr, IC0_WAKECLR); 75 - } 76 - au_sync(); 77 - } 78 - 79 - 80 - static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr) 81 - { 82 - if (irq_nr > AU1000_LAST_INTC0_INT) { 83 - au_writel(1<<(irq_nr-32), IC1_RISINGCLR); 84 - au_writel(1<<(irq_nr-32), IC1_MASKCLR); 85 - } 86 - else { 87 - au_writel(1<<irq_nr, IC0_RISINGCLR); 88 - au_writel(1<<irq_nr, IC0_MASKCLR); 89 - } 90 - au_sync(); 91 - } 92 - 93 - 94 - static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr) 95 - { 96 - if (irq_nr > AU1000_LAST_INTC0_INT) { 97 - au_writel(1<<(irq_nr-32), IC1_FALLINGCLR); 98 - au_writel(1<<(irq_nr-32), IC1_MASKCLR); 99 - } 100 - else { 101 - au_writel(1<<irq_nr, IC0_FALLINGCLR); 102 - au_writel(1<<irq_nr, IC0_MASKCLR); 103 - } 104 - au_sync(); 105 - } 106 - 107 - 108 - static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr) 109 - { 110 - /* This may assume that we don't get interrupts from 111 - * both edges at once, or if we do, that we don't care. 112 - */ 113 - if (irq_nr > AU1000_LAST_INTC0_INT) { 114 - au_writel(1<<(irq_nr-32), IC1_FALLINGCLR); 115 - au_writel(1<<(irq_nr-32), IC1_RISINGCLR); 116 - au_writel(1<<(irq_nr-32), IC1_MASKCLR); 117 - } 118 - else { 119 - au_writel(1<<irq_nr, IC0_FALLINGCLR); 120 - au_writel(1<<irq_nr, IC0_RISINGCLR); 121 - au_writel(1<<irq_nr, IC0_MASKCLR); 122 - } 123 - au_sync(); 124 - } 125 - 126 - 127 - static inline void mask_and_ack_level_irq(unsigned int irq_nr) 128 - { 129 - 130 - local_disable_irq(irq_nr); 131 - au_sync(); 132 - #if defined(CONFIG_MIPS_PB1000) 133 - if (irq_nr == AU1000_GPIO_15) { 134 - au_writel(0x8000, PB1000_MDR); /* ack int */ 135 - au_sync(); 136 - } 137 - #endif 138 - return; 139 - } 140 - 141 - 142 - static void end_irq(unsigned int irq_nr) 143 - { 144 - if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))) { 145 - local_enable_irq(irq_nr); 146 - } 147 - #if defined(CONFIG_MIPS_PB1000) 148 - if (irq_nr == AU1000_GPIO_15) { 149 - au_writel(0x4000, PB1000_MDR); /* enable int */ 150 - au_sync(); 151 - } 152 - #endif 153 - } 154 - 155 - unsigned long save_local_and_disable(int controller) 156 - { 157 - int i; 158 - unsigned long flags, mask; 159 - 160 - spin_lock_irqsave(&irq_lock, flags); 161 - if (controller) { 162 - mask = au_readl(IC1_MASKSET); 163 - for (i=32; i<64; i++) { 164 - local_disable_irq(i); 165 - } 166 - } 167 - else { 168 - mask = au_readl(IC0_MASKSET); 169 - for (i=0; i<32; i++) { 170 - local_disable_irq(i); 171 - } 172 - } 173 - spin_unlock_irqrestore(&irq_lock, flags); 174 - 175 - return mask; 176 - } 177 - 178 - void restore_local_and_enable(int controller, unsigned long mask) 179 - { 180 - int i; 181 - unsigned long flags, new_mask; 182 - 183 - spin_lock_irqsave(&irq_lock, flags); 184 - for (i=0; i<32; i++) { 185 - if (mask & (1<<i)) { 186 - if (controller) 187 - local_enable_irq(i+32); 188 - else 189 - local_enable_irq(i); 190 - } 191 - } 192 - if (controller) 193 - new_mask = au_readl(IC1_MASKSET); 194 - else 195 - new_mask = au_readl(IC0_MASKSET); 196 - 197 - spin_unlock_irqrestore(&irq_lock, flags); 198 - } 199 - 200 - 201 - static struct irq_chip rise_edge_irq_type = { 202 - .name = "Au1000 Rise Edge", 203 - .ack = mask_and_ack_rise_edge_irq, 204 - .mask = local_disable_irq, 205 - .mask_ack = mask_and_ack_rise_edge_irq, 206 - .unmask = local_enable_irq, 207 - .end = end_irq, 208 - }; 209 - 210 - static struct irq_chip fall_edge_irq_type = { 211 - .name = "Au1000 Fall Edge", 212 - .ack = mask_and_ack_fall_edge_irq, 213 - .mask = local_disable_irq, 214 - .mask_ack = mask_and_ack_fall_edge_irq, 215 - .unmask = local_enable_irq, 216 - .end = end_irq, 217 - }; 218 - 219 - static struct irq_chip either_edge_irq_type = { 220 - .name = "Au1000 Rise or Fall Edge", 221 - .ack = mask_and_ack_either_edge_irq, 222 - .mask = local_disable_irq, 223 - .mask_ack = mask_and_ack_either_edge_irq, 224 - .unmask = local_enable_irq, 225 - .end = end_irq, 226 - }; 227 - 228 - static struct irq_chip level_irq_type = { 229 - .name = "Au1000 Level", 230 - .ack = mask_and_ack_level_irq, 231 - .mask = local_disable_irq, 232 - .mask_ack = mask_and_ack_level_irq, 233 - .unmask = local_enable_irq, 234 - .end = end_irq, 235 - }; 236 - 237 - #ifdef CONFIG_PM 238 - void startup_match20_interrupt(irq_handler_t handler) 239 - { 240 - struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT]; 241 - 242 - static struct irqaction action; 243 - memset(&action, 0, sizeof(struct irqaction)); 244 - 245 - /* This is a big problem.... since we didn't use request_irq 246 - * when kernel/irq.c calls probe_irq_xxx this interrupt will 247 - * be probed for usage. This will end up disabling the device :( 248 - * Give it a bogus "action" pointer -- this will keep it from 249 - * getting auto-probed! 250 - * 251 - * By setting the status to match that of request_irq() we 252 - * can avoid it. --cgray 253 - */ 254 - action.dev_id = handler; 255 - action.flags = IRQF_DISABLED; 256 - cpus_clear(action.mask); 257 - action.name = "Au1xxx TOY"; 258 - action.handler = handler; 259 - action.next = NULL; 260 - 261 - desc->action = &action; 262 - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); 263 - 264 - local_enable_irq(AU1000_TOY_MATCH2_INT); 265 - } 266 - #endif 267 - 268 - static void setup_local_irq(unsigned int irq_nr, int type, int int_req) 269 - { 270 - if (irq_nr > AU1000_MAX_INTR) return; 271 - /* Config2[n], Config1[n], Config0[n] */ 272 - if (irq_nr > AU1000_LAST_INTC0_INT) { 273 - switch (type) { 274 - case INTC_INT_RISE_EDGE: /* 0:0:1 */ 275 - au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 276 - au_writel(1<<(irq_nr-32), IC1_CFG1CLR); 277 - au_writel(1<<(irq_nr-32), IC1_CFG0SET); 278 - set_irq_chip(irq_nr, &rise_edge_irq_type); 279 - break; 280 - case INTC_INT_FALL_EDGE: /* 0:1:0 */ 281 - au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 282 - au_writel(1<<(irq_nr-32), IC1_CFG1SET); 283 - au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 284 - set_irq_chip(irq_nr, &fall_edge_irq_type); 285 - break; 286 - case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 287 - au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 288 - au_writel(1<<(irq_nr-32), IC1_CFG1SET); 289 - au_writel(1<<(irq_nr-32), IC1_CFG0SET); 290 - set_irq_chip(irq_nr, &either_edge_irq_type); 291 - break; 292 - case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 293 - au_writel(1<<(irq_nr-32), IC1_CFG2SET); 294 - au_writel(1<<(irq_nr-32), IC1_CFG1CLR); 295 - au_writel(1<<(irq_nr-32), IC1_CFG0SET); 296 - set_irq_chip(irq_nr, &level_irq_type); 297 - break; 298 - case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 299 - au_writel(1<<(irq_nr-32), IC1_CFG2SET); 300 - au_writel(1<<(irq_nr-32), IC1_CFG1SET); 301 - au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 302 - set_irq_chip(irq_nr, &level_irq_type); 303 - break; 304 - case INTC_INT_DISABLED: /* 0:0:0 */ 305 - au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 306 - au_writel(1<<(irq_nr-32), IC1_CFG1CLR); 307 - au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 308 - break; 309 - default: /* disable the interrupt */ 310 - printk("unexpected int type %d (irq %d)\n", type, irq_nr); 311 - au_writel(1<<(irq_nr-32), IC1_CFG0CLR); 312 - au_writel(1<<(irq_nr-32), IC1_CFG1CLR); 313 - au_writel(1<<(irq_nr-32), IC1_CFG2CLR); 314 - return; 315 - } 316 - if (int_req) /* assign to interrupt request 1 */ 317 - au_writel(1<<(irq_nr-32), IC1_ASSIGNCLR); 318 - else /* assign to interrupt request 0 */ 319 - au_writel(1<<(irq_nr-32), IC1_ASSIGNSET); 320 - au_writel(1<<(irq_nr-32), IC1_SRCSET); 321 - au_writel(1<<(irq_nr-32), IC1_MASKCLR); 322 - au_writel(1<<(irq_nr-32), IC1_WAKECLR); 323 - } 324 - else { 325 - switch (type) { 326 - case INTC_INT_RISE_EDGE: /* 0:0:1 */ 327 - au_writel(1<<irq_nr, IC0_CFG2CLR); 328 - au_writel(1<<irq_nr, IC0_CFG1CLR); 329 - au_writel(1<<irq_nr, IC0_CFG0SET); 330 - set_irq_chip(irq_nr, &rise_edge_irq_type); 331 - break; 332 - case INTC_INT_FALL_EDGE: /* 0:1:0 */ 333 - au_writel(1<<irq_nr, IC0_CFG2CLR); 334 - au_writel(1<<irq_nr, IC0_CFG1SET); 335 - au_writel(1<<irq_nr, IC0_CFG0CLR); 336 - set_irq_chip(irq_nr, &fall_edge_irq_type); 337 - break; 338 - case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 339 - au_writel(1<<irq_nr, IC0_CFG2CLR); 340 - au_writel(1<<irq_nr, IC0_CFG1SET); 341 - au_writel(1<<irq_nr, IC0_CFG0SET); 342 - set_irq_chip(irq_nr, &either_edge_irq_type); 343 - break; 344 - case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 345 - au_writel(1<<irq_nr, IC0_CFG2SET); 346 - au_writel(1<<irq_nr, IC0_CFG1CLR); 347 - au_writel(1<<irq_nr, IC0_CFG0SET); 348 - set_irq_chip(irq_nr, &level_irq_type); 349 - break; 350 - case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 351 - au_writel(1<<irq_nr, IC0_CFG2SET); 352 - au_writel(1<<irq_nr, IC0_CFG1SET); 353 - au_writel(1<<irq_nr, IC0_CFG0CLR); 354 - set_irq_chip(irq_nr, &level_irq_type); 355 - break; 356 - case INTC_INT_DISABLED: /* 0:0:0 */ 357 - au_writel(1<<irq_nr, IC0_CFG0CLR); 358 - au_writel(1<<irq_nr, IC0_CFG1CLR); 359 - au_writel(1<<irq_nr, IC0_CFG2CLR); 360 - break; 361 - default: /* disable the interrupt */ 362 - printk("unexpected int type %d (irq %d)\n", type, irq_nr); 363 - au_writel(1<<irq_nr, IC0_CFG0CLR); 364 - au_writel(1<<irq_nr, IC0_CFG1CLR); 365 - au_writel(1<<irq_nr, IC0_CFG2CLR); 366 - return; 367 - } 368 - if (int_req) /* assign to interrupt request 1 */ 369 - au_writel(1<<irq_nr, IC0_ASSIGNCLR); 370 - else /* assign to interrupt request 0 */ 371 - au_writel(1<<irq_nr, IC0_ASSIGNSET); 372 - au_writel(1<<irq_nr, IC0_SRCSET); 373 - au_writel(1<<irq_nr, IC0_MASKCLR); 374 - au_writel(1<<irq_nr, IC0_WAKECLR); 375 - } 376 - au_sync(); 377 - } 378 - 379 - 380 - void __init arch_init_irq(void) 381 - { 382 - int i; 383 - unsigned long cp0_status; 384 - au1xxx_irq_map_t *imp; 385 - extern au1xxx_irq_map_t au1xxx_irq_map[]; 386 - extern au1xxx_irq_map_t au1xxx_ic0_map[]; 387 - extern int au1xxx_nr_irqs; 388 - extern int au1xxx_ic0_nr_irqs; 389 - 390 - cp0_status = read_c0_status(); 391 - 392 - /* Initialize interrupt controllers to a safe state. 393 - */ 394 - au_writel(0xffffffff, IC0_CFG0CLR); 395 - au_writel(0xffffffff, IC0_CFG1CLR); 396 - au_writel(0xffffffff, IC0_CFG2CLR); 397 - au_writel(0xffffffff, IC0_MASKCLR); 398 - au_writel(0xffffffff, IC0_ASSIGNSET); 399 - au_writel(0xffffffff, IC0_WAKECLR); 400 - au_writel(0xffffffff, IC0_SRCSET); 401 - au_writel(0xffffffff, IC0_FALLINGCLR); 402 - au_writel(0xffffffff, IC0_RISINGCLR); 403 - au_writel(0x00000000, IC0_TESTBIT); 404 - 405 - au_writel(0xffffffff, IC1_CFG0CLR); 406 - au_writel(0xffffffff, IC1_CFG1CLR); 407 - au_writel(0xffffffff, IC1_CFG2CLR); 408 - au_writel(0xffffffff, IC1_MASKCLR); 409 - au_writel(0xffffffff, IC1_ASSIGNSET); 410 - au_writel(0xffffffff, IC1_WAKECLR); 411 - au_writel(0xffffffff, IC1_SRCSET); 412 - au_writel(0xffffffff, IC1_FALLINGCLR); 413 - au_writel(0xffffffff, IC1_RISINGCLR); 414 - au_writel(0x00000000, IC1_TESTBIT); 415 - 416 - /* Initialize IC0, which is fixed per processor. 417 - */ 418 - imp = au1xxx_ic0_map; 419 - for (i=0; i<au1xxx_ic0_nr_irqs; i++) { 420 - setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); 421 - imp++; 422 - } 423 - 424 - /* Now set up the irq mapping for the board. 425 - */ 426 - imp = au1xxx_irq_map; 427 - for (i=0; i<au1xxx_nr_irqs; i++) { 428 - setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); 429 - imp++; 430 - } 431 - 432 - set_c0_status(ALLINTS); 433 - 434 - /* Board specific IRQ initialization. 435 - */ 436 - if (board_init_irq) 437 - (*board_init_irq)(); 438 - } 439 - 440 - 441 - /* 442 - * Interrupts are nested. Even if an interrupt handler is registered 443 - * as "fast", we might get another interrupt before we return from 444 - * intcX_reqX_irqdispatch(). 445 - */ 446 - 447 - static void intc0_req0_irqdispatch(void) 448 - { 449 - int irq = 0; 450 - static unsigned long intc0_req0 = 0; 451 - 452 - intc0_req0 |= au_readl(IC0_REQ0INT); 453 - 454 - if (!intc0_req0) 455 - return; 456 - #ifdef AU1000_USB_DEV_REQ_INT 457 - /* 458 - * Because of the tight timing of SETUP token to reply 459 - * transactions, the USB devices-side packet complete 460 - * interrupt needs the highest priority. 461 - */ 462 - if ((intc0_req0 & (1<<AU1000_USB_DEV_REQ_INT))) { 463 - intc0_req0 &= ~(1<<AU1000_USB_DEV_REQ_INT); 464 - do_IRQ(AU1000_USB_DEV_REQ_INT); 465 - return; 466 - } 467 - #endif 468 - irq = au_ffs(intc0_req0) - 1; 469 - intc0_req0 &= ~(1<<irq); 470 - do_IRQ(irq); 471 - } 472 - 473 - 474 - static void intc0_req1_irqdispatch(void) 475 - { 476 - int irq = 0; 477 - static unsigned long intc0_req1 = 0; 478 - 479 - intc0_req1 |= au_readl(IC0_REQ1INT); 480 - 481 - if (!intc0_req1) 482 - return; 483 - 484 - irq = au_ffs(intc0_req1) - 1; 485 - intc0_req1 &= ~(1<<irq); 486 - do_IRQ(irq); 487 - } 488 - 489 - 490 - /* 491 - * Interrupt Controller 1: 492 - * interrupts 32 - 63 493 - */ 494 - static void intc1_req0_irqdispatch(void) 495 - { 496 - int irq = 0; 497 - static unsigned long intc1_req0 = 0; 498 - 499 - intc1_req0 |= au_readl(IC1_REQ0INT); 500 - 501 - if (!intc1_req0) 502 - return; 503 - 504 - irq = au_ffs(intc1_req0) - 1; 505 - intc1_req0 &= ~(1<<irq); 506 - irq += 32; 507 - do_IRQ(irq); 508 - } 509 - 510 - 511 - static void intc1_req1_irqdispatch(void) 512 - { 513 - int irq = 0; 514 - static unsigned long intc1_req1 = 0; 515 - 516 - intc1_req1 |= au_readl(IC1_REQ1INT); 517 - 518 - if (!intc1_req1) 519 - return; 520 - 521 - irq = au_ffs(intc1_req1) - 1; 522 - intc1_req1 &= ~(1<<irq); 523 - irq += 32; 524 - do_IRQ(irq); 525 - } 526 - 527 72 #ifdef CONFIG_PM 528 73 529 - /* Save/restore the interrupt controller state. 74 + /* 75 + * Save/restore the interrupt controller state. 530 76 * Called from the save/restore core registers as part of the 531 77 * au_sleep function in power.c.....maybe I should just pm_register() 532 78 * them instead? ··· 64 560 static unsigned int sleep_intctl_wake[2]; 65 561 static unsigned int sleep_intctl_mask[2]; 66 562 67 - void 68 - save_au1xxx_intctl(void) 563 + void save_au1xxx_intctl(void) 69 564 { 70 565 sleep_intctl_config0[0] = au_readl(IC0_CFG0RD); 71 566 sleep_intctl_config1[0] = au_readl(IC0_CFG1RD); ··· 83 580 sleep_intctl_mask[1] = au_readl(IC1_MASKRD); 84 581 } 85 582 86 - /* For most restore operations, we clear the entire register and 583 + /* 584 + * For most restore operations, we clear the entire register and 87 585 * then set the bits we found during the save. 88 586 */ 89 - void 90 - restore_au1xxx_intctl(void) 587 + void restore_au1xxx_intctl(void) 91 588 { 92 589 au_writel(0xffffffff, IC0_MASKCLR); au_sync(); 93 590 ··· 131 628 } 132 629 #endif /* CONFIG_PM */ 133 630 631 + 632 + inline void local_enable_irq(unsigned int irq_nr) 633 + { 634 + if (irq_nr > AU1000_LAST_INTC0_INT) { 635 + au_writel(1 << (irq_nr - 32), IC1_MASKSET); 636 + au_writel(1 << (irq_nr - 32), IC1_WAKESET); 637 + } else { 638 + au_writel(1 << irq_nr, IC0_MASKSET); 639 + au_writel(1 << irq_nr, IC0_WAKESET); 640 + } 641 + au_sync(); 642 + } 643 + 644 + 645 + inline void local_disable_irq(unsigned int irq_nr) 646 + { 647 + if (irq_nr > AU1000_LAST_INTC0_INT) { 648 + au_writel(1 << (irq_nr - 32), IC1_MASKCLR); 649 + au_writel(1 << (irq_nr - 32), IC1_WAKECLR); 650 + } else { 651 + au_writel(1 << irq_nr, IC0_MASKCLR); 652 + au_writel(1 << irq_nr, IC0_WAKECLR); 653 + } 654 + au_sync(); 655 + } 656 + 657 + 658 + static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr) 659 + { 660 + if (irq_nr > AU1000_LAST_INTC0_INT) { 661 + au_writel(1 << (irq_nr - 32), IC1_RISINGCLR); 662 + au_writel(1 << (irq_nr - 32), IC1_MASKCLR); 663 + } else { 664 + au_writel(1 << irq_nr, IC0_RISINGCLR); 665 + au_writel(1 << irq_nr, IC0_MASKCLR); 666 + } 667 + au_sync(); 668 + } 669 + 670 + 671 + static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr) 672 + { 673 + if (irq_nr > AU1000_LAST_INTC0_INT) { 674 + au_writel(1 << (irq_nr - 32), IC1_FALLINGCLR); 675 + au_writel(1 << (irq_nr - 32), IC1_MASKCLR); 676 + } else { 677 + au_writel(1 << irq_nr, IC0_FALLINGCLR); 678 + au_writel(1 << irq_nr, IC0_MASKCLR); 679 + } 680 + au_sync(); 681 + } 682 + 683 + 684 + static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr) 685 + { 686 + /* This may assume that we don't get interrupts from 687 + * both edges at once, or if we do, that we don't care. 688 + */ 689 + if (irq_nr > AU1000_LAST_INTC0_INT) { 690 + au_writel(1 << (irq_nr - 32), IC1_FALLINGCLR); 691 + au_writel(1 << (irq_nr - 32), IC1_RISINGCLR); 692 + au_writel(1 << (irq_nr - 32), IC1_MASKCLR); 693 + } else { 694 + au_writel(1 << irq_nr, IC0_FALLINGCLR); 695 + au_writel(1 << irq_nr, IC0_RISINGCLR); 696 + au_writel(1 << irq_nr, IC0_MASKCLR); 697 + } 698 + au_sync(); 699 + } 700 + 701 + 702 + static inline void mask_and_ack_level_irq(unsigned int irq_nr) 703 + { 704 + 705 + local_disable_irq(irq_nr); 706 + au_sync(); 707 + #if defined(CONFIG_MIPS_PB1000) 708 + if (irq_nr == AU1000_GPIO_15) { 709 + au_writel(0x8000, PB1000_MDR); /* ack int */ 710 + au_sync(); 711 + } 712 + #endif 713 + return; 714 + } 715 + 716 + 717 + static void end_irq(unsigned int irq_nr) 718 + { 719 + if (!(irq_desc[irq_nr].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 720 + local_enable_irq(irq_nr); 721 + 722 + #if defined(CONFIG_MIPS_PB1000) 723 + if (irq_nr == AU1000_GPIO_15) { 724 + au_writel(0x4000, PB1000_MDR); /* enable int */ 725 + au_sync(); 726 + } 727 + #endif 728 + } 729 + 730 + unsigned long save_local_and_disable(int controller) 731 + { 732 + int i; 733 + unsigned long flags, mask; 734 + 735 + spin_lock_irqsave(&irq_lock, flags); 736 + if (controller) { 737 + mask = au_readl(IC1_MASKSET); 738 + for (i = 32; i < 64; i++) 739 + local_disable_irq(i); 740 + } else { 741 + mask = au_readl(IC0_MASKSET); 742 + for (i = 0; i < 32; i++) 743 + local_disable_irq(i); 744 + } 745 + spin_unlock_irqrestore(&irq_lock, flags); 746 + 747 + return mask; 748 + } 749 + 750 + void restore_local_and_enable(int controller, unsigned long mask) 751 + { 752 + int i; 753 + unsigned long flags, new_mask; 754 + 755 + spin_lock_irqsave(&irq_lock, flags); 756 + for (i = 0; i < 32; i++) { 757 + if (mask & (1 << i)) { 758 + if (controller) 759 + local_enable_irq(i + 32); 760 + else 761 + local_enable_irq(i); 762 + } 763 + } 764 + if (controller) 765 + new_mask = au_readl(IC1_MASKSET); 766 + else 767 + new_mask = au_readl(IC0_MASKSET); 768 + 769 + spin_unlock_irqrestore(&irq_lock, flags); 770 + } 771 + 772 + 773 + static struct irq_chip rise_edge_irq_type = { 774 + .name = "Au1000 Rise Edge", 775 + .ack = mask_and_ack_rise_edge_irq, 776 + .mask = local_disable_irq, 777 + .mask_ack = mask_and_ack_rise_edge_irq, 778 + .unmask = local_enable_irq, 779 + .end = end_irq, 780 + }; 781 + 782 + static struct irq_chip fall_edge_irq_type = { 783 + .name = "Au1000 Fall Edge", 784 + .ack = mask_and_ack_fall_edge_irq, 785 + .mask = local_disable_irq, 786 + .mask_ack = mask_and_ack_fall_edge_irq, 787 + .unmask = local_enable_irq, 788 + .end = end_irq, 789 + }; 790 + 791 + static struct irq_chip either_edge_irq_type = { 792 + .name = "Au1000 Rise or Fall Edge", 793 + .ack = mask_and_ack_either_edge_irq, 794 + .mask = local_disable_irq, 795 + .mask_ack = mask_and_ack_either_edge_irq, 796 + .unmask = local_enable_irq, 797 + .end = end_irq, 798 + }; 799 + 800 + static struct irq_chip level_irq_type = { 801 + .name = "Au1000 Level", 802 + .ack = mask_and_ack_level_irq, 803 + .mask = local_disable_irq, 804 + .mask_ack = mask_and_ack_level_irq, 805 + .unmask = local_enable_irq, 806 + .end = end_irq, 807 + }; 808 + 809 + #ifdef CONFIG_PM 810 + void startup_match20_interrupt(irq_handler_t handler) 811 + { 812 + struct irq_desc *desc = &irq_desc[AU1000_TOY_MATCH2_INT]; 813 + 814 + static struct irqaction action; 815 + memset(&action, 0, sizeof(struct irqaction)); 816 + 817 + /* 818 + * This is a big problem.... since we didn't use request_irq 819 + * when kernel/irq.c calls probe_irq_xxx this interrupt will 820 + * be probed for usage. This will end up disabling the device :( 821 + * Give it a bogus "action" pointer -- this will keep it from 822 + * getting auto-probed! 823 + * 824 + * By setting the status to match that of request_irq() we 825 + * can avoid it. --cgray 826 + */ 827 + action.dev_id = handler; 828 + action.flags = IRQF_DISABLED; 829 + cpus_clear(action.mask); 830 + action.name = "Au1xxx TOY"; 831 + action.handler = handler; 832 + action.next = NULL; 833 + 834 + desc->action = &action; 835 + desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); 836 + 837 + local_enable_irq(AU1000_TOY_MATCH2_INT); 838 + } 839 + #endif 840 + 841 + static void setup_local_irq(unsigned int irq_nr, int type, int int_req) 842 + { 843 + if (irq_nr > AU1000_MAX_INTR) return; 844 + /* Config2[n], Config1[n], Config0[n] */ 845 + if (irq_nr > AU1000_LAST_INTC0_INT) { 846 + switch (type) { 847 + case INTC_INT_RISE_EDGE: /* 0:0:1 */ 848 + au_writel(1 << (irq_nr - 32), IC1_CFG2CLR); 849 + au_writel(1 << (irq_nr - 32), IC1_CFG1CLR); 850 + au_writel(1 << (irq_nr - 32), IC1_CFG0SET); 851 + set_irq_chip(irq_nr, &rise_edge_irq_type); 852 + break; 853 + case INTC_INT_FALL_EDGE: /* 0:1:0 */ 854 + au_writel(1 << (irq_nr - 32), IC1_CFG2CLR); 855 + au_writel(1 << (irq_nr - 32), IC1_CFG1SET); 856 + au_writel(1 << (irq_nr - 32), IC1_CFG0CLR); 857 + set_irq_chip(irq_nr, &fall_edge_irq_type); 858 + break; 859 + case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 860 + au_writel(1 << (irq_nr - 32), IC1_CFG2CLR); 861 + au_writel(1 << (irq_nr - 32), IC1_CFG1SET); 862 + au_writel(1 << (irq_nr - 32), IC1_CFG0SET); 863 + set_irq_chip(irq_nr, &either_edge_irq_type); 864 + break; 865 + case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 866 + au_writel(1 << (irq_nr - 32), IC1_CFG2SET); 867 + au_writel(1 << (irq_nr - 32), IC1_CFG1CLR); 868 + au_writel(1 << (irq_nr - 32), IC1_CFG0SET); 869 + set_irq_chip(irq_nr, &level_irq_type); 870 + break; 871 + case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 872 + au_writel(1 << (irq_nr - 32), IC1_CFG2SET); 873 + au_writel(1 << (irq_nr - 32), IC1_CFG1SET); 874 + au_writel(1 << (irq_nr - 32), IC1_CFG0CLR); 875 + set_irq_chip(irq_nr, &level_irq_type); 876 + break; 877 + case INTC_INT_DISABLED: /* 0:0:0 */ 878 + au_writel(1 << (irq_nr - 32), IC1_CFG0CLR); 879 + au_writel(1 << (irq_nr - 32), IC1_CFG1CLR); 880 + au_writel(1 << (irq_nr - 32), IC1_CFG2CLR); 881 + break; 882 + default: /* disable the interrupt */ 883 + printk(KERN_WARNING "unexpected int type %d (irq %d)\n", 884 + type, irq_nr); 885 + au_writel(1 << (irq_nr - 32), IC1_CFG0CLR); 886 + au_writel(1 << (irq_nr - 32), IC1_CFG1CLR); 887 + au_writel(1 << (irq_nr - 32), IC1_CFG2CLR); 888 + return; 889 + } 890 + if (int_req) /* assign to interrupt request 1 */ 891 + au_writel(1 << (irq_nr - 32), IC1_ASSIGNCLR); 892 + else /* assign to interrupt request 0 */ 893 + au_writel(1 << (irq_nr - 32), IC1_ASSIGNSET); 894 + au_writel(1 << (irq_nr - 32), IC1_SRCSET); 895 + au_writel(1 << (irq_nr - 32), IC1_MASKCLR); 896 + au_writel(1 << (irq_nr - 32), IC1_WAKECLR); 897 + } else { 898 + switch (type) { 899 + case INTC_INT_RISE_EDGE: /* 0:0:1 */ 900 + au_writel(1 << irq_nr, IC0_CFG2CLR); 901 + au_writel(1 << irq_nr, IC0_CFG1CLR); 902 + au_writel(1 << irq_nr, IC0_CFG0SET); 903 + set_irq_chip(irq_nr, &rise_edge_irq_type); 904 + break; 905 + case INTC_INT_FALL_EDGE: /* 0:1:0 */ 906 + au_writel(1 << irq_nr, IC0_CFG2CLR); 907 + au_writel(1 << irq_nr, IC0_CFG1SET); 908 + au_writel(1 << irq_nr, IC0_CFG0CLR); 909 + set_irq_chip(irq_nr, &fall_edge_irq_type); 910 + break; 911 + case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 912 + au_writel(1 << irq_nr, IC0_CFG2CLR); 913 + au_writel(1 << irq_nr, IC0_CFG1SET); 914 + au_writel(1 << irq_nr, IC0_CFG0SET); 915 + set_irq_chip(irq_nr, &either_edge_irq_type); 916 + break; 917 + case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 918 + au_writel(1 << irq_nr, IC0_CFG2SET); 919 + au_writel(1 << irq_nr, IC0_CFG1CLR); 920 + au_writel(1 << irq_nr, IC0_CFG0SET); 921 + set_irq_chip(irq_nr, &level_irq_type); 922 + break; 923 + case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 924 + au_writel(1 << irq_nr, IC0_CFG2SET); 925 + au_writel(1 << irq_nr, IC0_CFG1SET); 926 + au_writel(1 << irq_nr, IC0_CFG0CLR); 927 + set_irq_chip(irq_nr, &level_irq_type); 928 + break; 929 + case INTC_INT_DISABLED: /* 0:0:0 */ 930 + au_writel(1 << irq_nr, IC0_CFG0CLR); 931 + au_writel(1 << irq_nr, IC0_CFG1CLR); 932 + au_writel(1 << irq_nr, IC0_CFG2CLR); 933 + break; 934 + default: /* disable the interrupt */ 935 + printk(KERN_WARNING "unexpected int type %d (irq %d)\n", 936 + type, irq_nr); 937 + au_writel(1 << irq_nr, IC0_CFG0CLR); 938 + au_writel(1 << irq_nr, IC0_CFG1CLR); 939 + au_writel(1 << irq_nr, IC0_CFG2CLR); 940 + return; 941 + } 942 + if (int_req) /* assign to interrupt request 1 */ 943 + au_writel(1 << irq_nr, IC0_ASSIGNCLR); 944 + else /* assign to interrupt request 0 */ 945 + au_writel(1 << irq_nr, IC0_ASSIGNSET); 946 + au_writel(1 << irq_nr, IC0_SRCSET); 947 + au_writel(1 << irq_nr, IC0_MASKCLR); 948 + au_writel(1 << irq_nr, IC0_WAKECLR); 949 + } 950 + au_sync(); 951 + } 952 + 953 + /* 954 + * Interrupts are nested. Even if an interrupt handler is registered 955 + * as "fast", we might get another interrupt before we return from 956 + * intcX_reqX_irqdispatch(). 957 + */ 958 + 959 + static void intc0_req0_irqdispatch(void) 960 + { 961 + int irq = 0; 962 + static unsigned long intc0_req0; 963 + 964 + intc0_req0 |= au_readl(IC0_REQ0INT); 965 + 966 + if (!intc0_req0) 967 + return; 968 + 969 + #ifdef AU1000_USB_DEV_REQ_INT 970 + /* 971 + * Because of the tight timing of SETUP token to reply 972 + * transactions, the USB devices-side packet complete 973 + * interrupt needs the highest priority. 974 + */ 975 + if ((intc0_req0 & (1 << AU1000_USB_DEV_REQ_INT))) { 976 + intc0_req0 &= ~(1 << AU1000_USB_DEV_REQ_INT); 977 + do_IRQ(AU1000_USB_DEV_REQ_INT); 978 + return; 979 + } 980 + #endif 981 + irq = ffs(intc0_req0); 982 + intc0_req0 &= ~(1 << irq); 983 + do_IRQ(irq); 984 + } 985 + 986 + 987 + static void intc0_req1_irqdispatch(void) 988 + { 989 + int irq = 0; 990 + static unsigned long intc0_req1; 991 + 992 + intc0_req1 |= au_readl(IC0_REQ1INT); 993 + 994 + if (!intc0_req1) 995 + return; 996 + 997 + irq = ffs(intc0_req1); 998 + intc0_req1 &= ~(1 << irq); 999 + do_IRQ(irq); 1000 + } 1001 + 1002 + 1003 + /* 1004 + * Interrupt Controller 1: 1005 + * interrupts 32 - 63 1006 + */ 1007 + static void intc1_req0_irqdispatch(void) 1008 + { 1009 + int irq = 0; 1010 + static unsigned long intc1_req0; 1011 + 1012 + intc1_req0 |= au_readl(IC1_REQ0INT); 1013 + 1014 + if (!intc1_req0) 1015 + return; 1016 + 1017 + irq = ffs(intc1_req0); 1018 + intc1_req0 &= ~(1 << irq); 1019 + irq += 32; 1020 + do_IRQ(irq); 1021 + } 1022 + 1023 + 1024 + static void intc1_req1_irqdispatch(void) 1025 + { 1026 + int irq = 0; 1027 + static unsigned long intc1_req1; 1028 + 1029 + intc1_req1 |= au_readl(IC1_REQ1INT); 1030 + 1031 + if (!intc1_req1) 1032 + return; 1033 + 1034 + irq = ffs(intc1_req1); 1035 + intc1_req1 &= ~(1 << irq); 1036 + irq += 32; 1037 + do_IRQ(irq); 1038 + } 1039 + 134 1040 asmlinkage void plat_irq_dispatch(void) 135 1041 { 136 1042 unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; ··· 556 644 intc1_req1_irqdispatch(); 557 645 else 558 646 spurious_interrupt(); 647 + } 648 + 649 + void __init arch_init_irq(void) 650 + { 651 + int i; 652 + unsigned long cp0_status; 653 + struct au1xxx_irqmap *imp; 654 + extern struct au1xxx_irqmap au1xxx_irq_map[]; 655 + extern struct au1xxx_irqmap au1xxx_ic0_map[]; 656 + extern int au1xxx_nr_irqs; 657 + extern int au1xxx_ic0_nr_irqs; 658 + 659 + cp0_status = read_c0_status(); 660 + 661 + /* Initialize interrupt controllers to a safe state. 662 + */ 663 + au_writel(0xffffffff, IC0_CFG0CLR); 664 + au_writel(0xffffffff, IC0_CFG1CLR); 665 + au_writel(0xffffffff, IC0_CFG2CLR); 666 + au_writel(0xffffffff, IC0_MASKCLR); 667 + au_writel(0xffffffff, IC0_ASSIGNSET); 668 + au_writel(0xffffffff, IC0_WAKECLR); 669 + au_writel(0xffffffff, IC0_SRCSET); 670 + au_writel(0xffffffff, IC0_FALLINGCLR); 671 + au_writel(0xffffffff, IC0_RISINGCLR); 672 + au_writel(0x00000000, IC0_TESTBIT); 673 + 674 + au_writel(0xffffffff, IC1_CFG0CLR); 675 + au_writel(0xffffffff, IC1_CFG1CLR); 676 + au_writel(0xffffffff, IC1_CFG2CLR); 677 + au_writel(0xffffffff, IC1_MASKCLR); 678 + au_writel(0xffffffff, IC1_ASSIGNSET); 679 + au_writel(0xffffffff, IC1_WAKECLR); 680 + au_writel(0xffffffff, IC1_SRCSET); 681 + au_writel(0xffffffff, IC1_FALLINGCLR); 682 + au_writel(0xffffffff, IC1_RISINGCLR); 683 + au_writel(0x00000000, IC1_TESTBIT); 684 + 685 + /* Initialize IC0, which is fixed per processor. 686 + */ 687 + imp = au1xxx_ic0_map; 688 + for (i = 0; i < au1xxx_ic0_nr_irqs; i++) { 689 + setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); 690 + imp++; 691 + } 692 + 693 + /* Now set up the irq mapping for the board. 694 + */ 695 + imp = au1xxx_irq_map; 696 + for (i = 0; i < au1xxx_nr_irqs; i++) { 697 + setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); 698 + imp++; 699 + } 700 + 701 + set_c0_status(ALLINTS); 702 + 703 + /* Board specific IRQ initialization. 704 + */ 705 + if (board_init_irq) 706 + (*board_init_irq)(); 559 707 }
+1 -1
arch/mips/au1000/db1x00/irqmap.c
··· 79 79 #endif 80 80 81 81 82 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 82 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 83 83 84 84 #ifndef CONFIG_MIPS_MIRAGE 85 85 #ifdef CONFIG_MIPS_DB1550
+1 -1
arch/mips/au1000/mtx-1/irqmap.c
··· 58 58 [7] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 07 - AdapterD-Slot1 (bottom) */ 59 59 }; 60 60 61 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 61 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 62 62 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, 63 63 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 64 64 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
+1 -1
arch/mips/au1000/pb1000/irqmap.c
··· 47 47 #include <asm/system.h> 48 48 #include <asm/mach-au1x00/au1000.h> 49 49 50 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 50 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 51 51 { AU1000_GPIO_15, INTC_INT_LOW_LEVEL, 0 }, 52 52 }; 53 53
+1 -1
arch/mips/au1000/pb1100/irqmap.c
··· 47 47 #include <asm/system.h> 48 48 #include <asm/mach-au1x00/au1000.h> 49 49 50 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 50 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 51 51 { AU1000_GPIO_9, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card Fully_Interted# 52 52 { AU1000_GPIO_10, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card STSCHG# 53 53 { AU1000_GPIO_11, INTC_INT_LOW_LEVEL, 0 }, // PCMCIA Card IRQ#
+2 -2
arch/mips/au1000/pb1200/irqmap.c
··· 54 54 #define PB1200_INT_END DB1200_INT_END 55 55 #endif 56 56 57 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 57 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 58 58 { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, // This is exteranl interrupt cascade 59 59 }; 60 60 ··· 74 74 bcsr->int_status = bisr; 75 75 for( ; bisr; bisr &= (bisr-1) ) 76 76 { 77 - extirq_nr = (PB1200_INT_BEGIN-1) + au_ffs(bisr); 77 + extirq_nr = PB1200_INT_BEGIN + au_ffs(bisr); 78 78 /* Ack and dispatch IRQ */ 79 79 do_IRQ(extirq_nr); 80 80 }
+1 -1
arch/mips/au1000/pb1500/irqmap.c
··· 52 52 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */ 53 53 }; 54 54 55 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 55 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 56 56 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, 57 57 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 58 58 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
+1 -1
arch/mips/au1000/pb1550/irqmap.c
··· 52 52 [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */ 53 53 }; 54 54 55 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 55 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 56 56 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, 57 57 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, 58 58 };
+1 -1
arch/mips/au1000/xxs1500/irqmap.c
··· 47 47 #include <asm/system.h> 48 48 #include <asm/au1000.h> 49 49 50 - au1xxx_irq_map_t __initdata au1xxx_irq_map[] = { 50 + struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 51 51 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0}, 52 52 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 53 53 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
+1 -1
arch/mips/kernel/time.c
··· 421 421 cd->mult = div_sc((unsigned long) mips_freq, NSEC_PER_SEC, 32); 422 422 cd->shift = 32; 423 423 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); 424 - cd->min_delta_ns = clockevent_delta2ns(0x30, cd); 424 + cd->min_delta_ns = clockevent_delta2ns(0x300, cd); 425 425 426 426 cd->rating = 300; 427 427 cd->irq = irq;
+15 -6
arch/mips/kernel/traps.c
··· 104 104 __setup("raw_show_trace", set_raw_show_trace); 105 105 #endif 106 106 107 - static void show_backtrace(struct task_struct *task, struct pt_regs *regs) 107 + static void show_backtrace(struct task_struct *task, const struct pt_regs *regs) 108 108 { 109 109 unsigned long sp = regs->regs[29]; 110 110 unsigned long ra = regs->regs[31]; ··· 126 126 * This routine abuses get_user()/put_user() to reference pointers 127 127 * with at least a bit of error checking ... 128 128 */ 129 - static void show_stacktrace(struct task_struct *task, struct pt_regs *regs) 129 + static void show_stacktrace(struct task_struct *task, 130 + const struct pt_regs *regs) 130 131 { 131 132 const int field = 2 * sizeof(unsigned long); 132 133 long stackdata; ··· 204 203 } 205 204 } 206 205 207 - void show_regs(struct pt_regs *regs) 206 + static void __show_regs(const struct pt_regs *regs) 208 207 { 209 208 const int field = 2 * sizeof(unsigned long); 210 209 unsigned int cause = regs->cp0_cause; ··· 300 299 cpu_name_string()); 301 300 } 302 301 303 - void show_registers(struct pt_regs *regs) 302 + /* 303 + * FIXME: really the generic show_regs should take a const pointer argument. 304 + */ 305 + void show_regs(struct pt_regs *regs) 304 306 { 305 - show_regs(regs); 307 + __show_regs((struct pt_regs *)regs); 308 + } 309 + 310 + void show_registers(const struct pt_regs *regs) 311 + { 312 + __show_regs(regs); 306 313 print_modules(); 307 314 printk("Process %s (pid: %d, threadinfo=%p, task=%p)\n", 308 315 current->comm, current->pid, current_thread_info(), current); ··· 321 312 322 313 static DEFINE_SPINLOCK(die_lock); 323 314 324 - void __noreturn die(const char * str, struct pt_regs * regs) 315 + void __noreturn die(const char * str, const struct pt_regs * regs) 325 316 { 326 317 static int die_counter; 327 318 #ifdef CONFIG_MIPS_MT_SMTC
+10 -5
arch/mips/kernel/vmlinux.lds.S
··· 5 5 #define mips mips 6 6 OUTPUT_ARCH(mips) 7 7 ENTRY(kernel_entry) 8 + PHDRS { 9 + text PT_LOAD FLAGS(7); /* RWX */ 10 + note PT_NOTE FLAGS(4); /* R__ */ 11 + } 8 12 jiffies = JIFFIES; 9 13 10 14 SECTIONS ··· 26 22 */ 27 23 28 24 /* . = 0xa800000000300000; */ 29 - /* . = 0xa800000000300000; */ 30 25 . = 0xffffffff80300000; 31 26 #endif 32 27 . = LOADADDR; ··· 35 32 TEXT_TEXT 36 33 SCHED_TEXT 37 34 LOCK_TEXT 35 + KPROBES_TEXT 38 36 *(.fixup) 39 37 *(.gnu.warning) 40 - } =0 38 + } :text = 0 41 39 _etext = .; /* End of text section */ 42 40 43 41 /* Exception table */ ··· 55 51 *(__dbe_table) 56 52 __stop___dbe_table = .; 57 53 } 54 + 55 + NOTES :text :note 56 + .dummy : { *(.dummy) } :text 57 + 58 58 RODATA 59 59 60 60 /* writeable */ ··· 208 200 .gptab.sbss : { 209 201 *(.gptab.bss) 210 202 *(.gptab.sbss) 211 - } 212 - .note : { 213 - *(.note) 214 203 } 215 204 }
+15 -12
arch/mips/kernel/vpe.c
··· 1317 1317 } 1318 1318 #endif 1319 1319 1320 - static ssize_t store_kill(struct class_device *dev, const char *buf, size_t len) 1320 + static ssize_t store_kill(struct device *dev, struct device_attribute *attr, 1321 + const char *buf, size_t len) 1321 1322 { 1322 1323 struct vpe *vpe = get_vpe(tclimit); 1323 1324 struct vpe_notifications *not; ··· 1335 1334 return len; 1336 1335 } 1337 1336 1338 - static ssize_t show_ntcs(struct class_device *cd, char *buf) 1337 + static ssize_t show_ntcs(struct device *cd, struct device_attribute *attr, 1338 + char *buf) 1339 1339 { 1340 1340 struct vpe *vpe = get_vpe(tclimit); 1341 1341 1342 1342 return sprintf(buf, "%d\n", vpe->ntcs); 1343 1343 } 1344 1344 1345 - static ssize_t store_ntcs(struct class_device *dev, const char *buf, size_t len) 1345 + static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr, 1346 + const char *buf, size_t len) 1346 1347 { 1347 1348 struct vpe *vpe = get_vpe(tclimit); 1348 1349 unsigned long new; ··· 1365 1362 return -EINVAL;; 1366 1363 } 1367 1364 1368 - static struct class_device_attribute vpe_class_attributes[] = { 1365 + static struct device_attribute vpe_class_attributes[] = { 1369 1366 __ATTR(kill, S_IWUSR, NULL, store_kill), 1370 1367 __ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs), 1371 1368 {} 1372 1369 }; 1373 1370 1374 - static void vpe_class_device_release(struct class_device *cd) 1371 + static void vpe_device_release(struct device *cd) 1375 1372 { 1376 1373 kfree(cd); 1377 1374 } ··· 1379 1376 struct class vpe_class = { 1380 1377 .name = "vpe", 1381 1378 .owner = THIS_MODULE, 1382 - .release = vpe_class_device_release, 1383 - .class_dev_attrs = vpe_class_attributes, 1379 + .dev_release = vpe_device_release, 1380 + .dev_attrs = vpe_class_attributes, 1384 1381 }; 1385 1382 1386 - struct class_device vpe_device; 1383 + struct device vpe_device; 1387 1384 1388 1385 static int __init vpe_module_init(void) 1389 1386 { ··· 1426 1423 goto out_chrdev; 1427 1424 } 1428 1425 1429 - class_device_initialize(&vpe_device); 1426 + device_initialize(&vpe_device); 1430 1427 vpe_device.class = &vpe_class, 1431 1428 vpe_device.parent = NULL, 1432 - strlcpy(vpe_device.class_id, "vpe1", BUS_ID_SIZE); 1429 + strlcpy(vpe_device.bus_id, "vpe1", BUS_ID_SIZE); 1433 1430 vpe_device.devt = MKDEV(major, minor); 1434 - err = class_device_add(&vpe_device); 1431 + err = device_add(&vpe_device); 1435 1432 if (err) { 1436 1433 printk(KERN_ERR "Adding vpe_device failed\n"); 1437 1434 goto out_class; ··· 1576 1573 } 1577 1574 } 1578 1575 1579 - class_device_del(&vpe_device); 1576 + device_del(&vpe_device); 1580 1577 unregister_chrdev(major, module_name); 1581 1578 } 1582 1579
+5 -3
arch/mips/lasat/interrupt.c
··· 26 26 #include <linux/kernel_stat.h> 27 27 28 28 #include <asm/bootinfo.h> 29 + #include <asm/irq_cpu.h> 29 30 #include <asm/lasat/lasatint.h> 30 31 #include <asm/time.h> 31 32 #include <asm/gdb-stub.h> ··· 89 88 int irq; 90 89 91 90 if (cause & CAUSEF_IP7) { /* R4000 count / compare IRQ */ 92 - ll_timer_interrupt(7); 91 + do_IRQ(7); 93 92 return; 94 93 } 95 94 ··· 97 96 98 97 /* if int_status == 0, then the interrupt has already been cleared */ 99 98 if (int_status) { 100 - irq = ls1bit32(int_status); 99 + irq = LASATINT_BASE + ls1bit32(int_status); 101 100 102 101 do_IRQ(irq); 103 102 } ··· 126 125 panic("arch_init_irq: mips_machtype incorrect"); 127 126 } 128 127 129 - for (i = 0; i <= LASATINT_END; i++) 128 + mips_cpu_irq_init(); 129 + for (i = LASATINT_BASE; i <= LASATINT_END; i++) 130 130 set_irq_chip_and_handler(i, &lasat_irq_type, handle_level_irq); 131 131 }
+1 -4
arch/mips/mipssim/sim_cmdline.c
··· 28 28 29 29 void __init prom_init_cmdline(void) 30 30 { 31 - char *cp; 32 - cp = arcs_cmdline; 33 - /* Get boot line from environment? */ 34 - *cp = '\0'; 31 + /* XXX: Get boot line from environment? */ 35 32 }
+7 -3
arch/mips/mm/c-r4k.c
··· 983 983 984 984 printk("Primary instruction cache %ldkB, %s, %s, linesize %d bytes.\n", 985 985 icache_size >> 10, 986 - cpu_has_vtag_icache ? "virtually tagged" : "physically tagged", 986 + cpu_has_vtag_icache ? "VIVT" : "VIPT", 987 987 way_string[c->icache.ways], c->icache.linesz); 988 988 989 - printk("Primary data cache %ldkB, %s, linesize %d bytes.\n", 990 - dcache_size >> 10, way_string[c->dcache.ways], c->dcache.linesz); 989 + printk("Primary data cache %ldkB, %s, %s, %s, linesize %d bytes\n", 990 + dcache_size >> 10, way_string[c->dcache.ways], 991 + (c->dcache.flags & MIPS_CACHE_PINDEX) ? "PIPT" : "VIPT", 992 + (c->dcache.flags & MIPS_CACHE_ALIASES) ? 993 + "cache aliases" : "no aliases", 994 + c->dcache.linesz); 991 995 } 992 996 993 997 /*
+12 -7
arch/mips/mm/init.c
··· 211 211 void *vfrom, *vto; 212 212 213 213 vto = kmap_atomic(to, KM_USER1); 214 - if (cpu_has_dc_aliases && !Page_dcache_dirty(from)) { 214 + if (cpu_has_dc_aliases && page_mapped(from)) { 215 215 vfrom = kmap_coherent(from, vaddr); 216 216 copy_page(vto, vfrom); 217 217 kunmap_coherent(); ··· 234 234 struct page *page, unsigned long vaddr, void *dst, const void *src, 235 235 unsigned long len) 236 236 { 237 - if (cpu_has_dc_aliases) { 237 + if (cpu_has_dc_aliases && page_mapped(page)) { 238 238 void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); 239 239 memcpy(vto, src, len); 240 240 kunmap_coherent(); 241 - } else 241 + } else { 242 242 memcpy(dst, src, len); 243 + if (cpu_has_dc_aliases) 244 + SetPageDcacheDirty(page); 245 + } 243 246 if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc) 244 247 flush_cache_page(vma, vaddr, page_to_pfn(page)); 245 248 } ··· 253 250 struct page *page, unsigned long vaddr, void *dst, const void *src, 254 251 unsigned long len) 255 252 { 256 - if (cpu_has_dc_aliases) { 257 - void *vfrom = 258 - kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); 253 + if (cpu_has_dc_aliases && page_mapped(page)) { 254 + void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); 259 255 memcpy(dst, vfrom, len); 260 256 kunmap_coherent(); 261 - } else 257 + } else { 262 258 memcpy(dst, src, len); 259 + if (cpu_has_dc_aliases) 260 + SetPageDcacheDirty(page); 261 + } 263 262 } 264 263 265 264 EXPORT_SYMBOL(copy_from_user_page);
+10 -9
arch/mips/pci/pci-lasat.c
··· 10 10 #include <linux/pci.h> 11 11 #include <linux/types.h> 12 12 #include <asm/bootinfo.h> 13 + #include <asm/lasat/lasatint.h> 13 14 14 15 extern struct pci_ops nile4_pci_ops; 15 16 extern struct pci_ops gt64xxx_pci0_ops; ··· 55 54 56 55 arch_initcall(lasat_pci_setup); 57 56 58 - #define LASATINT_ETH1 0 59 - #define LASATINT_ETH0 1 60 - #define LASATINT_HDC 2 61 - #define LASATINT_COMP 3 62 - #define LASATINT_HDLC 4 63 - #define LASATINT_PCIA 5 64 - #define LASATINT_PCIB 6 65 - #define LASATINT_PCIC 7 66 - #define LASATINT_PCID 8 57 + #define LASATINT_ETH1 (LASATINT_BASE + 0) 58 + #define LASATINT_ETH0 (LASATINT_BASE + 1) 59 + #define LASATINT_HDC (LASATINT_BASE + 2) 60 + #define LASATINT_COMP (LASATINT_BASE + 3) 61 + #define LASATINT_HDLC (LASATINT_BASE + 4) 62 + #define LASATINT_PCIA (LASATINT_BASE + 5) 63 + #define LASATINT_PCIB (LASATINT_BASE + 6) 64 + #define LASATINT_PCIC (LASATINT_BASE + 7) 65 + #define LASATINT_PCID (LASATINT_BASE + 8) 67 66 68 67 int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 69 68 {
+2
arch/mips/sgi-ip22/Makefile
··· 7 7 ip22-time.o ip22-nvram.o ip22-platform.o ip22-reset.o ip22-setup.o 8 8 9 9 obj-$(CONFIG_EISA) += ip22-eisa.o 10 + 11 + EXTRA_CFLAGS += -Werror
+8 -1
arch/mips/sgi-ip22/ip22-reset.c
··· 232 232 233 233 static int __init reboot_setup(void) 234 234 { 235 + int res; 236 + 235 237 _machine_restart = sgi_machine_restart; 236 238 _machine_halt = sgi_machine_halt; 237 239 pm_power_off = sgi_machine_power_off; 238 240 239 - request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL); 241 + res = request_irq(SGI_PANEL_IRQ, panel_int, 0, "Front Panel", NULL); 242 + if (res) { 243 + printk(KERN_ERR "Allocation of front panel IRQ failed\n"); 244 + return res; 245 + } 246 + 240 247 init_timer(&blink_timer); 241 248 blink_timer.function = blink_timeout; 242 249 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
+71 -87
arch/mips/sgi-ip32/ip32-irq.c
··· 20 20 #include <linux/random.h> 21 21 #include <linux/sched.h> 22 22 23 + #include <asm/irq_cpu.h> 23 24 #include <asm/mipsregs.h> 24 25 #include <asm/signal.h> 25 26 #include <asm/system.h> ··· 47 46 #define DBG(x...) 48 47 #endif 49 48 50 - /* O2 irq map 49 + /* 50 + * O2 irq map 51 51 * 52 52 * IP0 -> software (ignored) 53 53 * IP1 -> software (ignored) ··· 57 55 * IP4 -> (irq2) X unknown 58 56 * IP5 -> (irq3) X unknown 59 57 * IP6 -> (irq4) X unknown 60 - * IP7 -> (irq5) 0 CPU count/compare timer (system timer) 58 + * IP7 -> (irq5) 7 CPU count/compare timer (system timer) 61 59 * 62 60 * crime: (C) 63 61 * 64 62 * CRIME_INT_STAT 31:0: 65 63 * 66 - * 0 -> 1 Video in 1 67 - * 1 -> 2 Video in 2 68 - * 2 -> 3 Video out 69 - * 3 -> 4 Mace ethernet 64 + * 0 -> 8 Video in 1 65 + * 1 -> 9 Video in 2 66 + * 2 -> 10 Video out 67 + * 3 -> 11 Mace ethernet 70 68 * 4 -> S SuperIO sub-interrupt 71 69 * 5 -> M Miscellaneous sub-interrupt 72 70 * 6 -> A Audio sub-interrupt 73 - * 7 -> 8 PCI bridge errors 74 - * 8 -> 9 PCI SCSI aic7xxx 0 75 - * 9 -> 10 PCI SCSI aic7xxx 1 76 - * 10 -> 11 PCI slot 0 77 - * 11 -> 12 unused (PCI slot 1) 78 - * 12 -> 13 unused (PCI slot 2) 79 - * 13 -> 14 unused (PCI shared 0) 80 - * 14 -> 15 unused (PCI shared 1) 81 - * 15 -> 16 unused (PCI shared 2) 82 - * 16 -> 17 GBE0 (E) 83 - * 17 -> 18 GBE1 (E) 84 - * 18 -> 19 GBE2 (E) 85 - * 19 -> 20 GBE3 (E) 86 - * 20 -> 21 CPU errors 87 - * 21 -> 22 Memory errors 88 - * 22 -> 23 RE empty edge (E) 89 - * 23 -> 24 RE full edge (E) 90 - * 24 -> 25 RE idle edge (E) 91 - * 25 -> 26 RE empty level 92 - * 26 -> 27 RE full level 93 - * 27 -> 28 RE idle level 94 - * 28 -> 29 unused (software 0) (E) 95 - * 29 -> 30 unused (software 1) (E) 96 - * 30 -> 31 unused (software 2) - crime 1.5 CPU SysCorError (E) 97 - * 31 -> 32 VICE 71 + * 7 -> 15 PCI bridge errors 72 + * 8 -> 16 PCI SCSI aic7xxx 0 73 + * 9 -> 17 PCI SCSI aic7xxx 1 74 + * 10 -> 18 PCI slot 0 75 + * 11 -> 19 unused (PCI slot 1) 76 + * 12 -> 20 unused (PCI slot 2) 77 + * 13 -> 21 unused (PCI shared 0) 78 + * 14 -> 22 unused (PCI shared 1) 79 + * 15 -> 23 unused (PCI shared 2) 80 + * 16 -> 24 GBE0 (E) 81 + * 17 -> 25 GBE1 (E) 82 + * 18 -> 26 GBE2 (E) 83 + * 19 -> 27 GBE3 (E) 84 + * 20 -> 28 CPU errors 85 + * 21 -> 29 Memory errors 86 + * 22 -> 30 RE empty edge (E) 87 + * 23 -> 31 RE full edge (E) 88 + * 24 -> 32 RE idle edge (E) 89 + * 25 -> 33 RE empty level 90 + * 26 -> 34 RE full level 91 + * 27 -> 35 RE idle level 92 + * 28 -> 36 unused (software 0) (E) 93 + * 29 -> 37 unused (software 1) (E) 94 + * 30 -> 38 unused (software 2) - crime 1.5 CPU SysCorError (E) 95 + * 31 -> 39 VICE 98 96 * 99 97 * S, M, A: Use the MACE ISA interrupt register 100 98 * MACE_ISA_INT_STAT 31:0 101 99 * 102 - * 0-7 -> 33-40 Audio 103 - * 8 -> 41 RTC 104 - * 9 -> 42 Keyboard 100 + * 0-7 -> 40-47 Audio 101 + * 8 -> 48 RTC 102 + * 9 -> 49 Keyboard 105 103 * 10 -> X Keyboard polled 106 - * 11 -> 44 Mouse 104 + * 11 -> 51 Mouse 107 105 * 12 -> X Mouse polled 108 - * 13-15 -> 46-48 Count/compare timers 109 - * 16-19 -> 49-52 Parallel (16 E) 110 - * 20-25 -> 53-58 Serial 1 (22 E) 111 - * 26-31 -> 59-64 Serial 2 (28 E) 106 + * 13-15 -> 53-55 Count/compare timers 107 + * 16-19 -> 56-59 Parallel (16 E) 108 + * 20-25 -> 60-62 Serial 1 (22 E) 109 + * 26-31 -> 66-71 Serial 2 (28 E) 112 110 * 113 - * Note that this means IRQs 5-7, 43, and 45 do not exist. This is a 111 + * Note that this means IRQs 12-14, 50, and 52 do not exist. This is a 114 112 * different IRQ map than IRIX uses, but that's OK as Linux irq handling 115 113 * is quite different anyway. 116 114 */ ··· 130 128 .flags = IRQF_DISABLED, 131 129 .mask = CPU_MASK_NONE, 132 130 .name = "CRIME CPU error", 133 - }; 134 - 135 - /* 136 - * For interrupts wired from a single device to the CPU. Only the clock 137 - * uses this it seems, which is IRQ 0 and IP7. 138 - */ 139 - 140 - static void enable_cpu_irq(unsigned int irq) 141 - { 142 - set_c0_status(STATUSF_IP7); 143 - } 144 - 145 - static void disable_cpu_irq(unsigned int irq) 146 - { 147 - clear_c0_status(STATUSF_IP7); 148 - } 149 - 150 - static void end_cpu_irq(unsigned int irq) 151 - { 152 - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 153 - enable_cpu_irq(irq); 154 - } 155 - 156 - static struct irq_chip ip32_cpu_interrupt = { 157 - .name = "IP32 CPU", 158 - .ack = disable_cpu_irq, 159 - .mask = disable_cpu_irq, 160 - .mask_ack = disable_cpu_irq, 161 - .unmask = enable_cpu_irq, 162 - .end = end_cpu_irq, 163 131 }; 164 132 165 133 /* ··· 394 422 uint64_t crime_int; 395 423 int irq = 0; 396 424 425 + /* 426 + * Sanity check interrupt numbering enum. 427 + * MACE got 32 interrupts and there are 32 MACE ISA interrupts daisy 428 + * chained. 429 + */ 430 + BUILD_BUG_ON(CRIME_VICE_IRQ - MACE_VID_IN1_IRQ != 31); 431 + BUILD_BUG_ON(MACEISA_SERIAL2_RDMAOR_IRQ - MACEISA_AUDIO_SW_IRQ != 31); 432 + 397 433 crime_int = crime->istat & crime_mask; 398 - irq = __ffs(crime_int); 434 + irq = MACE_VID_IN1_IRQ + __ffs(crime_int); 399 435 crime_int = 1 << irq; 400 436 401 437 if (crime_int & CRIME_MACEISA_INT_MASK) { 402 438 unsigned long mace_int = mace->perif.ctrl.istat; 403 - irq = __ffs(mace_int & maceisa_mask) + 32; 439 + irq = __ffs(mace_int & maceisa_mask) + MACEISA_AUDIO_SW_IRQ; 404 440 } 405 - irq++; 441 + 406 442 DBG("*irq %u*\n", irq); 407 443 do_IRQ(irq); 408 444 } ··· 437 457 438 458 static void ip32_irq5(void) 439 459 { 440 - do_IRQ(IP32_R4K_TIMER_IRQ); 460 + do_IRQ(MIPS_CPU_IRQ_BASE + 7); 441 461 } 442 462 443 463 asmlinkage void plat_irq_dispatch(void) ··· 470 490 mace->perif.ctrl.istat = 0; 471 491 mace->perif.ctrl.imask = 0; 472 492 473 - for (irq = 0; irq <= IP32_IRQ_MAX; irq++) { 474 - struct irq_chip *controller; 493 + mips_cpu_irq_init(); 494 + for (irq = MIPS_CPU_IRQ_BASE + 8; irq <= IP32_IRQ_MAX; irq++) { 495 + struct irq_chip *chip; 475 496 476 - if (irq == IP32_R4K_TIMER_IRQ) 477 - controller = &ip32_cpu_interrupt; 478 - else if (irq <= MACE_PCI_BRIDGE_IRQ && irq >= MACE_VID_IN1_IRQ) 479 - controller = &ip32_mace_interrupt; 480 - else if (irq <= MACEPCI_SHARED2_IRQ && irq >= MACEPCI_SCSI0_IRQ) 481 - controller = &ip32_macepci_interrupt; 482 - else if (irq <= CRIME_VICE_IRQ && irq >= CRIME_GBE0_IRQ) 483 - controller = &ip32_crime_interrupt; 484 - else 485 - controller = &ip32_maceisa_interrupt; 497 + switch (irq) { 498 + case MACE_VID_IN1_IRQ ... MACE_PCI_BRIDGE_IRQ: 499 + chip = &ip32_mace_interrupt; 500 + break; 501 + case MACEPCI_SCSI0_IRQ ... MACEPCI_SHARED2_IRQ: 502 + chip = &ip32_macepci_interrupt; 503 + break; 504 + case CRIME_GBE0_IRQ ... CRIME_VICE_IRQ: 505 + chip = &ip32_crime_interrupt; 506 + break; 507 + default: 508 + chip = &ip32_maceisa_interrupt; 509 + } 486 510 487 - set_irq_chip(irq, controller); 511 + set_irq_chip(irq, chip); 488 512 } 489 513 setup_irq(CRIME_MEMERR_IRQ, &memerr_irq); 490 514 setup_irq(CRIME_CPUERR_IRQ, &cpuerr_irq);
+1 -1
arch/mips/sgi-ip32/ip32-setup.c
··· 83 83 void __init plat_timer_setup(struct irqaction *irq) 84 84 { 85 85 irq->handler = no_action; 86 - setup_irq(IP32_R4K_TIMER_IRQ, irq); 86 + setup_irq(MIPS_CPU_IRQ_BASE + 7, irq); 87 87 } 88 88 89 89 void __init plat_mem_setup(void)
+88 -70
include/asm-mips/ip32/ip32_ints.h
··· 9 9 #ifndef __ASM_IP32_INTS_H 10 10 #define __ASM_IP32_INTS_H 11 11 12 + #include <asm/irq.h> 13 + 12 14 /* 13 15 * This list reflects the assignment of interrupt numbers to 14 16 * interrupting events. Order is fairly irrelevant to handling 15 17 * priority. This differs from irix. 16 18 */ 17 19 18 - /* CPU */ 19 - #define IP32_R4K_TIMER_IRQ 0 20 + enum ip32_irq_no { 21 + /* 22 + * CPU interrupts are 0 ... 7 23 + */ 20 24 21 - /* MACE */ 22 - #define MACE_VID_IN1_IRQ 1 23 - #define MACE_VID_IN2_IRQ 2 24 - #define MACE_VID_OUT_IRQ 3 25 - #define MACE_ETHERNET_IRQ 4 26 - /* SUPERIO, MISC, and AUDIO are MACEISA */ 27 - #define MACE_PCI_BRIDGE_IRQ 8 25 + /* 26 + * MACE 27 + */ 28 + MACE_VID_IN1_IRQ = MIPS_CPU_IRQ_BASE + 8, 29 + MACE_VID_IN2_IRQ, 30 + MACE_VID_OUT_IRQ, 31 + MACE_ETHERNET_IRQ, 32 + /* SUPERIO, MISC, and AUDIO are MACEISA */ 33 + __MACE_SUPERIO, 34 + __MACE_MISC, 35 + __MACE_AUDIO, 36 + MACE_PCI_BRIDGE_IRQ, 28 37 29 - /* MACEPCI */ 30 - #define MACEPCI_SCSI0_IRQ 9 31 - #define MACEPCI_SCSI1_IRQ 10 32 - #define MACEPCI_SLOT0_IRQ 11 33 - #define MACEPCI_SLOT1_IRQ 12 34 - #define MACEPCI_SLOT2_IRQ 13 35 - #define MACEPCI_SHARED0_IRQ 14 36 - #define MACEPCI_SHARED1_IRQ 15 37 - #define MACEPCI_SHARED2_IRQ 16 38 + /* 39 + * MACEPCI 40 + */ 41 + MACEPCI_SCSI0_IRQ, 42 + MACEPCI_SCSI1_IRQ, 43 + MACEPCI_SLOT0_IRQ, 44 + MACEPCI_SLOT1_IRQ, 45 + MACEPCI_SLOT2_IRQ, 46 + MACEPCI_SHARED0_IRQ, 47 + MACEPCI_SHARED1_IRQ, 48 + MACEPCI_SHARED2_IRQ, 38 49 39 - /* CRIME */ 40 - #define CRIME_GBE0_IRQ 17 41 - #define CRIME_GBE1_IRQ 18 42 - #define CRIME_GBE2_IRQ 19 43 - #define CRIME_GBE3_IRQ 20 44 - #define CRIME_CPUERR_IRQ 21 45 - #define CRIME_MEMERR_IRQ 22 46 - #define CRIME_RE_EMPTY_E_IRQ 23 47 - #define CRIME_RE_FULL_E_IRQ 24 48 - #define CRIME_RE_IDLE_E_IRQ 25 49 - #define CRIME_RE_EMPTY_L_IRQ 26 50 - #define CRIME_RE_FULL_L_IRQ 27 51 - #define CRIME_RE_IDLE_L_IRQ 28 52 - #define CRIME_SOFT0_IRQ 29 53 - #define CRIME_SOFT1_IRQ 30 54 - #define CRIME_SOFT2_IRQ 31 55 - #define CRIME_SYSCORERR_IRQ CRIME_SOFT2_IRQ 56 - #define CRIME_VICE_IRQ 32 50 + /* 51 + * CRIME 52 + */ 53 + CRIME_GBE0_IRQ, 54 + CRIME_GBE1_IRQ, 55 + CRIME_GBE2_IRQ, 56 + CRIME_GBE3_IRQ, 57 + CRIME_CPUERR_IRQ, 58 + CRIME_MEMERR_IRQ, 59 + CRIME_RE_EMPTY_E_IRQ, 60 + CRIME_RE_FULL_E_IRQ, 61 + CRIME_RE_IDLE_E_IRQ, 62 + CRIME_RE_EMPTY_L_IRQ, 63 + CRIME_RE_FULL_L_IRQ, 64 + CRIME_RE_IDLE_L_IRQ, 65 + CRIME_SOFT0_IRQ, 66 + CRIME_SOFT1_IRQ, 67 + CRIME_SOFT2_IRQ, 68 + CRIME_SYSCORERR_IRQ = CRIME_SOFT2_IRQ, 69 + CRIME_VICE_IRQ, 57 70 58 - /* MACEISA */ 59 - #define MACEISA_AUDIO_SW_IRQ 33 60 - #define MACEISA_AUDIO_SC_IRQ 34 61 - #define MACEISA_AUDIO1_DMAT_IRQ 35 62 - #define MACEISA_AUDIO1_OF_IRQ 36 63 - #define MACEISA_AUDIO2_DMAT_IRQ 37 64 - #define MACEISA_AUDIO2_MERR_IRQ 38 65 - #define MACEISA_AUDIO3_DMAT_IRQ 39 66 - #define MACEISA_AUDIO3_MERR_IRQ 40 67 - #define MACEISA_RTC_IRQ 41 68 - #define MACEISA_KEYB_IRQ 42 69 - /* MACEISA_KEYB_POLL is not an IRQ */ 70 - #define MACEISA_MOUSE_IRQ 44 71 - /* MACEISA_MOUSE_POLL is not an IRQ */ 72 - #define MACEISA_TIMER0_IRQ 46 73 - #define MACEISA_TIMER1_IRQ 47 74 - #define MACEISA_TIMER2_IRQ 48 75 - #define MACEISA_PARALLEL_IRQ 49 76 - #define MACEISA_PAR_CTXA_IRQ 50 77 - #define MACEISA_PAR_CTXB_IRQ 51 78 - #define MACEISA_PAR_MERR_IRQ 52 79 - #define MACEISA_SERIAL1_IRQ 53 80 - #define MACEISA_SERIAL1_TDMAT_IRQ 54 81 - #define MACEISA_SERIAL1_TDMAPR_IRQ 55 82 - #define MACEISA_SERIAL1_TDMAME_IRQ 56 83 - #define MACEISA_SERIAL1_RDMAT_IRQ 57 84 - #define MACEISA_SERIAL1_RDMAOR_IRQ 58 85 - #define MACEISA_SERIAL2_IRQ 59 86 - #define MACEISA_SERIAL2_TDMAT_IRQ 60 87 - #define MACEISA_SERIAL2_TDMAPR_IRQ 61 88 - #define MACEISA_SERIAL2_TDMAME_IRQ 62 89 - #define MACEISA_SERIAL2_RDMAT_IRQ 63 90 - #define MACEISA_SERIAL2_RDMAOR_IRQ 64 71 + /* 72 + * MACEISA 73 + */ 74 + MACEISA_AUDIO_SW_IRQ, 75 + MACEISA_AUDIO_SC_IRQ, 76 + MACEISA_AUDIO1_DMAT_IRQ, 77 + MACEISA_AUDIO1_OF_IRQ, 78 + MACEISA_AUDIO2_DMAT_IRQ, 79 + MACEISA_AUDIO2_MERR_IRQ, 80 + MACEISA_AUDIO3_DMAT_IRQ, 81 + MACEISA_AUDIO3_MERR_IRQ, 82 + MACEISA_RTC_IRQ, 83 + MACEISA_KEYB_IRQ, 84 + /* MACEISA_KEYB_POLL is not an IRQ */ 85 + __MACEISA_KEYB_POLL, 86 + MACEISA_MOUSE_IRQ, 87 + /* MACEISA_MOUSE_POLL is not an IRQ */ 88 + __MACEISA_MOUSE_POLL, 89 + MACEISA_TIMER0_IRQ, 90 + MACEISA_TIMER1_IRQ, 91 + MACEISA_TIMER2_IRQ, 92 + MACEISA_PARALLEL_IRQ, 93 + MACEISA_PAR_CTXA_IRQ, 94 + MACEISA_PAR_CTXB_IRQ, 95 + MACEISA_PAR_MERR_IRQ, 96 + MACEISA_SERIAL1_IRQ, 97 + MACEISA_SERIAL1_TDMAT_IRQ, 98 + MACEISA_SERIAL1_TDMAPR_IRQ, 99 + MACEISA_SERIAL1_TDMAME_IRQ, 100 + MACEISA_SERIAL1_RDMAT_IRQ, 101 + MACEISA_SERIAL1_RDMAOR_IRQ, 102 + MACEISA_SERIAL2_IRQ, 103 + MACEISA_SERIAL2_TDMAT_IRQ, 104 + MACEISA_SERIAL2_TDMAPR_IRQ, 105 + MACEISA_SERIAL2_TDMAME_IRQ, 106 + MACEISA_SERIAL2_RDMAT_IRQ, 107 + MACEISA_SERIAL2_RDMAOR_IRQ, 91 108 92 - #define IP32_IRQ_MAX MACEISA_SERIAL2_RDMAOR_IRQ 109 + IP32_IRQ_MAX = MACEISA_SERIAL2_RDMAOR_IRQ 110 + }; 93 111 94 112 #endif /* __ASM_IP32_INTS_H */
+8 -1
include/asm-mips/lasat/lasatint.h
··· 1 - #define LASATINT_END 16 1 + #ifndef __ASM_LASAT_LASATINT_H 2 + #define __ASM_LASAT_LASATINT_H 3 + 4 + #include <linux/irq.h> 5 + 6 + #define LASATINT_BASE MIPS_CPU_IRQ_BASE 7 + #define LASATINT_END (LASATINT_BASE + 16) 2 8 3 9 /* lasat 100 */ 4 10 #define LASAT_INT_STATUS_REG_100 (KSEG1ADDR(0x1c880000)) ··· 16 10 #define LASAT_INT_MASK_REG_200 (KSEG1ADDR(0x1104003c)) 17 11 #define LASATINT_MASK_SHIFT_200 16 18 12 13 + #endif /* __ASM_LASAT_LASATINT_H */
+3 -20
include/asm-mips/mach-au1x00/au1000.h
··· 91 91 } 92 92 93 93 94 - static __inline__ int au_ffz(unsigned int x) 95 - { 96 - if ((x = ~x) == 0) 97 - return 32; 98 - return __ilog2(x & -x); 99 - } 100 - 101 - /* 102 - * ffs: find first bit set. This is defined the same way as 103 - * the libc and compiler builtin ffs routines, therefore 104 - * differs in spirit from the above ffz (man ffs). 105 - */ 106 - static __inline__ int au_ffs(int x) 107 - { 108 - return __ilog2(x & -x) + 1; 109 - } 110 - 111 94 /* arch/mips/au1000/common/clocks.c */ 112 95 extern void set_au1x00_speed(unsigned int new_freq); 113 96 extern unsigned int get_au1x00_speed(void); ··· 102 119 /* 103 120 * Every board describes its IRQ mapping with this table. 104 121 */ 105 - typedef struct au1xxx_irqmap { 122 + struct au1xxx_irqmap { 106 123 int im_irq; 107 124 int im_type; 108 125 int im_request; 109 - } au1xxx_irq_map_t; 126 + }; 110 127 111 128 /* 112 129 * init_IRQ looks for a table with this name. 113 130 */ 114 - extern au1xxx_irq_map_t au1xxx_irq_map[]; 131 + extern struct au1xxx_irqmap au1xxx_irq_map[]; 115 132 116 133 #endif /* !defined (_LANGUAGE_ASSEMBLY) */ 117 134
+28
include/asm-mips/pmc-sierra/msp71xx/war.h
··· 1 + /* 2 + * This file is subject to the terms and conditions of the GNU General Public 3 + * License. See the file "COPYING" in the main directory of this archive 4 + * for more details. 5 + * 6 + * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> 7 + */ 8 + #ifndef __ASM_MIPS_PMC_SIERRA_WAR_H 9 + #define __ASM_MIPS_PMC_SIERRA_WAR_H 10 + 11 + #define R4600_V1_INDEX_ICACHEOP_WAR 0 12 + #define R4600_V1_HIT_CACHEOP_WAR 0 13 + #define R4600_V2_HIT_CACHEOP_WAR 0 14 + #define R5432_CP0_INTERRUPT_WAR 0 15 + #define BCM1250_M3_WAR 0 16 + #define SIBYTE_1956_WAR 0 17 + #define MIPS4K_ICACHE_REFILL_WAR 0 18 + #define MIPS_CACHE_SYNC_WAR 0 19 + #define TX49XX_ICACHE_INDEX_INV_WAR 0 20 + #define RM9000_CDEX_SMP_WAR 0 21 + #define ICACHE_REFILLS_WORKAROUND_WAR 0 22 + #define R10000_LLSC_WAR 0 23 + #if defined(CONFIG_PMC_MSP7120_EVAL) || defined(CONFIG_PMC_MSP7120_GW) || \ 24 + defined(CONFIG_PMC_MSP7120_FPGA) 25 + #define MIPS34K_MISSED_ITLB_WAR 1 26 + #endif 27 + 28 + #endif /* __ASM_MIPS_PMC_SIERRA_WAR_H */
+2 -2
include/asm-mips/ptrace.h
··· 86 86 87 87 extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit); 88 88 89 - extern NORET_TYPE void die(const char *, struct pt_regs *) ATTRIB_NORET; 89 + extern NORET_TYPE void die(const char *, const struct pt_regs *) ATTRIB_NORET; 90 90 91 - static inline void die_if_kernel(const char *str, struct pt_regs *regs) 91 + static inline void die_if_kernel(const char *str, const struct pt_regs *regs) 92 92 { 93 93 if (unlikely(!user_mode(regs))) 94 94 die(str, regs);