See patch

-- 
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
      Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: [email protected]http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866

- printed CBFS rom address was always 0
- drop dead code.

Signed-off-by: Stefan Reinauer <[email protected]>

Index: src/devices/pci_rom.c
===================================================================
--- src/devices/pci_rom.c       (revision 4171)
+++ src/devices/pci_rom.c       (working copy)
@@ -39,8 +39,8 @@
                void *v;
                /* if it's in FLASH, then it's as if dev->on_mainboard was true 
*/
                v = cbfs_load_optionrom(dev->vendor, dev->device, NULL);
-               printk_debug("In cbfs, rom address for %s = %lx\n", 
-                               dev_path(dev), rom_address);
+               printk_debug("CBFS: OPROM address for %s = %p\n", 
+                               dev_path(dev), v);
                if (v) {
                        dev->rom_address = (u32)v;
                        dev->on_mainboard = 1;
@@ -111,15 +111,14 @@
        unsigned int rom_size;
        unsigned int image_size=0;
 
-       rom_address = pci_read_config32(dev, PCI_ROM_ADDRESS);
-
        do {
                rom_header = (struct rom_header *)((void *) rom_header + 
image_size); // get next image
                rom_data = (struct pci_data *)((void *) rom_header + 
le32_to_cpu(rom_header->data));
                image_size = le32_to_cpu(rom_data->ilen) * 512;
        } while ((rom_data->type!=0) && (rom_data->indicator!=0));  // make 
sure we got x86 version
 
-       if(rom_data->type!=0) return NULL;
+       if (rom_data->type != 0)
+               return NULL;
 
        rom_size = rom_header->size * 512;
 
@@ -132,15 +131,12 @@
                            rom_header, PCI_VGA_RAM_IMAGE_START, rom_size);
                memcpy((void *)PCI_VGA_RAM_IMAGE_START, rom_header, rom_size);
                return (struct rom_header *) (PCI_VGA_RAM_IMAGE_START);
-       } else {
-               printk_debug("copying non-VGA ROM Image from %p to %p, 0x%x 
bytes\n",
-                           rom_header, pci_ram_image_start, rom_size);
-               memcpy(pci_ram_image_start, rom_header, rom_size);
-               pci_ram_image_start += rom_size;
-               return (struct rom_header *) (pci_ram_image_start-rom_size);
        }
-       /* disable expansion ROM address decoding */
-       pci_write_config32(dev, PCI_ROM_ADDRESS, rom_address & 
~PCI_ROM_ADDRESS_ENABLE);
-       
-       return NULL;
+
+       printk_debug("copying non-VGA ROM Image from %p to %p, 0x%x bytes\n",
+                   rom_header, pci_ram_image_start, rom_size);
+
+       memcpy(pci_ram_image_start, rom_header, rom_size);
+       pci_ram_image_start += rom_size;
+       return (struct rom_header *) (pci_ram_image_start-rom_size);
 }
-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to