CONFIG_PCI_ROM_RUN
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1875 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -11,11 +11,12 @@ struct rom_header * pci_rom_probe(struct device *dev)
|
||||
struct pci_data *rom_data;
|
||||
|
||||
rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS);
|
||||
|
||||
if (rom_address == 0x00000000 || rom_address == 0xffffffff) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
printk_spew("%s, rom address for %s = %x\n",
|
||||
printk_debug("%s, rom address for %s = %x\n",
|
||||
__func__, dev_path(dev), rom_address);
|
||||
|
||||
/* enable expansion ROM address decoding */
|
||||
@@ -53,6 +54,11 @@ struct rom_header * pci_rom_probe(struct device *dev)
|
||||
}
|
||||
|
||||
static void *pci_ram_image_start = PCI_RAM_IMAGE_START;
|
||||
|
||||
#if CONFIG_CONSOLE_VGA == 1
|
||||
int vga_inited = 0; // it will be used by vga_console
|
||||
#endif
|
||||
|
||||
struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header)
|
||||
{
|
||||
struct pci_data * rom_data;
|
||||
@@ -64,10 +70,14 @@ struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_heade
|
||||
rom_size = rom_header->size*512;
|
||||
|
||||
if (PCI_CLASS_DISPLAY_VGA == (rom_data->class_hi << 16 | rom_data->class_lo)) {
|
||||
#if CONFIG_CONSOLE_VGA == 1
|
||||
if(vga_inited) return NULL; // only one VGA supported
|
||||
printk_spew("%s, copying VGA ROM Image from %x to %x, %x bytes\n",
|
||||
__func__, rom_header, PCI_VGA_RAM_IMAGE_START, rom_size);
|
||||
memcpy(PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
|
||||
vga_inited = 1;
|
||||
return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
|
||||
#endif
|
||||
} else {
|
||||
printk_spew("%s, copying non-VGA ROM Image from %x to %x, %x bytes\n",
|
||||
__func__, rom_header, pci_ram_image_start, rom_size);
|
||||
@@ -77,4 +87,6 @@ struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_heade
|
||||
}
|
||||
/* disable expansion ROM address decoding */
|
||||
pci_write_config32(dev, PCI_ROM_ADDRESS, rom_address & ~PCI_ROM_ADDRESS_ENABLE);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user