diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-02-03 17:04:22 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-04-18 16:39:09 +0200 |
commit | fd95624dae22b00e00417dbfa1c0a4a4a40193c0 (patch) | |
tree | 8868171f83cf665f5d1b6d7514cbcd0ce796d6ab /src/console/console.c | |
parent | aece3c931e5af19764624e2517a8aeaaa15a0a6f (diff) |
console: Drop driver list in ramstage
This framework was only available in ramstage. So we had to define
console output functions separately for bootblock, romstage and SMM.
Follow-up patches will re-enable all the consoles removed here,
in a more flexible fashion, and with less lines-of-code and copy-paste.
Also the driver list is not in a well-defined order and some of the
loops could exit without visiting all drivers.
NOTE: This build has no console in ramstage.
Change-Id: Iaddc495aaca37e2a6c2c3f802a0dba27bf227a3e
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5337
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'src/console/console.c')
-rw-r--r-- | src/console/console.c | 65 |
1 files changed, 9 insertions, 56 deletions
diff --git a/src/console/console.c b/src/console/console.c index d5aadf6f32..2f4eb5c3c2 100644 --- a/src/console/console.c +++ b/src/console/console.c @@ -24,62 +24,6 @@ #include <console/ne2k.h> #include <console/spkmodem.h> -#ifndef __PRE_RAM__ - -/* initialize the console */ -void console_hw_init(void) -{ - struct console_driver *driver; - - for(driver = console_drivers; driver < econsole_drivers; driver++) { - if (!driver->init) - continue; - driver->init(); - } -} - -void console_tx_flush(void) -{ - struct console_driver *driver; - for(driver = console_drivers; driver < econsole_drivers; driver++) { - if (!driver->tx_flush) - continue; - driver->tx_flush(); - } -} - -void console_tx_byte(unsigned char byte) -{ - struct console_driver *driver; - for(driver = console_drivers; driver < econsole_drivers; driver++) { - driver->tx_byte(byte); - } -} - -unsigned char console_rx_byte(void) -{ - struct console_driver *driver; - for(driver = console_drivers; driver < econsole_drivers; driver++) { - if (driver->tst_byte) - break; - } - if (driver == econsole_drivers) - return 0; - while (!driver->tst_byte()); - return driver->rx_byte(); -} - -int console_tst_byte(void) -{ - struct console_driver *driver; - for(driver = console_drivers; driver < econsole_drivers; driver++) - if (driver->tst_byte) - return driver->tst_byte(); - return 0; -} - -#else // __PRE_RAM__ ^^^ NOT defined vvv defined - void console_hw_init(void) { #if CONFIG_CONSOLE_SERIAL @@ -98,4 +42,13 @@ void console_hw_init(void) usbdebug_init(); #endif } + +#ifndef __PRE_RAM__ +void console_tx_byte(unsigned char byte) +{ +} + +void console_tx_flush(void) +{ +} #endif |