diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2008-07-29 16:58:52 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-07-30 16:54:42 -0400 |
commit | 8d60a903d986ffa26c41f0092320a3b9da20bfaf (patch) | |
tree | f05a8ae48e275d55fcfd3acfb7b3b1b601da56ea /arch/mips/sibyte | |
parent | 8f8da9adebdf04bfb3b812a7de8706fbf179fd2c (diff) |
[MIPS] kgdb: Remove existing implementation
This patch explicitly removes the kgdb implementation, for mips which
is intended to be followed by a patch that adds a kgdb implementation
for MIPS that makes use of the kgdb core in the kernel.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sibyte')
-rw-r--r-- | arch/mips/sibyte/bcm1480/irq.c | 80 | ||||
-rw-r--r-- | arch/mips/sibyte/cfe/setup.c | 14 | ||||
-rw-r--r-- | arch/mips/sibyte/sb1250/irq.c | 60 | ||||
-rw-r--r-- | arch/mips/sibyte/swarm/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/sibyte/swarm/dbg_io.c | 76 |
5 files changed, 0 insertions, 231 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); | |||
57 | extern unsigned long ht_eoi_space; | 57 | extern unsigned long ht_eoi_space; |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifdef CONFIG_KGDB | ||
61 | #include <asm/gdb-stub.h> | ||
62 | extern void breakpoint(void); | ||
63 | static int kgdb_irq; | ||
64 | #ifdef CONFIG_GDB_CONSOLE | ||
65 | extern void register_gdb_console(void); | ||
66 | #endif | ||
67 | |||
68 | /* kgdb is on when configured. Pass "nokgdb" kernel arg to turn it off */ | ||
69 | static int kgdb_flag = 1; | ||
70 | static int __init nokgdb(char *str) | ||
71 | { | ||
72 | kgdb_flag = 0; | ||
73 | return 1; | ||
74 | } | ||
75 | __setup("nokgdb", nokgdb); | ||
76 | |||
77 | /* Default to UART1 */ | ||
78 | int kgdb_port = 1; | ||
79 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
80 | extern char sb1250_duart_present[]; | ||
81 | #endif | ||
82 | #endif | ||
83 | |||
84 | static struct irq_chip bcm1480_irq_type = { | 60 | static 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 | |||
397 | static 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 | |||
413 | extern void bcm1480_mailbox_interrupt(void); | 338 | extern void bcm1480_mailbox_interrupt(void); |
414 | 339 | ||
415 | static inline void dispatch_ip2(void) | 340 | static 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 | } |
diff --git a/arch/mips/sibyte/cfe/setup.c b/arch/mips/sibyte/cfe/setup.c index fd9604d5555a..3de30f79db3f 100644 --- a/arch/mips/sibyte/cfe/setup.c +++ b/arch/mips/sibyte/cfe/setup.c | |||
@@ -59,10 +59,6 @@ int cfe_cons_handle; | |||
59 | extern unsigned long initrd_start, initrd_end; | 59 | extern unsigned long initrd_start, initrd_end; |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | #ifdef CONFIG_KGDB | ||
63 | extern int kgdb_port; | ||
64 | #endif | ||
65 | |||
66 | static void __noreturn cfe_linux_exit(void *arg) | 62 | static void __noreturn cfe_linux_exit(void *arg) |
67 | { | 63 | { |
68 | int warm = *(int *)arg; | 64 | int warm = *(int *)arg; |
@@ -246,9 +242,6 @@ void __init prom_init(void) | |||
246 | int argc = fw_arg0; | 242 | int argc = fw_arg0; |
247 | char **envp = (char **) fw_arg2; | 243 | char **envp = (char **) fw_arg2; |
248 | int *prom_vec = (int *) fw_arg3; | 244 | int *prom_vec = (int *) fw_arg3; |
249 | #ifdef CONFIG_KGDB | ||
250 | char *arg; | ||
251 | #endif | ||
252 | 245 | ||
253 | _machine_restart = cfe_linux_restart; | 246 | _machine_restart = cfe_linux_restart; |
254 | _machine_halt = cfe_linux_halt; | 247 | _machine_halt = cfe_linux_halt; |
@@ -309,13 +302,6 @@ void __init prom_init(void) | |||
309 | } | 302 | } |
310 | } | 303 | } |
311 | 304 | ||
312 | #ifdef CONFIG_KGDB | ||
313 | if ((arg = strstr(arcs_cmdline, "kgdb=duart")) != NULL) | ||
314 | kgdb_port = (arg[10] == '0') ? 0 : 1; | ||
315 | else | ||
316 | kgdb_port = 1; | ||
317 | #endif | ||
318 | |||
319 | #ifdef CONFIG_BLK_DEV_INITRD | 305 | #ifdef CONFIG_BLK_DEV_INITRD |
320 | { | 306 | { |
321 | char *ptr; | 307 | char *ptr; |
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index eac9065ffe0c..a5158483986e 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
@@ -57,16 +57,6 @@ static void sb1250_set_affinity(unsigned int irq, cpumask_t mask); | |||
57 | extern unsigned long ldt_eoi_space; | 57 | extern unsigned long ldt_eoi_space; |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | #ifdef CONFIG_KGDB | ||
61 | static int kgdb_irq; | ||
62 | |||
63 | /* Default to UART1 */ | ||
64 | int kgdb_port = 1; | ||
65 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
66 | extern char sb1250_duart_present[]; | ||
67 | #endif | ||
68 | #endif | ||
69 | |||
70 | static struct irq_chip sb1250_irq_type = { | 60 | static struct irq_chip sb1250_irq_type = { |
71 | .name = "SB1250-IMR", | 61 | .name = "SB1250-IMR", |
72 | .ack = ack_sb1250_irq, | 62 | .ack = ack_sb1250_irq, |
@@ -313,55 +303,10 @@ void __init arch_init_irq(void) | |||
313 | * does its own management of IP7. | 303 | * does its own management of IP7. |
314 | */ | 304 | */ |
315 | 305 | ||
316 | #ifdef CONFIG_KGDB | ||
317 | imask |= STATUSF_IP6; | ||
318 | #endif | ||
319 | /* Enable necessary IPs, disable the rest */ | 306 | /* Enable necessary IPs, disable the rest */ |
320 | change_c0_status(ST0_IM, imask); | 307 | change_c0_status(ST0_IM, imask); |
321 | |||
322 | #ifdef CONFIG_KGDB | ||
323 | if (kgdb_flag) { | ||
324 | kgdb_irq = K_INT_UART_0 + kgdb_port; | ||
325 | |||
326 | #ifdef CONFIG_SERIAL_SB1250_DUART | ||
327 | sb1250_duart_present[kgdb_port] = 0; | ||
328 | #endif | ||
329 | /* Setup uart 1 settings, mapper */ | ||
330 | __raw_writeq(M_DUART_IMR_BRK, | ||
331 | IOADDR(A_DUART_IMRREG(kgdb_port))); | ||
332 | |||
333 | __raw_writeq(IMR_IP6_VAL, | ||
334 | IOADDR(A_IMR_REGISTER(0, | ||
335 | R_IMR_INTERRUPT_MAP_BASE) + | ||
336 | (kgdb_irq << 3))); | ||
337 | sb1250_unmask_irq(0, kgdb_irq); | ||
338 | } | ||
339 | #endif | ||
340 | } | ||
341 | |||
342 | #ifdef CONFIG_KGDB | ||
343 | |||
344 | #include <linux/delay.h> | ||
345 | |||
346 | #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
347 | #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
348 | |||
349 | static void sb1250_kgdb_interrupt(void) | ||
350 | { | ||
351 | /* | ||
352 | * Clear break-change status (allow some time for the remote | ||
353 | * host to stop the break, since we would see another | ||
354 | * interrupt on the end-of-break too) | ||
355 | */ | ||
356 | kstat_this_cpu.irqs[kgdb_irq]++; | ||
357 | mdelay(500); | ||
358 | duart_out(R_DUART_CMD, V_DUART_MISC_CMD_RESET_BREAK_INT | | ||
359 | M_DUART_RX_EN | M_DUART_TX_EN); | ||
360 | set_async_breakpoint(&get_irq_regs()->cp0_epc); | ||
361 | } | 308 | } |
362 | 309 | ||
363 | #endif /* CONFIG_KGDB */ | ||
364 | |||
365 | extern void sb1250_mailbox_interrupt(void); | 310 | extern void sb1250_mailbox_interrupt(void); |
366 | 311 | ||
367 | static inline void dispatch_ip2(void) | 312 | static inline void dispatch_ip2(void) |
@@ -407,11 +352,6 @@ asmlinkage void plat_irq_dispatch(void) | |||
407 | sb1250_mailbox_interrupt(); | 352 | sb1250_mailbox_interrupt(); |
408 | #endif | 353 | #endif |
409 | 354 | ||
410 | #ifdef CONFIG_KGDB | ||
411 | else if (pending & CAUSEF_IP6) /* KGDB (uart 1) */ | ||
412 | sb1250_kgdb_interrupt(); | ||
413 | #endif | ||
414 | |||
415 | else if (pending & CAUSEF_IP2) | 355 | else if (pending & CAUSEF_IP2) |
416 | dispatch_ip2(); | 356 | dispatch_ip2(); |
417 | else | 357 | else |
diff --git a/arch/mips/sibyte/swarm/Makefile b/arch/mips/sibyte/swarm/Makefile index 255d692bfa18..f18ba9201bbc 100644 --- a/arch/mips/sibyte/swarm/Makefile +++ b/arch/mips/sibyte/swarm/Makefile | |||
@@ -1,4 +1,3 @@ | |||
1 | obj-y := setup.o rtc_xicor1241.o rtc_m41t81.o | 1 | obj-y := setup.o rtc_xicor1241.o rtc_m41t81.o |
2 | 2 | ||
3 | obj-$(CONFIG_I2C_BOARDINFO) += swarm-i2c.o | 3 | obj-$(CONFIG_I2C_BOARDINFO) += swarm-i2c.o |
4 | obj-$(CONFIG_KGDB) += dbg_io.o | ||
diff --git a/arch/mips/sibyte/swarm/dbg_io.c b/arch/mips/sibyte/swarm/dbg_io.c deleted file mode 100644 index b97ae3048482..000000000000 --- a/arch/mips/sibyte/swarm/dbg_io.c +++ /dev/null | |||
@@ -1,76 +0,0 @@ | |||
1 | /* | ||
2 | * kgdb debug routines for SiByte boards. | ||
3 | * | ||
4 | * Copyright (C) 2001 MontaVista Software Inc. | ||
5 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License as published by the | ||
9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
10 | * option) any later version. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | /* -------------------- BEGINNING OF CONFIG --------------------- */ | ||
15 | |||
16 | #include <linux/delay.h> | ||
17 | #include <asm/io.h> | ||
18 | #include <asm/sibyte/sb1250.h> | ||
19 | #include <asm/sibyte/sb1250_regs.h> | ||
20 | #include <asm/sibyte/sb1250_uart.h> | ||
21 | #include <asm/sibyte/sb1250_int.h> | ||
22 | #include <asm/addrspace.h> | ||
23 | |||
24 | /* | ||
25 | * We use the second serial port for kgdb traffic. | ||
26 | * 115200, 8, N, 1. | ||
27 | */ | ||
28 | |||
29 | #define BAUD_RATE 115200 | ||
30 | #define CLK_DIVISOR V_DUART_BAUD_RATE(BAUD_RATE) | ||
31 | #define DATA_BITS V_DUART_BITS_PER_CHAR_8 /* or 7 */ | ||
32 | #define PARITY V_DUART_PARITY_MODE_NONE /* or even */ | ||
33 | #define STOP_BITS M_DUART_STOP_BIT_LEN_1 /* or 2 */ | ||
34 | |||
35 | static int duart_initialized = 0; /* 0: need to be init'ed by kgdb */ | ||
36 | |||
37 | /* -------------------- END OF CONFIG --------------------- */ | ||
38 | extern int kgdb_port; | ||
39 | |||
40 | #define duart_out(reg, val) csr_out32(val, IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
41 | #define duart_in(reg) csr_in32(IOADDR(A_DUART_CHANREG(kgdb_port, reg))) | ||
42 | |||
43 | void putDebugChar(unsigned char c); | ||
44 | unsigned char getDebugChar(void); | ||
45 | static void | ||
46 | duart_init(int clk_divisor, int data, int parity, int stop) | ||
47 | { | ||
48 | duart_out(R_DUART_MODE_REG_1, data | parity); | ||
49 | duart_out(R_DUART_MODE_REG_2, stop); | ||
50 | duart_out(R_DUART_CLK_SEL, clk_divisor); | ||
51 | |||
52 | duart_out(R_DUART_CMD, M_DUART_RX_EN | M_DUART_TX_EN); /* enable rx and tx */ | ||
53 | } | ||
54 | |||
55 | void | ||
56 | putDebugChar(unsigned char c) | ||
57 | { | ||
58 | if (!duart_initialized) { | ||
59 | duart_initialized = 1; | ||
60 | duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS); | ||
61 | } | ||
62 | while ((duart_in(R_DUART_STATUS) & M_DUART_TX_RDY) == 0); | ||
63 | duart_out(R_DUART_TX_HOLD, c); | ||
64 | } | ||
65 | |||
66 | unsigned char | ||
67 | getDebugChar(void) | ||
68 | { | ||
69 | if (!duart_initialized) { | ||
70 | duart_initialized = 1; | ||
71 | duart_init(CLK_DIVISOR, DATA_BITS, PARITY, STOP_BITS); | ||
72 | } | ||
73 | while ((duart_in(R_DUART_STATUS) & M_DUART_RX_RDY) == 0) ; | ||
74 | return duart_in(R_DUART_RX_HOLD); | ||
75 | } | ||
76 | |||