2 * Bootstrap code for the INTEL
5 #include <console/console.h>
12 #include <pc80/mc146818rtc.h>
15 /* initialize the console */
16 void console_init(void)
18 struct console_driver *driver;
19 if(get_option(&console_loglevel, "debug_level"))
20 console_loglevel=CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
22 for(driver = console_drivers; driver < econsole_drivers; driver++) {
29 static void __console_tx_byte(unsigned char byte)
31 struct console_driver *driver;
32 for(driver = console_drivers; driver < econsole_drivers; driver++) {
33 driver->tx_byte(byte);
37 void console_tx_flush(void)
39 struct console_driver *driver;
40 for(driver = console_drivers; driver < econsole_drivers; driver++) {
41 if (!driver->tx_flush)
47 void console_tx_byte(unsigned char byte)
50 __console_tx_byte('\r');
51 __console_tx_byte(byte);
54 unsigned char console_rx_byte(void)
56 struct console_driver *driver;
57 for(driver = console_drivers; driver < econsole_drivers; driver++) {
61 if (driver == econsole_drivers)
63 while (!driver->tst_byte());
64 return driver->rx_byte();
67 int console_tst_byte(void)
69 struct console_driver *driver;
70 for(driver = console_drivers; driver < econsole_drivers; driver++)
72 return driver->tst_byte();
77 * Write POST information
79 void post_code(u8 value)
81 #if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
82 #if CONFIG_SERIAL_POST==1
83 printk(BIOS_EMERG, "POST: 0x%02x\n", value);
89 /* Report a fatal error */
90 void __attribute__((noreturn)) die(const char *msg)
92 printk(BIOS_EMERG, "%s", msg);
100 void console_init(void)
102 static const char console_test[] =
105 COREBOOT_EXTRA_VERSION
109 print_info(console_test);
112 void post_code(u8 value)
114 #if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
115 #if CONFIG_SERIAL_POST==1
116 print_emerg("POST: 0x");
117 print_emerg_hex8(value);
124 void die(const char *str)