Printing coreboot debug messages on VGA console is pretty much useless, since

initializing VGA happens pretty much as the last thing before starting the
payload. Hence, drop VGA console support, as we did in coreboot v3.

- Drop VGA and BTEXT console support. 
  Console is meant to be debugging only, and by the time graphics comes up
  99% of the risky stuff has already happened. Note: This patch does not remove
  hardware init but only the actual output functionality. 

  The ragexl driver needs some extra love, but that's for another day
- factor out die() and post()
- drop some leftover RAMBASE < 0x100000 checks.

Signed-off-by: Stefan Reinauer <stepan@coreboot.org>
Acked-by: QingPei Wang<wangqingpei@gmail.com>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6111 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer 2010-11-22 08:09:50 +00:00 committed by Stefan Reinauer
parent e9c447326a
commit abc0c85516
25 changed files with 101 additions and 5392 deletions

View File

@ -122,10 +122,10 @@ struct cb_console {
};
#define CB_TAG_CONSOLE_SERIAL8250 0
#define CB_TAG_CONSOLE_VGA 1
#define CB_TAG_CONSOLE_BTEXT 2
#define CB_TAG_CONSOLE_VGA 1 // OBSOLETE
#define CB_TAG_CONSOLE_BTEXT 2 // OBSOLETE
#define CB_TAG_CONSOLE_LOGBUF 3
#define CB_TAG_CONSOLE_SROM 4
#define CB_TAG_CONSOLE_SROM 4 // OBSOLETE
#define CB_TAG_CONSOLE_EHCI 5
#define CB_TAG_FORWARD 0x00011

View File

@ -134,18 +134,9 @@ static void lb_console(struct lb_header *header)
#if CONFIG_CONSOLE_SERIAL8250
add_console(header, LB_TAG_CONSOLE_SERIAL8250);
#endif
#if CONFIG_CONSOLE_VGA
add_console(header, LB_TAG_CONSOLE_VGA);
#endif
#if CONFIG_CONSOLE_BTEXT
add_console(header, LB_TAG_CONSOLE_BTEXT);
#endif
#if CONFIG_CONSOLE_LOGBUF
add_console(header, LB_TAG_CONSOLE_LOGBUF);
#endif
#if CONFIG_CONSOLE_SROM
add_console(header, LB_TAG_CONSOLE_SROM);
#endif
#if CONFIG_USBDEBUG
add_console(header, LB_TAG_CONSOLE_EHCI);
#endif

View File

