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>
This commit is contained in:
Kyösti Mälkki
2014-02-03 17:04:22 +02:00
parent aece3c931e
commit fd95624dae
15 changed files with 9 additions and 379 deletions

View File

@ -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