coreboot/src/lib/subr.c
Eric W. Biederman a8151ba2cd Initial checkin for supermicro p4dc6
This also includes a bunch of my pending work including
- Updated serial code so we can compile in different serial port speeds
- Updates to the build system so that:
  - Makefile.settings holds all of the settings of the config variables
  - ldoptions and cpuflags are generated automatically with perl scripts
  - src/config/Config holds all of the architecture neutral make file settings
- Initial work on the P4 including how to use cache as ram
- Update to the ioapic code for the P4 because it delivers irqs on the system
  bus instead of an out of band bus
- Updated version of printf that doesn't need an intermediate buffer
  - logbuf_subr now handles the case when we want to use a log buffer
- video_subr handles the preliminary code for writing to a video device.
- Pending changes for the L440GX are merged in as well (hopefully I haven't
  messed then up since they were written).
2001-11-03 02:11:49 +00:00

95 lines
1.3 KiB
C

/*
* Bootstrap code for the INTEL
* $Id$
*
*/
#ifndef lint
static char rcsid[] = "$Id$";
#endif
#include <arch/io.h>
#include <printk.h>
#include <pci.h>
#include <subr.h>
#include <string.h>
#ifdef SERIAL_CONSOLE
#include <serial_subr.h>
#endif
#ifdef VIDEO_CONSOLE
#include <video_subr.h>
#endif
#ifdef LOGBUF_CONSOLE
#include <logbuf_subr.h>
#endif
// initialize the display
void displayinit(void)
{
#ifdef VIDEO_CONSOLE
video_init();
#endif
#ifdef SERIAL_CONSOLE
ttys0_init();
#endif
}
static void __display_tx_byte(unsigned char byte)
{
#ifdef VIDEO_CONSOLE
video_tx_byte(byte);
#endif
#ifdef SERIAL_CONSOLE
ttys0_tx_byte(byte);
#endif
#ifdef SROM_CONSOLE
srom_tx_byte(byte);
#endif
#ifdef LOGBUF_CONSOLE
logbuf_tx_byte(byte);
#endif
}
void display_tx_break(void)
{
}
void display_tx_byte(unsigned char byte)
{
if (byte == '\n')
__display_tx_byte('\r');
__display_tx_byte(byte);
}
void display(char *string)
{
while(*string) {
display_tx_byte(*string);
string++;
}
display_tx_break();
}
void error(char errmsg[])
{
display(errmsg);
while (1); /* Halt */
}
/*
* Write POST information
*/
void post_code(uint8_t value)
{
#ifdef SERIAL_POST
unsigned long hi, lo;
rdtsc(lo, hi);
printk_info("POST: 0x%02x, TSC Lo: %d, Hi: %d\n",
value, lo, hi);
#endif
outb(value, 0x80);
}