diff options
author | John Keller <jpk@sgi.com> | 2006-10-04 17:49:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-12-01 17:36:58 -0500 |
commit | a2302c68d923537436b1114aa207787c1a31bd50 (patch) | |
tree | bf0407f2176a32ec79d2b7ab82e1fc9e54308fd2 /drivers/pci/rom.c | |
parent | 9f581f162e2b304be25dee49bf3945d4ed65dfb6 (diff) |
Altix: Initial ACPI support - ROM shadowing.
Support a shadowed ROM when running with an ACPI capable PROM.
Define a new dev.resource flag IORESOURCE_ROM_BIOS_COPY to
describe the case of a BIOS shadowed ROM, which can then
be used to avoid pci_map_rom() making an unneeded call to
pci_enable_rom().
Signed-off-by: John Keller <jpk@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/rom.c')
-rw-r--r-- | drivers/pci/rom.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c index e1dcefc69bb4..d087e0817715 100644 --- a/drivers/pci/rom.c +++ b/drivers/pci/rom.c | |||
@@ -81,7 +81,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size) | |||
81 | start = (loff_t)0xC0000; | 81 | start = (loff_t)0xC0000; |
82 | *size = 0x20000; /* cover C000:0 through E000:0 */ | 82 | *size = 0x20000; /* cover C000:0 through E000:0 */ |
83 | } else { | 83 | } else { |
84 | if (res->flags & IORESOURCE_ROM_COPY) { | 84 | if (res->flags & |
85 | (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) { | ||
85 | *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); | 86 | *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); |
86 | return (void __iomem *)(unsigned long) | 87 | return (void __iomem *)(unsigned long) |
87 | pci_resource_start(pdev, PCI_ROM_RESOURCE); | 88 | pci_resource_start(pdev, PCI_ROM_RESOURCE); |
@@ -165,7 +166,8 @@ void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size) | |||
165 | if (!rom) | 166 | if (!rom) |
166 | return NULL; | 167 | return NULL; |
167 | 168 | ||
168 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_SHADOW)) | 169 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_SHADOW | |
170 | IORESOURCE_ROM_BIOS_COPY)) | ||
169 | return rom; | 171 | return rom; |
170 | 172 | ||
171 | res->start = (unsigned long)kmalloc(*size, GFP_KERNEL); | 173 | res->start = (unsigned long)kmalloc(*size, GFP_KERNEL); |
@@ -191,7 +193,7 @@ void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom) | |||
191 | { | 193 | { |
192 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; | 194 | struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; |
193 | 195 | ||
194 | if (res->flags & IORESOURCE_ROM_COPY) | 196 | if (res->flags & (IORESOURCE_ROM_COPY | IORESOURCE_ROM_BIOS_COPY)) |
195 | return; | 197 | return; |
196 | 198 | ||
197 | iounmap(rom); | 199 | iounmap(rom); |
@@ -215,6 +217,7 @@ void pci_remove_rom(struct pci_dev *pdev) | |||
215 | sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr); | 217 | sysfs_remove_bin_file(&pdev->dev.kobj, pdev->rom_attr); |
216 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | | 218 | if (!(res->flags & (IORESOURCE_ROM_ENABLE | |
217 | IORESOURCE_ROM_SHADOW | | 219 | IORESOURCE_ROM_SHADOW | |
220 | IORESOURCE_ROM_BIOS_COPY | | ||
218 | IORESOURCE_ROM_COPY))) | 221 | IORESOURCE_ROM_COPY))) |
219 | pci_disable_rom(pdev); | 222 | pci_disable_rom(pdev); |
220 | } | 223 | } |