diff options
Diffstat (limited to 'src/devices/pci_rom.c')
-rw-r--r-- | src/devices/pci_rom.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/devices/pci_rom.c b/src/devices/pci_rom.c index 614fbd55b9..310c00f00c 100644 --- a/src/devices/pci_rom.c +++ b/src/devices/pci_rom.c @@ -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; } |