aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/sibyte/bcm1480/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/sibyte/bcm1480/irq.c')
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c80
1 files changed, 0 insertions, 80 deletions
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index db372a0f106d..a35818ed4263 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -57,30 +57,6 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask);
57extern unsigned long ht_eoi_space; 57extern unsigned long ht_eoi_space;
58#endif 58#endif
59 59
60#ifdef CONFIG_KGDB
61#include <asm/gdb-stub.h>
62extern void breakpoint(void);
63static int kgdb_irq;
64#ifdef CONFIG_GDB_CONSOLE
65extern void register_gdb_console(void);
66#endif
67
68/* kgdb is on when configured. Pass "nokgdb" kernel arg to turn it off */
69static int kgdb_flag = 1;
70static int __init nokgdb(char *str)
71{
72 kgdb_flag = 0;
73 return 1;
74}
75__setup("nokgdb", nokgdb);
76
77/* Default to UART1 */
78int kgdb_port = 1;
79#ifdef CONFIG_SERIAL_SB1250_DUART
80extern char sb1250_duart_present[];
81#endif
82#endif
83
84static struct irq_chip bcm1480_irq_type = { 60static struct irq_chip bcm1480_irq_type = {
85 .name = "BCM1480-IMR", 61 .name = "BCM1480-IMR",
86 .ack = ack_bcm1480_irq, 62 .ack = ack_bcm1480_irq,
@@ -355,61 +331,10 @@ void __init arch_init_irq(void)
355 * does its own management of IP7. 331 * does its own management of IP7.
356 */ 332 */
357 333
358#ifdef CONFIG_KGDB
359 imask |= STATUSF_IP6;
360#endif
361 /* Enable necessary IPs, disable the rest */ 334 /* Enable necessary IPs, disable the rest */
362 change_c0_status(ST0_IM, imask); 335 change_c0_status(ST0_IM, imask);
363
364#ifdef CONFIG_KGDB
365 if (kgdb_flag) {
366 kgdb_irq = K_BCM1480_INT_UART_0 + kgdb_port;
367
368#ifdef CONFIG_SERIAL_SB1250_DUART
369 sb1250_duart_present[kgdb_port] = 0;
370#endif
371 /* Setup uart 1 settings, mapper */
372 /* QQQ FIXME */
373 __raw_writeq(M_DUART_IMR_BRK, IOADDR(A_DUART_IMRREG(kgdb_port)));
374
375 __raw_writeq(IMR_IP6_VAL,
376 IOADDR(A_BCM1480_IMR_REGISTER(0, R_BCM1480_IMR_INTERRUPT_MAP_BASE_H) +
377 (kgdb_irq << 3)));
378 bcm1480_unmask_irq(0, kgdb_irq);
379
380#ifdef CONFIG_GDB_CONSOLE
381 register_gdb_console();
382#endif
383 printk("Waiting for GDB on UART port %d\n", kgdb_port);
384 set_debug_traps();
385 breakpoint();
386 }
387#endif
388}
389
390#ifdef CONFIG_KGDB
391
392#include <linux/delay.h>
393
394#define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
395#define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg)))
396
397static void bcm1480_kgdb_interrupt(void)
398{
399 /*
400 * Clear break-change status (allow some time for the remote
401 * host to stop the break, since we would see another
402 * interrupt on the end-of-break too)
403 */
404 kstat.irqs[smp_processor_id()][kgdb_irq]++;
405 mdelay(500);
406 duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT |
407 M_DUART_RX_EN | M_DUART_TX_EN);
408 set_async_breakpoint(&get_irq_regs()->cp0_epc);
409} 336}
410 337
411#endif /* CONFIG_KGDB */
412
413extern void bcm1480_mailbox_interrupt(void); 338extern void bcm1480_mailbox_interrupt(void);
414 339
415static inline void dispatch_ip2(void) 340static inline void dispatch_ip2(void)
@@ -462,11 +387,6 @@ asmlinkage void plat_irq_dispatch(void)
462 bcm1480_mailbox_interrupt(); 387 bcm1480_mailbox_interrupt();
463#endif 388#endif
464 389
465#ifdef CONFIG_KGDB
466 else if (pending & CAUSEF_IP6)
467 bcm1480_kgdb_interrupt(); /* KGDB (uart 1) */
468#endif
469
470 else if (pending & CAUSEF_IP2) 390 else if (pending & CAUSEF_IP2)
471 dispatch_ip2(); 391 dispatch_ip2();
472} 392}