diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2011-05-10 23:36:11 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2011-05-10 23:36:11 -0400 |
commit | d12e8a2aa41a0d7b40afde44f543119500475717 (patch) | |
tree | 291f23a2ad1ffbd8fb12944276e32f569508e255 /src/output.c | |
parent | 49bf57b87238ac964ac2ae527b74a7086132e27a (diff) | |
download | seabios-hppa-d12e8a2aa41a0d7b40afde44f543119500475717.zip seabios-hppa-d12e8a2aa41a0d7b40afde44f543119500475717.tar.gz seabios-hppa-d12e8a2aa41a0d7b40afde44f543119500475717.tar.bz2 |
Add Kconfig option to specify which serial port when serial debugging.
Diffstat (limited to 'src/output.c')
-rw-r--r-- | src/output.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/output.c b/src/output.c index 4c9f95b..7c10d33 100644 --- a/src/output.c +++ b/src/output.c @@ -21,7 +21,6 @@ struct putcinfo { * Debug output ****************************************************************/ -#define DEBUG_PORT PORT_SERIAL1 #define DEBUG_TIMEOUT 100000 void @@ -31,12 +30,12 @@ debug_serial_setup(void) return; // setup for serial logging: 8N1 u8 oldparam, newparam = 0x03; - oldparam = inb(DEBUG_PORT+SEROFF_LCR); - outb(newparam, DEBUG_PORT+SEROFF_LCR); + oldparam = inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_LCR); + outb(newparam, CONFIG_DEBUG_SERIAL_PORT+SEROFF_LCR); // Disable irqs u8 oldier, newier = 0; - oldier = inb(DEBUG_PORT+SEROFF_IER); - outb(newier, DEBUG_PORT+SEROFF_IER); + oldier = inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_IER); + outb(newier, CONFIG_DEBUG_SERIAL_PORT+SEROFF_IER); if (oldparam != newparam || oldier != newier) dprintf(1, "Changing serial settings was %x/%x now %x/%x\n" @@ -50,11 +49,11 @@ debug_serial(char c) if (!CONFIG_DEBUG_SERIAL) return; int timeout = DEBUG_TIMEOUT; - while ((inb(DEBUG_PORT+SEROFF_LSR) & 0x60) != 0x60) + while ((inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_LSR) & 0x60) != 0x60) if (!timeout--) // Ran out of time. return; - outb(c, DEBUG_PORT+SEROFF_DATA); + outb(c, CONFIG_DEBUG_SERIAL_PORT+SEROFF_DATA); } // Make sure all serial port writes have been completely sent. @@ -64,7 +63,7 @@ debug_serial_flush(void) if (!CONFIG_DEBUG_SERIAL) return; int timeout = DEBUG_TIMEOUT; - while ((inb(DEBUG_PORT+SEROFF_LSR) & 0x40) != 0x40) + while ((inb(CONFIG_DEBUG_SERIAL_PORT+SEROFF_LSR) & 0x40) != 0x40) if (!timeout--) // Ran out of time. return; |