Welcome to NYCU CSIT Mirror site

kgdb8250 API

kgdb8250 API

kgdb8250_early_debug_ready — indicates when it safe to issue uart I/O
kgdb8250_arch_init — active early debugging, if configured

The kgdb8250 driver essentially hijacks a uart for use with kgdb. The aim of the implementation is to provide debugging as early as possible after the exception processing and uarts are initialized.

On some architectures or specific boards the kgdb8250 driver's registration needs to be delayed beyond the kernel argument processing time. With the kgdb8250 driver it is possible to override the default implementation so as to provide a hook to delay the I/O driver registration for kgdb.

The following is and example of code that would go into the architecture or board specific implementation to delay the kgdb8250 final initialization to the correct time.

#include <linux/kgdb8250.h>

/* ... other arch or board specific functions ... */

#ifdef CONFIG_KGDB_8250
static int kgdb8250_ready;
int kgdb8250_early_debug_ready(void)
{
	return kgdb8250_ready;
}
#endif

/* This is an example uart init function, the important part is
 * adding in the part inclusive of the #ifdef
 */
void example_uart_init(void)
{

/* ... uart and exceptions are finally setup ... */
#ifdef CONFIG_KGDB_8250
	kgdb8250_ready = 1;
	kgdb8250_arch_init();
#endif

/* Note, that if kgdbwait was specified on the
 * kernel command line the board will stop at this
 * point and wait for the debugger
 */

}
  

The API function descriptions follow for kgdb8250_early_debug_ready() and kgdb8250_arch_init().