@ -25,14 +25,10 @@ void cbfs_and_run_core(const char *filename, unsigned ebp)
{
u8 *dst;
print_debug("Loading stage image.\n");
print_debug("Loading image.\n");
dst = cbfs_load_stage(filename);
if (dst == (void *) -1) {
/* We should use die() here. */
print_emerg("Loading stage failed!\n");
for (;;)
asm("hlt\n");
}
if ((void *)dst == (void *) -1)
die("FATAL: Essential component is missing.\n");
print_debug("Jumping to image.\n");
__asm__ volatile (

View File

@ -133,13 +133,9 @@ config USBDEBUG_DEFAULT_PORT
on your mainboard) is highly board-specific, and you'll likely
have to find out by trial-and-error.
config CONSOLE_VGA
bool "Use VGA console once initialized"
default n
# TODO: Deps?
# TODO: Improve description.
config CONSOLE_VGA_ONBOARD_AT_FIRST
config ONBOARD_VGA_IS_PRIMARY
bool "Use onboard VGA as primary video device"
default n
help
@ -322,14 +318,6 @@ config DEFAULT_CONSOLE_LOGLEVEL
help
Map the log level config names to an integer.
config CONSOLE_BTEXT
bool
default n
config CONSOLE_SROM
bool
default n
config CONSOLE_LOGBUF
bool
default n

View File

@ -2,18 +2,19 @@ ramstage-y += printk.c
ramstage-y += console.c
ramstage-y += vtxprintf.c
ramstage-y += vsprintf.c
ramstage-y += post.c
ramstage-y += die.c
smm-y += printk.c
smm-y += vtxprintf.c
romstage-y += vtxprintf.c
romstage-$(CONFIG_CACHE_AS_RAM) += console.c
romstage-y += post.c
romstage-y += die.c
driver-$(CONFIG_CONSOLE_SERIAL8250) += uart8250_console.c
driver-$(CONFIG_USBDEBUG) += usbdebug_console.c
driver-$(CONFIG_CONSOLE_VGA) += vga_console.c
driver-$(CONFIG_CONSOLE_BTEXT) += btext_console.c
driver-$(CONFIG_CONSOLE_BTEXT) += font-8x16.c
driver-$(CONFIG_CONSOLE_LOGBUF) += logbuf_console.c
driver-$(CONFIG_CONSOLE_NE2K) += ne2k_console.c

View File

@ -1,454 +0,0 @@
/*
* Procedures for drawing on the screen early on in the boot process.
*
* Benjamin Herrenschmidt <benh@kernel.crashing.org>
*
* move to coreboot by LYH yhlu@tyan.com
*/
#if 0
#include <delay.h>
#include <stdlib.h>
#include <string.h>
#include <arch/io.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#endif
#include <arch/io.h>
#include <string.h>
#include <console/console.h>
#include <arch/byteorder.h>
#include <console/btext.h>
//#define NO_SCROLL
#ifndef NO_SCROLL
static void scrollscreen(void);
#endif
static void draw_byte(unsigned char c, u32 locX, u32 locY);
#if 0
static void draw_byte_32(unsigned char *bits, u32 *base, u32 rb);
static void draw_byte_16(unsigned char *bits, u32 *base, u32 rb);
#endif
static void draw_byte_8(unsigned char *bits, u32 *base, u32 rb);
static u32 g_loc_X;
static u32 g_loc_Y;
static u32 g_max_loc_X;
static u32 g_max_loc_Y;
#define CHAR_256 0
#if CHAR_256==1
#define cmapsz (16*256)
#else
#define cmapsz (16*96)
#endif
extern unsigned char vga_font[cmapsz];
u32 boot_text_mapped;
boot_infos_t disp_bi;
#define BTEXT
#define BTDATA
/* This function will enable the early boot text when doing OF booting. This
* way, xmon output should work too
*/
void
btext_setup_display(u32 width, u32 height, u32 depth, u32 pitch,
unsigned long address)
{
boot_infos_t* bi = &disp_bi;
g_loc_X = 0;
g_loc_Y = 0;
g_max_loc_X = width / 8;
g_max_loc_Y = height / 16;
// bi->logicalDisplayBase = (unsigned char *)address;
bi->dispDeviceBase = (unsigned char *)address;
bi->dispDeviceRowBytes = pitch;
bi->dispDeviceDepth = depth;
bi->dispDeviceRect[0] = bi->dispDeviceRect[1] = 0;
bi->dispDeviceRect[2] = width;
bi->dispDeviceRect[3] = height;
boot_text_mapped = 0;
}
/* Here's a small text engine to use during early boot
* or for debugging purposes
*
* todo:
*
* - build some kind of vgacon with it to enable early printk
* - move to a separate file
* - add a few video driver hooks to keep in sync with display
* changes.
*/
void
map_boot_text(void)
{
#if 0
unsigned long base, offset, size;
boot_infos_t *bi = &disp_bi;
if (bi->dispDeviceBase == 0)
return;
base = ((unsigned long) bi->dispDeviceBase) & 0xFFFFF000UL;
offset = ((unsigned long) bi->dispDeviceBase) - base;
size = bi->dispDeviceRowBytes * bi->dispDeviceRect[3] + offset
+ bi->dispDeviceRect[0];
bi->logicalDisplayBase = ioremap(base,0x800000 );
if (bi->logicalDisplayBase == 0)
return;
// bi->logicalDisplayBase += offset;
#endif
boot_text_mapped = 1;
}
/* Calc the base address of a given point (x,y) */
static unsigned char * BTEXT
calc_base(boot_infos_t *bi, u32 x, u32 y)
{
unsigned char *base;
#if 0
base = bi->logicalDisplayBase;
if (base == 0)
#endif
base = bi->dispDeviceBase;
base += (x + bi->dispDeviceRect[0]) * (bi->dispDeviceDepth >> 3);
base += (y + bi->dispDeviceRect[1]) * bi->dispDeviceRowBytes;
return base;
}
/* Adjust the display to a new resolution */
void
btext_update_display(unsigned long phys, u32 width, u32 height,
u32 depth, u32 pitch)
{
boot_infos_t *bi = &disp_bi;
#if 0
if (bi->dispDeviceBase == 0)
return;
/* check it's the same frame buffer (within 256MB) */
if ((phys ^ (unsigned long)bi->dispDeviceBase) & 0xf0000000)
return;
#endif
bi->dispDeviceBase = (u8 *) phys;
bi->dispDeviceRect[0] = 0;
bi->dispDeviceRect[1] = 0;
bi->dispDeviceRect[2] = width;
bi->dispDeviceRect[3] = height;
bi->dispDeviceDepth = depth;
bi->dispDeviceRowBytes = pitch;
if (boot_text_mapped) {
#if 0
iounmap(bi->logicalDisplayBase);
#endif
boot_text_mapped = 0;
}
map_boot_text();
g_loc_X = 0;
g_loc_Y = 0;
g_max_loc_X = width / 8;
g_max_loc_Y = height / 16;
}
void BTEXT btext_clearscreen(void)
{
boot_infos_t* bi = &disp_bi;
u32 *base = (u32 *)calc_base(bi, 0, 0);
u32 width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
(bi->dispDeviceDepth >> 3)) >> 2;
u32 i,j;
for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
{
u32 *ptr = base;
for(j=width; j; --j)
*(ptr++) = 0;
base += (bi->dispDeviceRowBytes >> 2);
}
}
#if 0
__inline__ void dcbst(const void* addr)
{
__asm__ __volatile__ ("dcbst 0,%0" :: "r" (addr));
}
void BTEXT btext_flushscreen(void)
{
boot_infos_t* bi = &disp_bi;
u32 *base = (unsigned long *)calc_base(bi, 0, 0);
u32 width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
(bi->dispDeviceDepth >> 3)) >> 2;
u32 i,j;
for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1]); i++)
{
u32 *ptr = base;
for(j=width; j>0; j-=8) {
dcbst(ptr);
ptr += 8;
}
base += (bi->dispDeviceRowBytes >> 2);
}
}
#endif
#ifndef NO_SCROLL
static BTEXT void
scrollscreen(void)
{
boot_infos_t* bi = &disp_bi;
u32 *src = (u32 *)calc_base(bi,0,16);
u32 *dst = (u32 *)calc_base(bi,0,0);
u32 width = ((bi->dispDeviceRect[2] - bi->dispDeviceRect[0]) *
(bi->dispDeviceDepth >> 3)) >> 2;
u32 i,j;
for (i=0; i<(bi->dispDeviceRect[3] - bi->dispDeviceRect[1] - 16); i++)
{
u32 *src_ptr = src;
u32 *dst_ptr = dst;
for(j=width; j; --j)
*(dst_ptr++) = *(src_ptr++);
src += (bi->dispDeviceRowBytes >> 2);
dst += (bi->dispDeviceRowBytes >> 2);
}
for (i=0; i<16; i++)
{
u32 *dst_ptr = dst;
for(j=width; j; --j)
*(dst_ptr++) = 0;
dst += (bi->dispDeviceRowBytes >> 2);
}
}
#endif /* ndef NO_SCROLL */
void BTEXT btext_drawchar(char c)
{
u32 cline = 0;
if (!boot_text_mapped)
return;
switch (c) {
case '\b':
if (g_loc_X > 0)
--g_loc_X;
break;
case '\t':
g_loc_X = (g_loc_X & -8) + 8;
break;
case '\r':
g_loc_X = 0;
break;
case '\n':
g_loc_X = 0;
g_loc_Y++;
cline = 1;
break;
default:
draw_byte(c, g_loc_X++, g_loc_Y);
}
if (g_loc_X >= g_max_loc_X) {
g_loc_X = 0;
g_loc_Y++;
cline = 1;
}
#ifndef NO_SCROLL
while (g_loc_Y >= g_max_loc_Y) {
scrollscreen();
g_loc_Y--;
}
#else
/* wrap around from bottom to top of screen so we don't
waste time scrolling each line. -- paulus. */
if (g_loc_Y >= g_max_loc_Y)
g_loc_Y = 0;
if (cline) {
for (x = 0; x < g_max_loc_X; ++x)
draw_byte(' ', x, g_loc_Y);
}
#endif
}
#if 0
void BTEXT
btext_drawstring(const char *c)
{
if (!boot_text_mapped)
return;
while (*c)
btext_drawchar(*c++);
}
void BTEXT
btext_drawhex(u32 v)
{
static char hex_table[] = "0123456789abcdef";
if (!boot_text_mapped)
return;
btext_drawchar(hex_table[(v >> 28) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 24) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 20) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 16) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 12) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 8) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 4) & 0x0000000FUL]);
btext_drawchar(hex_table[(v >> 0) & 0x0000000FUL]);
btext_drawchar(' ');
}
#endif
static void BTEXT
draw_byte(unsigned char c, u32 locX, u32 locY)
{
boot_infos_t* bi = &disp_bi;
unsigned char *base = calc_base(bi, locX << 3, locY << 4);
#if CHAR_256==1
unsigned char *font = &vga_font[((u32)c) * 16];
#else
unsigned char *font = &vga_font[((u32)c-0x20) * 16]; // skip the first 0x20
#endif
u32 rb = bi->dispDeviceRowBytes;
switch(bi->dispDeviceDepth) {
#if 0
case 24:
case 32:
draw_byte_32(font, (u32 *)base, rb);
break;
case 15:
case 16:
draw_byte_16(font, (u32 *)base, rb);
break;
#endif
case 8:
draw_byte_8(font, (u32 *)base, rb);
break;
}
}
static u32 expand_bits_8[16] BTDATA = {
#if defined(__BIG_ENDIAN)
0x00000000,0x000000ff,0x0000ff00,0x0000ffff,
0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff,
0xff000000,0xff0000ff,0xff00ff00,0xff00ffff,
0xffff0000,0xffff00ff,0xffffff00,0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000,0xff000000,0x00ff0000,0xffff0000,
0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00,
0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff,
0x0000ffff,0xff00ffff,0x00ffffff,0xffffffff
#else
#error FIXME: No endianness??
#endif
};
#if 0
static const u32 expand_bits_16[4] BTDATA = {
#if defined(__BIG_ENDIAN)
0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
#elif defined(__LITTLE_ENDIAN)
0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
#else
#error FIXME: No endianness??
#endif
};
#endif
#if 0
static void BTEXT
draw_byte_32(unsigned char *font, u32 *base, u32 rb)
{
u32 l, bits;
u32 fg = 0xFFFFFFFF;
u32 bg = 0x00000000;
for (l = 0; l < 16; ++l)
{
bits = *font++;
base[0] = (-(bits >> 7) & fg) ^ bg;
base[1] = (-((bits >> 6) & 1) & fg) ^ bg;
base[2] = (-((bits >> 5) & 1) & fg) ^ bg;
base[3] = (-((bits >> 4) & 1) & fg) ^ bg;
base[4] = (-((bits >> 3) & 1) & fg) ^ bg;
base[5] = (-((bits >> 2) & 1) & fg) ^ bg;
base[6] = (-((bits >> 1) & 1) & fg) ^ bg;
base[7] = (-(bits & 1) & fg) ^ bg;
base = (u32 *) ((char *)base + rb);
}
}
static void BTEXT
draw_byte_16(unsigned char *font, u32 *base, u32 rb)
{
u32 l, bits;
u32 fg = 0xFFFFFFFF;
u32 bg = 0x00000000;
u32 *eb = expand_bits_16;
for (l = 0; l < 16; ++l)
{
bits = *font++;
base[0] = (eb[bits >> 6] & fg) ^ bg;
base[1] = (eb[(bits >> 4) & 3] & fg) ^ bg;
base[2] = (eb[(bits >> 2) & 3] & fg) ^ bg;
base[3] = (eb[bits & 3] & fg) ^ bg;
base = (u32 *) ((char *)base + rb);
}
}
#endif
static void BTEXT
draw_byte_8(unsigned char *font, u32 *base, u32 rb)
{
u32 l, bits;
u32 fg = 0x0F0F0F0F;
u32 bg = 0x00000000;
u32 *eb = expand_bits_8;
for (l = 0; l < 16; ++l)
{
bits = *font++;
base[0] = (eb[bits >> 4] & fg) ^ bg;
base[1] = (eb[bits & 0xf] & fg) ^ bg;
base = (u32 *) ((char *)base + rb);
}
}
void btext_init(void)
{
btext_setup_display(640, 480, 8, 640,0xfc000000);
// Not realy init
// It will be init in xlinit.c because We only can access fb after the device resource is allocated and enabled.
}
void btext_tx_byte(unsigned char data)
{
btext_drawchar(data);
}
static const struct console_driver btext_console __console = {
.init = btext_init,
.tx_byte = btext_tx_byte,
.rx_byte = 0,
.tst_byte = 0,
};

