mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
Added debug to catch initialisation failures
This commit is contained in:
parent
78dd963c1f
commit
66dcd22f61
@ -165,23 +165,35 @@ static void serial_init ( void ) {
|
||||
*/
|
||||
uart_writeb(0x80 | lcs, UART_BASE + UART_LCR);
|
||||
uart_writeb(0xaa, UART_BASE + UART_DLL);
|
||||
if (uart_readb(UART_BASE + UART_DLL) != 0xaa)
|
||||
if (uart_readb(UART_BASE + UART_DLL) != 0xaa) {
|
||||
DBG ( "Serial port %#x UART_DLL failed\n", UART_BASE );
|
||||
goto out;
|
||||
}
|
||||
uart_writeb(0x55, UART_BASE + UART_DLL);
|
||||
if (uart_readb(UART_BASE + UART_DLL) != 0x55)
|
||||
if (uart_readb(UART_BASE + UART_DLL) != 0x55) {
|
||||
DBG ( "Serial port %#x UART_DLL failed\n", UART_BASE );
|
||||
goto out;
|
||||
}
|
||||
uart_writeb(divisor & 0xff, UART_BASE + UART_DLL);
|
||||
if (uart_readb(UART_BASE + UART_DLL) != (divisor & 0xff))
|
||||
if (uart_readb(UART_BASE + UART_DLL) != (divisor & 0xff)) {
|
||||
DBG ( "Serial port %#x UART_DLL failed\n", UART_BASE );
|
||||
goto out;
|
||||
}
|
||||
uart_writeb(0xaa, UART_BASE + UART_DLM);
|
||||
if (uart_readb(UART_BASE + UART_DLM) != 0xaa)
|
||||
if (uart_readb(UART_BASE + UART_DLM) != 0xaa) {
|
||||
DBG ( "Serial port %#x UART_DLM failed\n", UART_BASE );
|
||||
goto out;
|
||||
}
|
||||
uart_writeb(0x55, UART_BASE + UART_DLM);
|
||||
if (uart_readb(UART_BASE + UART_DLM) != 0x55)
|
||||
if (uart_readb(UART_BASE + UART_DLM) != 0x55) {
|
||||
DBG ( "Serial port %#x UART_DLM failed\n", UART_BASE );
|
||||
goto out;
|
||||
}
|
||||
uart_writeb((divisor >> 8) & 0xff, UART_BASE + UART_DLM);
|
||||
if (uart_readb(UART_BASE + UART_DLM) != ((divisor >> 8) & 0xff))
|
||||
if (uart_readb(UART_BASE + UART_DLM) != ((divisor >> 8) & 0xff)) {
|
||||
DBG ( "Serial port %#x UART_DLM failed\n", UART_BASE );
|
||||
goto out;
|
||||
}
|
||||
uart_writeb(lcs, UART_BASE + UART_LCR);
|
||||
|
||||
/* disable interrupts */
|
||||
|
Loading…
Reference in New Issue
Block a user