]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/ia64/sn/kernel/io_init.c
Pull bugzilla-9194 into release branch
[linux-2.6-omap-h63xx.git] / arch / ia64 / sn / kernel / io_init.c
index 6b10e5d284883380a284a1d2616e1aa2ec834fd2..906b93674b7604e236099c42f68cd8228a1876ed 100644 (file)
@@ -259,9 +259,23 @@ sn_io_slot_fixup(struct pci_dev *dev)
                        insert_resource(&ioport_resource, &dev->resource[idx]);
                else
                        insert_resource(&iomem_resource, &dev->resource[idx]);
-               /* If ROM, mark as shadowed in PROM */
-               if (idx == PCI_ROM_RESOURCE)
-                       dev->resource[idx].flags |= IORESOURCE_ROM_BIOS_COPY;
+               /*
+                * If ROM, set the actual ROM image size, and mark as
+                * shadowed in PROM.
+                */
+               if (idx == PCI_ROM_RESOURCE) {
+                       size_t image_size;
+                       void __iomem *rom;
+
+                       rom = ioremap(pci_resource_start(dev, PCI_ROM_RESOURCE),
+                                     size + 1);
+                       image_size = pci_get_rom_size(rom, size + 1);
+                       dev->resource[PCI_ROM_RESOURCE].end =
+                               dev->resource[PCI_ROM_RESOURCE].start +
+                               image_size - 1;
+                       dev->resource[PCI_ROM_RESOURCE].flags |=
+                                                IORESOURCE_ROM_BIOS_COPY;
+               }
        }
        /* Create a pci_window in the pci_controller struct for
         * each device resource.