View File

@ -91,28 +91,6 @@ int console_tst_byte(void)
return 0;
}
/*
* Write POST information
*/
void post_code(u8 value)
{
#if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
#if CONFIG_SERIAL_POST==1
printk(BIOS_EMERG, "POST: 0x%02x\n", value);
#endif
outb(value, 0x80);
#endif
}
/* Report a fatal error */
void __attribute__((noreturn)) die(const char *msg)
{
printk(BIOS_EMERG, "%s", msg);
//post_code(0xff);
for (;;)
hlt(); /* Halt */
}
#else
void console_init(void)
@ -129,24 +107,4 @@ void console_init(void)
" starting...\n";
print_info(console_test);
}
void post_code(u8 value)
{
#if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
#if CONFIG_SERIAL_POST==1
print_emerg("POST: 0x");
print_emerg_hex8(value);
print_emerg("\n");
#endif
outb(value, 0x80);
#endif
}
void die(const char *str)
{
print_emerg(str);
do {
hlt();
} while(1);
}
#endif

33
src/console/die.c Normal file
View File

@ -0,0 +1,33 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2003 Eric Biederman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
* the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
#include <arch/io.h>
#include <arch/hlt.h>
#include <console/console.h>
/* Report a fatal error */
void __attribute__((noreturn)) die(const char *msg)
{
print_emerg(msg);
do {
hlt();
} while(1);
}

