Skip to contentSkip to conversation

kgdb support in Linux 2.6 for 8xx

DISCUSSION Chris 2 participants 2 messages Oct 21, 2005 Library code

lore
Share & tools
lore

Chris

author
#0 lore raw

Hi,

It would be nice to be able to do some kernel debugging on my TQM823L board running 2.6 (2.6.13.1, to be exact). I have two questions

1. Has anyone got kgdboe working in this configuration? If so, could you give me a pointer to a patch?

2. kgdb over serial is lacking the getDebugChar and putDebugChar functions that used to be in 8xx_io/uart.c. Has anyone done any work on merging them into 2.6?

[OK, that's actually three questions. One just crept in]

Thanks in advance,
Chris

#1 lore raw

Hi!

Quoted 6 lines · Chris

Hi,

It would be nice to be able to do some kernel debugging on my TQM823L board running 2.6 (2.6.13.1, to be exact). I have two questions

1. Has anyone got kgdboe working in this configuration? If so, could you give me a pointer to a patch?

Not exactly. I have implemented support for KGDB on cpm_uart driven boards (most of 8xx use it), but it is only tested on 827x family. Anyway, 8xx should work with minimal changes.

Quoted 2 lines

2. kgdb over serial is lacking the getDebugChar and putDebugChar functions that used to be in 8xx_io/uart.c. Has anyone done any work on merging them into 2.6?

There is a kgdb community project - http://kgdb.sf.net. The attached patch is for this one (it has been submitted but not in the CVS so far).

Quoted 10 lines

[OK, that's actually three questions. One just crept in]

Thanks in advance,
Chris
_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

Signature · 2 lines
Sincerely,
Vitaly

This add support for KGDB using cpm_uart driver. Should work on all the boards utilizing it, tested on 8272ADS.

drivers/serial/cpm_uart/Makefile +1 -0
Index: linux-2.6.13.1/drivers/serial/cpm_uart/Makefile
===================================================================
@@ -7,5 +7,6 @@ obj-$(CONFIG_SERIAL_CPM) += cpm_uart.o
 # Select the correct platform objects.
 cpm_uart-objs-$(CONFIG_CPM2)	+= cpm_uart_cpm2.o
 cpm_uart-objs-$(CONFIG_8xx)	+= cpm_uart_cpm1.o
+cpm_uart-objs-$(CONFIG_KGDB)	+= cpm_uart_kgdb.o
 
 cpm_uart-objs	:= cpm_uart_core.o $(cpm_uart-objs-y)
drivers/serial/cpm_uart/cpm_uart.h +50 -0

66 lines not on this page · raw message

drivers/serial/cpm_uart/cpm_uart_core.c +64 -51

169 lines not on this page · raw message

drivers/serial/cpm_uart/cpm_uart_cpm2.c +4 -0
Index: linux-2.6.13.1/drivers/serial/cpm_uart/cpm_uart_cpm2.c
===================================================================
@@ -252,6 +252,10 @@ int cpm_uart_init_portdesc(void)
 {
 	pr_debug("CPM uart[-]:init portdesc\n");
 
+	/* Check if we have called this yet. This may happen if early kgdb
+	breakpoint is on */
+	if(cpm_uart_nr)
+		return 0;
 	cpm_uart_nr = 0;
 #ifdef CONFIG_SERIAL_CPM_SMC1
 	cpm_uart_ports[UART_SMC1].smcp = (smc_t *) & cpm2_immr->im_smc[0];
lib/Kconfig.debug +62 -0

80 lines not on this page · raw message

drivers/serial/cpm_uart/cpm_uart_kgdb.c new file +191 -0

191 lines not on this page · raw message