2 * Bootstrap code for the INTEL
5 #include <console/console.h>
10 #if CONFIG_CONSOLE_NE2K
11 #include <console/ne2k.h>
16 #include <pc80/mc146818rtc.h>
18 /* initialize the console */
19 void console_init(void)
21 struct console_driver *driver;
22 if(get_option(&console_loglevel, "debug_level"))
23 console_loglevel=CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
25 for(driver = console_drivers; driver < econsole_drivers; driver++) {
32 static void __console_tx_byte(unsigned char byte)
34 struct console_driver *driver;
35 for(driver = console_drivers; driver < econsole_drivers; driver++) {
36 driver->tx_byte(byte);
40 void console_tx_flush(void)
42 struct console_driver *driver;
43 for(driver = console_drivers; driver < econsole_drivers; driver++) {
44 if (!driver->tx_flush)
50 void console_tx_byte(unsigned char byte)
53 __console_tx_byte('\r');
54 __console_tx_byte(byte);
57 unsigned char console_rx_byte(void)
59 struct console_driver *driver;
60 for(driver = console_drivers; driver < econsole_drivers; driver++) {
64 if (driver == econsole_drivers)
66 while (!driver->tst_byte());
67 return driver->rx_byte();
70 int console_tst_byte(void)
72 struct console_driver *driver;
73 for(driver = console_drivers; driver < econsole_drivers; driver++)
75 return driver->tst_byte();
80 * Write POST information
82 void post_code(u8 value)
84 #if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
85 #if CONFIG_SERIAL_POST==1
86 printk(BIOS_EMERG, "POST: 0x%02x\n", value);
92 /* Report a fatal error */
93 void __attribute__((noreturn)) die(const char *msg)
95 printk(BIOS_EMERG, "%s", msg);
103 void console_init(void)
106 #if CONFIG_CONSOLE_NE2K
107 ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);
109 static const char console_test[] =
112 COREBOOT_EXTRA_VERSION
116 print_info(console_test);
119 void post_code(u8 value)
121 #if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
122 #if CONFIG_SERIAL_POST==1
123 print_emerg("POST: 0x");
124 print_emerg_hex8(value);
131 void die(const char *str)