File diff suppressed because it is too large Load Diff

37
src/console/post.c Normal file
View File

@ -0,0 +1,37 @@
/*
* This file is part of the coreboot project.
*
* Copyright (C) 2003 Eric Biederman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of
* the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA 02110-1301 USA
*/
#include <arch/io.h>
#include <console/console.h>
/* Write POST information */
void post_code(uint8_t value)
{
#if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0
#if CONFIG_SERIAL_POST==1
print_emerg("POST: 0x");
print_emerg_hex8(value);
print_emerg("\n");
#endif
outb(value, 0x80);
#endif
}

View File

@ -1,104 +0,0 @@
/*
*
* modified from original freebios code
* by Steve M. Gehlbach <steve@kesa.com>
*
*/
/*
* TODO:
* * make vga_console_init take FB location, columns, lines and starting
* column/line.
* * track a word offset, and not columns/lines. The offset is needed more
* often than columns/lines and the latter two can be calculated easily.
* * then implement real vga scrolling, instead of memcpying stuff around.
*
* -- libv.
*/
#include <arch/io.h>
#include <string.h>
#include <pc80/vga_io.h>
#include <pc80/vga.h>
#include <console/console.h>
/* The video buffer, should be replaced by symbol in ldscript.ld */
static char *vidmem;
static int total_lines, total_columns;
static int current_line, current_column;
static int vga_console_inited = 0;
/*
*
*/
void vga_console_init(void)
{
vidmem = (char *) VGA_FB;
total_columns = VGA_COLUMNS;
total_lines = VGA_LINES;
current_column = 0;
current_line = 0;
vga_console_inited = 1;
}
static void vga_scroll(void)
{
int i;
memcpy(vidmem, vidmem + total_columns * 2, (total_lines - 1) * total_columns * 2);
for (i = (total_lines - 1) * total_columns * 2; i < total_lines * total_columns * 2; i += 2)
vidmem[i] = ' ';
}
static void
vga_tx_byte(unsigned char byte)
{
if (!vga_console_inited)
return;
switch (byte) {
case '\n':
current_line++;
current_column = 0;
break;
case '\r':
current_column = 0;
break;
case '\b':
current_column--;
break;
case '\t':
current_column += 4;
break;
case '\a': /* beep */
break;
default:
vidmem[((current_column + (current_line * total_columns)) * 2)] = byte;
vidmem[((current_column + (current_line * total_columns)) * 2) +1] = 0x07;
current_column++;
break;
}
if (current_column < 0)
current_column = 0;
if (current_column >= total_columns) {
current_line++;
current_column = 0;
}
if (current_line >= total_lines) {
vga_scroll();
current_line--;
}
/* move the cursor */
vga_cr_write(0x0E, (current_column + (current_line * total_columns)) >> 8);
vga_cr_write(0x0F, (current_column + (current_line * total_columns)) & 0x0ff);
}
static const struct console_driver vga_console __console ={
.init = 0,
.tx_byte = vga_tx_byte,
.rx_byte = 0,
.tst_byte = 0,
};

