How it works...

Debugging booting problems have two distinctive phases: before and after the serial console is initialized. After the serial is initialized and we can see serial output from the kernel, debugging can use the techniques described earlier.

Before the serial is initialized, however, there is basic UART support in ARM kernels that allows you to use the serial from early boot. This support is compiled in with the CONFIG_DEBUG_LL configuration variable.

This adds support for a debug-only series of assembly functions that allow you to output data to a UART. The low-level support is platform-specific, and for the i.MX6 it can be found under arch/arm/include/debug/imx.S. The code allows for this low-level UART to be configured through the CONFIG_DEBUG_IMX_UART_PORT configuration variable.

We can use this support directly by using the printascii function as follows:

extern void printascii(const char *); 
printascii("Literal string
"); 

However, it is preferable to use the early_print function, which makes use of the function explained previously and accepts formatted input in printf style, for example:

early_print("%08x	%s
", p->nr, p->name); 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset