summaryrefslogtreecommitdiff
path: root/hw/pci.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2010-01-21 17:05:50 -0200
committerMarcelo Tosatti <mtosatti@redhat.com>2010-01-21 17:05:50 -0200
commit29f99d284d1c70a612672a4443008026dc7f0e5c (patch)
tree3791d098774a0fcc532b7df6c694d76fbcbe9f1b /hw/pci.c
parent1dcf16b46057bc8f50ad2379c3292b4ad31cc92f (diff)
parent88169ddf82853ca892ce7bee279579c8a0ac03e5 (diff)
Merge commit '88169ddf82853ca892ce7bee279579c8a0ac03e5' into upstream-merge
* commit '88169ddf82853ca892ce7bee279579c8a0ac03e5': pci: allow loading roms via fw_cfg. Conflicts: hw/pci.h Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/pci.c')
-rw-r--r--hw/pci.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/pci.c b/hw/pci.c
index ee3dc42be..8913a45bc 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -67,6 +67,7 @@ static struct BusInfo pci_bus_info = {
.props = (Property[]) {
DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1),
DEFINE_PROP_STRING("romfile", PCIDevice, romfile),
+ DEFINE_PROP_UINT32("rombar", PCIDevice, rom_bar, 1),
DEFINE_PROP_END_OF_LIST()
}
};
@@ -1649,6 +1650,20 @@ static int pci_add_option_rom(PCIDevice *pdev)
if (strlen(pdev->romfile) == 0)
return 0;
+ if (!pdev->rom_bar) {
+ /*
+ * Load rom via fw_cfg instead of creating a rom bar,
+ * for 0.11 compatibility.
+ */
+ int class = pci_get_word(pdev->config + PCI_CLASS_DEVICE);
+ if (class == 0x0300) {
+ rom_add_vga(pdev->romfile);
+ } else {
+ rom_add_option(pdev->romfile);
+ }
+ return 0;
+ }
+
path = qemu_find_file(QEMU_FILE_TYPE_BIOS, pdev->romfile);
if (path == NULL) {
path = qemu_strdup(pdev->romfile);