View File

@ -16,8 +16,6 @@
#include <cpu/cpu.h>
#if CONFIG_SMP == 1
#if CONFIG_RAMBASE >= 0x100000
/* This is a lot more paranoid now, since Linux can NOT handle
* being told there is a CPU when none exists. So any errors
* will return 0, meaning no CPU.
@ -29,7 +27,6 @@ static unsigned long get_valid_start_eip(unsigned long orig_start_eip)
{
return (unsigned long)orig_start_eip & 0xffff; // 16 bit to avoid 0xa0000
}
#endif
#if CONFIG_HAVE_ACPI_RESUME == 1
char *lowmem_backup;
@ -41,7 +38,6 @@ extern char _secondary_start[];
static void copy_secondary_start_to_1m_below(void)
{
#if CONFIG_RAMBASE >= 0x100000
extern char _secondary_start_end[];
unsigned long code_size;
unsigned long start_eip;
@ -67,7 +63,6 @@ static void copy_secondary_start_to_1m_below(void)
memcpy((unsigned char *)start_eip, (unsigned char *)_secondary_start, code_size);
printk(BIOS_DEBUG, "start_eip=0x%08lx, offset=0x%08lx, code_size=0x%08lx\n", start_eip, ((unsigned long)_secondary_start - start_eip), code_size);
#endif
}
static int lapic_start_cpu(unsigned long apicid)
@ -139,11 +134,7 @@ static int lapic_start_cpu(unsigned long apicid)
return 0;
}
#if CONFIG_RAMBASE >= 0x100000
start_eip = get_valid_start_eip((unsigned long)_secondary_start);
#else
start_eip = (unsigned long)_secondary_start;
#endif
#if !defined (CONFIG_CPU_AMD_MODEL_10XXX) && !defined (CONFIG_CPU_AMD_MODEL_14XXX)
num_starts = 2;

View File

@ -116,7 +116,7 @@ config YABEL_DIRECTHW
they can still access all devices in the system.
Enable this option for a good compromise between security and speed.
config CONSOLE_VGA_MULTI
config MULTIPLE_VGA_ADAPTERS
bool
default n

View File

@ -722,7 +722,7 @@ static void set_vga_bridge_bits(void)
if (!vga)
vga = vga_first;
#if CONFIG_CONSOLE_VGA_ONBOARD_AT_FIRST == 1
#if CONFIG_ONBOARD_VGA_IS_PRIMARY == 1
if (vga_onboard) /* Will use onboard VGA as primary. */
#else
if (!vga) /* Will use last add-on adapter as primary. */

