From: Xavier Bru We have been working on using your kgdb ia64 patch provided in Andrew's tree on a 2.6.7 kernel on Bull Novascale platform (Based on Intel architecture). We could use it successfully with minor changes: . we added support for UART on I/O ports: (mainly a fix in parameter order + the configuration). . we fixed a problem that prevented to use interrupts when kgdb is called early. Bull kgdb patch for 2.6.7 ia64 ------------------------------ Adds support for i/o port interface on IA 64 platforms: . add choice for i/o port/iomem support in kernel configuration. . fix parameter order for calling outb(). Fixes IRQ not working with KGDB_EARLY This patch applies on top of: kgdb-ga.patch kgdboe-netpoll.patch kgdb-ia64-support.patch diff -upN reference/arch/ia64/Kconfig current/arch/ia64/Kconfig --- reference/arch/ia64/Kconfig +++ current/arch/ia64/Kconfig @@ -241,9 +241,25 @@ config KGDB_115200BAUD bool "115200" endchoice +choice + depends on KGDB + prompt "I/O port address" + default KGDB_USE_IOMEM + +config KGDB_USE_IOMEM + bool "use I/O port IOMEM address" + help + Say yes if your system uses IOMEM address for the port (e.g. rx2600). + +config KGDB_USE_PORT + bool "use I/O port address" + help + Say yes if your systems uses I/O ports (e.g. Novascale). +endchoice + config KGDB_IOMEM hex "hex I/O port IOMEM address" - depends on KGDB + depends on KGDB_USE_IOMEM default 0xc0000000ff5e0000 help Some systems use IOMEM address for the port. This value is from @@ -251,10 +267,20 @@ config KGDB_IOMEM config KGDB_IOMEM_REG_SHIFT hex "hex I/O port IOMEM reg shift" - depends on KGDB + depends on KGDB_USE_IOMEM default 0x0 help This is the memory shift for IOMEM. + +config KGDB_PORT + hex "hex I/O port address" + default 0x3f8 + depends on KGDB + depends on KGDB_USE_PORT + help + Some systems use I/O port. + On Novascale use 0x3f8 for serial port 1 + or 0x2f8 for serial port 2. config KGDB_IRQ int "IRQ of the debug serial port" diff -upN reference/arch/ia64/lib/kgdb_serial.c current/arch/ia64/lib/kgdb_serial.c --- reference/arch/ia64/lib/kgdb_serial.c +++ current/arch/ia64/lib/kgdb_serial.c @@ -80,7 +80,8 @@ kgdb_serial_out(struct async_struct *ser writeb(ch, serial->iomem_base + offset); break; default: - outb(serial->port + offset, ch); + /* fix parameter order */ + outb( ch, serial->port + offset); break; } return; diff -upN reference/drivers/serial/8250.c current/drivers/serial/8250.c --- reference/drivers/serial/8250.c +++ current/drivers/serial/8250.c @@ -1236,6 +1236,7 @@ static void serial8250_break_ctl(struct #ifdef CONFIG_KGDB static int kgdb_irq = -1; +static int kgdb_port = -1; #endif static int serial8250_startup(struct uart_port *port) @@ -1880,7 +1881,8 @@ static void __init serial8250_register_p struct uart_8250_port *up = &serial8250_ports[i]; #ifdef CONFIG_KGDB - if (up->port.irq == kgdb_irq) + /* at this point irq could be 0 for the port (KGDB_EARLY) */ + if (up->port.irq == kgdb_irq || up->port.iobase == kgdb_port) up->port.kgdb = 1; #endif up->port.line = i; @@ -2178,6 +2180,7 @@ void shutdown_for_kgdb(struct async_stru int ttyS; kgdb_irq = irq; /* save for later init */ + kgdb_port = info->port; for (ttyS = 0; ttyS < UART_NR; ttyS++){ up = &serial8250_ports[ttyS]; if (up->port.irq == irq && (irq_lists + irq)->head) {