summaryrefslogtreecommitdiffstats
path: root/src/core/serial.c
diff options
context:
space:
mode:
authorMichael Brown2006-09-01 02:19:09 +0200
committerMichael Brown2006-09-01 02:19:09 +0200
commit66dcd22f6193aaaca7c734da9bf7ce206f2c1a63 (patch)
treedebb4d5cf703f0900ab14352fa95cc0ffc41666f /src/core/serial.c
parentCheck to see if we've reached the end of the map before attempting to (diff)
downloadipxe-66dcd22f6193aaaca7c734da9bf7ce206f2c1a63.tar.gz
ipxe-66dcd22f6193aaaca7c734da9bf7ce206f2c1a63.tar.xz
ipxe-66dcd22f6193aaaca7c734da9bf7ce206f2c1a63.zip
Added debug to catch initialisation failures
Diffstat (limited to 'src/core/serial.c')
-rw-r--r--src/core/serial.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/core/serial.c b/src/core/serial.c
index 94bb8d12..6383a48b 100644
--- a/src/core/serial.c
+++ b/src/core/serial.c
@@ -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 */