Author: stepan Date: Mon Nov 22 09:09:50 2010 New Revision: 6111 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6111
Log: 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 Wangwangqingpei@gmail.com
Added: trunk/src/console/die.c trunk/src/console/post.c Deleted: trunk/src/console/btext_console.c trunk/src/console/font-8x16.c trunk/src/console/vga_console.c trunk/src/include/console/btext.h Modified: trunk/payloads/libpayload/include/coreboot_tables.h trunk/src/arch/i386/boot/coreboot_table.c trunk/src/arch/i386/lib/cbfs_and_run.c trunk/src/console/Kconfig trunk/src/console/Makefile.inc trunk/src/console/console.c trunk/src/cpu/x86/lapic/lapic_cpu_init.c trunk/src/devices/Kconfig trunk/src/devices/device.c trunk/src/devices/pci_device.c trunk/src/devices/pci_rom.c trunk/src/drivers/ati/ragexl/xlinit.c trunk/src/drivers/emulation/qemu/init.c trunk/src/include/boot/coreboot_tables.h trunk/src/include/console/console.h trunk/src/mainboard/msi/ms9652_fam10/Kconfig trunk/src/northbridge/amd/amdfam10/northbridge.c trunk/src/northbridge/amd/amdk8/northbridge.c trunk/src/southbridge/via/k8t890/k8m890_chrome.c
Modified: trunk/payloads/libpayload/include/coreboot_tables.h ============================================================================== --- trunk/payloads/libpayload/include/coreboot_tables.h Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/payloads/libpayload/include/coreboot_tables.h Mon Nov 22 09:09:50 2010 (r6111) @@ -122,10 +122,10 @@ };
#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
Modified: trunk/src/arch/i386/boot/coreboot_table.c ============================================================================== --- trunk/src/arch/i386/boot/coreboot_table.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/arch/i386/boot/coreboot_table.c Mon Nov 22 09:09:50 2010 (r6111) @@ -134,18 +134,9 @@ #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
Modified: trunk/src/arch/i386/lib/cbfs_and_run.c ============================================================================== --- trunk/src/arch/i386/lib/cbfs_and_run.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/arch/i386/lib/cbfs_and_run.c Mon Nov 22 09:09:50 2010 (r6111) @@ -25,14 +25,10 @@ { 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 (
Modified: trunk/src/console/Kconfig ============================================================================== --- trunk/src/console/Kconfig Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/console/Kconfig Mon Nov 22 09:09:50 2010 (r6111) @@ -133,13 +133,9 @@ 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 @@ 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
Modified: trunk/src/console/Makefile.inc ============================================================================== --- trunk/src/console/Makefile.inc Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/console/Makefile.inc Mon Nov 22 09:09:50 2010 (r6111) @@ -2,18 +2,19 @@ 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
Modified: trunk/src/console/console.c ============================================================================== --- trunk/src/console/console.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/console/console.c Mon Nov 22 09:09:50 2010 (r6111) @@ -91,28 +91,6 @@ 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 @@ " 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
Added: trunk/src/console/die.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/src/console/die.c Mon Nov 22 09:09:50 2010 (r6111) @@ -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); +}
Added: trunk/src/console/post.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ trunk/src/console/post.c Mon Nov 22 09:09:50 2010 (r6111) @@ -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 +}
Modified: trunk/src/cpu/x86/lapic/lapic_cpu_init.c ============================================================================== --- trunk/src/cpu/x86/lapic/lapic_cpu_init.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/cpu/x86/lapic/lapic_cpu_init.c Mon Nov 22 09:09:50 2010 (r6111) @@ -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 @@ { 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 @@
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 @@ 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 @@ 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;
Modified: trunk/src/devices/Kconfig ============================================================================== --- trunk/src/devices/Kconfig Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/devices/Kconfig Mon Nov 22 09:09:50 2010 (r6111) @@ -116,7 +116,7 @@ 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
Modified: trunk/src/devices/device.c ============================================================================== --- trunk/src/devices/device.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/devices/device.c Mon Nov 22 09:09:50 2010 (r6111) @@ -722,7 +722,7 @@ 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. */
Modified: trunk/src/devices/pci_device.c ============================================================================== --- trunk/src/devices/pci_device.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/devices/pci_device.c Mon Nov 22 09:09:50 2010 (r6111) @@ -675,11 +675,6 @@ 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 */ }
Modified: trunk/src/devices/pci_rom.c ============================================================================== --- trunk/src/devices/pci_rom.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/devices/pci_rom.c Mon Nov 22 09:09:50 2010 (r6111) @@ -130,7 +130,7 @@ * 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
Modified: trunk/src/drivers/ati/ragexl/xlinit.c ============================================================================== --- trunk/src/drivers/ati/ragexl/xlinit.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/drivers/ati/ragexl/xlinit.c Mon Nov 22 09:09:50 2010 (r6111) @@ -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
Modified: trunk/src/drivers/emulation/qemu/init.c ============================================================================== --- trunk/src/drivers/emulation/qemu/init.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/drivers/emulation/qemu/init.c Mon Nov 22 09:09:50 2010 (r6111) @@ -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
Modified: trunk/src/include/boot/coreboot_tables.h ============================================================================== --- trunk/src/include/boot/coreboot_tables.h Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/include/boot/coreboot_tables.h Mon Nov 22 09:09:50 2010 (r6111) @@ -158,10 +158,10 @@ };
#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
Modified: trunk/src/include/console/console.h ============================================================================== --- trunk/src/include/console/console.h Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/include/console/console.h Mon Nov 22 09:09:50 2010 (r6111) @@ -28,9 +28,6 @@ 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 @@ #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_ */
Modified: trunk/src/mainboard/msi/ms9652_fam10/Kconfig ============================================================================== --- trunk/src/mainboard/msi/ms9652_fam10/Kconfig Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/mainboard/msi/ms9652_fam10/Kconfig Mon Nov 22 09:09:50 2010 (r6111) @@ -128,10 +128,6 @@ bool default y
-config CONSOLE_VGA - bool - default y - config PCI_ROM_RUN bool default y
Modified: trunk/src/northbridge/amd/amdfam10/northbridge.c ============================================================================== --- trunk/src/northbridge/amd/amdfam10/northbridge.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/northbridge/amd/amdfam10/northbridge.c Mon Nov 22 09:09:50 2010 (r6111) @@ -545,13 +545,9 @@ }
/** - * * 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 @@ * 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 */
Modified: trunk/src/northbridge/amd/amdk8/northbridge.c ============================================================================== --- trunk/src/northbridge/amd/amdk8/northbridge.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/northbridge/amd/amdk8/northbridge.c Mon Nov 22 09:09:50 2010 (r6111) @@ -485,10 +485,6 @@ 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 @@ * 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 */
Modified: trunk/src/southbridge/via/k8t890/k8m890_chrome.c ============================================================================== --- trunk/src/southbridge/via/k8t890/k8m890_chrome.c Mon Nov 22 01:42:42 2010 (r6110) +++ trunk/src/southbridge/via/k8t890/k8m890_chrome.c Mon Nov 22 09:09:50 2010 (r6111) @@ -150,17 +150,10 @@
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 */ }