On Tue, 15 Jan 2008 14:33:52 -0800, Frank Rowand <frank.rowand@am.sony.com>
wrote:
> Add polled debug driver support to serial_txx9.c for kgdb, and initialize
> the driver for the Toshiba RBTX4927.
I think Jason Wessel's kgdb patchset is a way to go.
Anyway, some comments below.
> +int kgdb_initialized;
Should be static.
> +void txx9_sio_kgdb_hook(unsigned int port, unsigned int baud_rate)
Should be static. The baud_rate is not used.
> +void
> +txx9_sio_kdbg_init(unsigned int port_number)
> +{
> + if (port_number == 1) {
> + txx9_sio_kgdb_hook(port_number, 38400);
> + kgdb_initialized = 1;
> + } else {
> + printk(KERN_ERR
> + "txx9_sio_kdbg_init(): Bad Port Number [%u] != [1]\n",
> + port_number);
> + }
> +
> + return;
> +}
Why port_number other than 1 is bad?
The "return" at the end of the function is redundant.
> +u8
> +txx9_sio_kdbg_rd(void)
> +{
> + unsigned int status, ch;
> + struct uart_txx9_port *up = &serial_txx9_ports[1];
Oh this assumes port number 1. The gdb port number should be customizable.
> + sio_out(up, TXX9_SITFIFO, (u32)ch);
The cast is not needed.
---
Atsushi Nemoto
|