Since a VGA console and the need to run any option ROMs are

rather independent, lift the implicit (broken) assumption that
CONSOLE_VGA would also run the ROMs, and transfer it to a new
config option VGA_ROM_RUN.

This change is minimally intrusive, because all board configs
that previously assumed CONSOLE_VGA would also run the ROMs
didn't compile, they had to also specify PCI_ROM_RUN.

Based on patches by Ron Minnich (fix the compile) and Luc Verhaegen
(separate ROM_RUN from VGA console).

Signed-off-by: Torsten Duwe <duwe@lst.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Luc Verhaegen <libv@skynet.be>



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3034 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Torsten Duwe 2008-01-06 01:10:54 +00:00
parent 11e90e06d3
commit 1f2f800036
3 changed files with 24 additions and 15 deletions

View File

@ -415,7 +415,7 @@ end
define CONFIG_CONSOLE_VGA define CONFIG_CONSOLE_VGA
default 0 default 0
export always export always
comment "Log messages to VGA" comment "Log messages to any VGA-compatible device (may require *_ROM_RUN to bring up)"
end end
define CONFIG_CONSOLE_VGA_MULTI define CONFIG_CONSOLE_VGA_MULTI
default 0 default 0
@ -1027,10 +1027,16 @@ define CPU_ADDR_BITS
comment "CPU hardware address lines num, for AMD K8 could be 40, and AMD family 10 could be 48" comment "CPU hardware address lines num, for AMD K8 could be 40, and AMD family 10 could be 48"
end end
define CONFIG_VGA_ROM_RUN
default 0
export always
comment "Init x86 ROMs on VGA-class PCI devices"
end
define CONFIG_PCI_ROM_RUN define CONFIG_PCI_ROM_RUN
default 0 default 0
export always export always
comment "Init PCI device option rom" comment "Init x86 ROMs on all PCI devices"
end end
define CONFIG_PCI_64BIT_PREF_MEM define CONFIG_PCI_64BIT_PREF_MEM

View File

@ -1,4 +1,5 @@
uses CONFIG_PCI_ROM_RUN uses CONFIG_PCI_ROM_RUN
uses CONFIG_VGA_ROM_RUN
object device.o object device.o
object root_device.o object root_device.o
object device_util.o object device_util.o
@ -15,4 +16,9 @@ object smbus_ops.o
if CONFIG_PCI_ROM_RUN if CONFIG_PCI_ROM_RUN
object pci_rom.o object pci_rom.o
dir emulator dir emulator
else
if CONFIG_VGA_ROM_RUN
object pci_rom.o
dir emulator
end
end end

View File

@ -643,16 +643,14 @@ void pci_dev_set_subsystem(device_t dev, unsigned vendor, unsigned device)
((device & 0xffff) << 16) | (vendor & 0xffff)); ((device & 0xffff) << 16) | (vendor & 0xffff));
} }
/** default handler: only runs the relevant pci bios. */
void pci_dev_init(struct device *dev) void pci_dev_init(struct device *dev)
{ {
#if CONFIG_CONSOLE_VGA == 1 #if CONFIG_PCI_ROM_RUN == 1 || CONFIG_VGA_ROM_RUN == 1
extern int vga_inited;
#endif
#if CONFIG_PCI_ROM_RUN == 1 || CONFIG_CONSOLE_VGA == 1
struct rom_header *rom, *ram; struct rom_header *rom, *ram;
#if CONFIG_PCI_ROM_RUN != 1 #if CONFIG_PCI_ROM_RUN != 1
/* We want to execute VGA option ROMs when CONFIG_CONSOLE_VGA /* We want to execute VGA option ROMs when CONFIG_VGA_ROM_RUN
* is set but CONFIG_PCI_ROM_RUN is not. In this case we skip * is set but CONFIG_PCI_ROM_RUN is not. In this case we skip
* all other option ROM types. * all other option ROM types.
*/ */
@ -671,14 +669,13 @@ void pci_dev_init(struct device *dev)
run_bios(dev, ram); run_bios(dev, ram);
#if CONFIG_CONSOLE_VGA == 1 #if CONFIG_CONSOLE_VGA == 1
/* vga_inited is a trigger of the VGA console code. /* vga_inited is a trigger of the VGA console code. */
* if (dev->class == PCI_CLASS_DISPLAY_VGA) {
* Only set it if we enabled VGA console, and if we extern int vga_inited;
* just initialized a VGA card. vga_inited = 1;
*/ }
vga_inited|=dev->class==PCI_CLASS_DISPLAY_VGA; #endif /* CONFIG_CONSOLE_VGA */
#endif #endif /* CONFIG_PCI_ROM_RUN || CONFIG_VGA_ROM_RUN */
#endif
} }
/** Default device operation for PCI devices */ /** Default device operation for PCI devices */