View File

@ -675,11 +675,6 @@ void pci_dev_init(struct device *dev)
return;
run_bios(dev, (unsigned long)ram);
#if CONFIG_CONSOLE_VGA == 1
if ((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
vga_console_init();
#endif /* CONFIG_CONSOLE_VGA */
#endif /* CONFIG_PCI_ROM_RUN || CONFIG_VGA_ROM_RUN */
}

View File

@ -130,7 +130,7 @@ struct rom_header *pci_rom_load(struct device *dev,
* devices have a mismatch between the hardware and the ROM.
*/
if (PCI_CLASS_DISPLAY_VGA == (dev->class >> 8)) {
#if CONFIG_CONSOLE_VGA == 1 && CONFIG_CONSOLE_VGA_MULTI == 0
#if CONFIG_MULTIPLE_VGA_ADAPTERS == 0
extern device_t vga_pri; /* Primary VGA device (device.c). */
if (dev != vga_pri) return NULL; /* Only one VGA supported. */
#endif

View File

@ -21,6 +21,13 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
// FIXME BTEXT console within coreboot has been obsoleted
// and will go away. The BTEXT code in this file should be
// fixed to export a framebuffer console through the coreboot
// table (and possibly make it available for bootsplash use)
// Hence do only remove this if you fix the code.
#define CONFIG_CONSOLE_BTEXT 0
#if CONFIG_CONSOLE_BTEXT==1
#define PLL_CRTC_DECODE 0

View File

@ -9,19 +9,6 @@
#include <device/pci_ids.h>
#include <device/pci_ops.h>
#if CONFIG_CONSOLE_BTEXT==1
#define PLL_CRTC_DECODE 0
#define SUPPORT_8_BPP_ABOVE 0
#include "fb.h"
#include "fbcon.h"
#include <console/btext.h>
#endif /*CONFIG_CONSOLE_BTEXT*/
/* VGA init. We use the Bochs VESA VBE extensions */
#define VBE_DISPI_INDEX_ID 0x0
#define VBE_DISPI_INDEX_XRES 0x1

View File

@ -158,10 +158,10 @@ struct lb_console {
};
#define LB_TAG_CONSOLE_SERIAL8250 0
#define LB_TAG_CONSOLE_VGA 1
#define LB_TAG_CONSOLE_BTEXT 2
#define LB_TAG_CONSOLE_VGA 1 // OBSOLETE
#define LB_TAG_CONSOLE_BTEXT 2 // OBSOLETE
#define LB_TAG_CONSOLE_LOGBUF 3
#define LB_TAG_CONSOLE_SROM 4
#define LB_TAG_CONSOLE_SROM 4 // OBSOLETE
#define LB_TAG_CONSOLE_EHCI 5
#define LB_TAG_FORWARD 0x0011

View File

@ -1,72 +0,0 @@
/*
* This file describes the structure passed from the BootX application
* (for MacOS) when it is used to boot Linux.
*
* Written by Benjamin Herrenschmidt.
*
* Move to coreboot by LYH yhlu@tyan.com
*
*/
#ifndef _BTEXT_H__
#define _BTEXT_H__
#define u32 uint32_t
#define u16 uint16_t
#define u8 uint8_t
/* Here are the boot informations that are passed to the bootstrap
* Note that the kernel arguments and the device tree are appended
* at the end of this structure. */
typedef struct boot_infos
{
/* NEW (vers. 2) this holds the current _logical_ base addr of
the frame buffer (for use by early boot message) */
u8* logicalDisplayBase;
/* Some infos about the current MacOS display */
u32 dispDeviceRect[4]; /* left,top,right,bottom */
u32 dispDeviceDepth; /* (8, 16 or 32) */
u8* dispDeviceBase; /* base address (physical) */
u32 dispDeviceRowBytes; /* rowbytes (in bytes) */
u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */
/* The framebuffer size (optional, currently 0) */
u32 frameBufferSize; /* Represents a max size, can be 0. */
} boot_infos_t;
/* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index is represented
* by 3 short words containing a 16 bits (unsigned) color component.
* Later versions may contain the gamma table for direct-color devices here.
*/
#define BOOTX_COLORTABLE_SIZE (256UL*3UL*2UL)
/*
* Definitions for using the procedures in btext.c.
*
* Benjamin Herrenschmidt <benh@kernel.crashing.org>
*/
extern void btext_clearscreen(void);
extern boot_infos_t disp_bi;
extern u32 boot_text_mapped;
void btext_setup_display(u32 width, u32 height, u32 depth, u32 pitch,
unsigned long address);
void map_boot_text(void);
void btext_update_display(unsigned long phys, u32 width, u32 height,
u32 depth, u32 pitch);
void btext_drawchar(char c);
void btext_drawstring(const char *str);
void btext_drawhex(u32 v);
#endif /* _BTEXT_H */

View File

@ -28,9 +28,6 @@ void console_tx_byte(unsigned char byte);
void console_tx_flush(void);
unsigned char console_rx_byte(void);
int console_tst_byte(void);
#if CONFIG_CONSOLE_VGA == 1
void vga_console_init(void);
#endif
#if CONFIG_USBDEBUG
#include <usbdebug.h>
#endif
@ -356,6 +353,8 @@ static void print_spew(const char *str) { __console_tx_string(BIOS_SPEW, str); }
#ifdef __ROMCC__
/* if included by romcc, include the sources, too. romcc can't use prototypes */
#include <console/console.c>
#include <console/post.c>
#include <console/die.c>
#endif
#endif /* CONSOLE_CONSOLE_H_ */

View File

@ -128,10 +128,6 @@ config CONSOLE_SERIAL8250
bool
default y
config CONSOLE_VGA
bool
default y
config PCI_ROM_RUN
bool
default y

View File

@ -545,13 +545,9 @@ static void amdfam10_set_resource(device_t dev, struct resource *resource,
}
/**
*
* I tried to reuse the resource allocation code in amdfam10_set_resource()
* but it is too diffcult to deal with the resource allocation magic.
* but it is too difficult to deal with the resource allocation magic.
*/
#if CONFIG_CONSOLE_VGA_MULTI == 1
extern device_t vga_pri; // the primary vga device, defined in device.c
#endif
static void amdfam10_create_vga_resource(device_t dev, unsigned nodeid)
{
@ -561,7 +557,8 @@ static void amdfam10_create_vga_resource(device_t dev, unsigned nodeid)
* we only deal with the 'first' vga card */
for (link = dev->link_list; link; link = link->next) {
if (link->bridge_ctrl & PCI_BRIDGE_CTL_VGA) {
#if CONFIG_CONSOLE_VGA_MULTI == 1
#if CONFIG_MULTIPLE_VGA_ADAPTERS == 1
extern device_t vga_pri; // the primary vga device, defined in device.c
printk(BIOS_DEBUG, "VGA: vga_pri bus num = %d bus range [%d,%d]\n", vga_pri->bus->secondary,
link->secondary,link->subordinate);
/* We need to make sure the vga_pri is under the link */

View File

@ -485,10 +485,6 @@ static void amdk8_set_resource(device_t dev, struct resource *resource, unsigned
report_resource_stored(dev, resource, buf);
}
#if CONFIG_CONSOLE_VGA_MULTI == 1
extern device_t vga_pri; // the primary vga device, defined in device.c
#endif
static void amdk8_create_vga_resource(device_t dev, unsigned nodeid)
{
struct resource *resource;
@ -498,7 +494,8 @@ static void amdk8_create_vga_resource(device_t dev, unsigned nodeid)
* we only deal with the 'first' vga card */
for (link = dev->link_list; link; link = link->next) {
if (link->bridge_ctrl & PCI_BRIDGE_CTL_VGA) {
#if CONFIG_CONSOLE_VGA_MULTI == 1
#if CONFIG_MULTIPLE_VGA_ADAPTERS == 1
extern device_t vga_pri; // the primary vga device, defined in device.c
printk(BIOS_DEBUG, "VGA: vga_pri bus num = %d link bus range [%d,%d]\n", vga_pri->bus->secondary,
link->secondary,link->subordinate);
/* We need to make sure the vga_pri is under the link */

View File

@ -150,17 +150,10 @@ chrome_init(struct device *dev)
vga_textmode_init();
#if CONFIG_CONSOLE_VGA == 1
vga_console_init();
#endif
printk(BIOS_INFO, "Chrome VGA Textmode initialized.\n");
#if CONFIG_CONSOLE_VGA == 0
/* if we don't have console, at least print something... */
vga_line_write(0, "Chrome VGA Textmode initialized.");
#endif
#endif /* CONFIG_VGA */
}