]> git.proxmox.com Git - qemu.git/blame - pc-bios/bios-pq/0016-use-correct-mask-to-size-pci-option-rom-bar.patch
mips malta: Fix fdc regression and use qdev for i8042 setup
[qemu.git] / pc-bios / bios-pq / 0016-use-correct-mask-to-size-pci-option-rom-bar.patch
CommitLineData
00070396
AL
1Subject: [PATCH] bios: Use the correct mask to size the PCI option ROM BAR
2From: Alex Williamson <alex.williamson@hp.com>
3
4Bit 0 is the enable bit, which we not only don't want to set, but
5it will stick and make us think it's an I/O port resource.
6
7Signed-off-by: Alex Williamson <alex.williamson@hp.com>
8Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
9---
10
11diff --git a/bios/rombios32.c b/bios/rombios32.c
12index d7e18e9..f861f81 100644
13--- a/bios/rombios32.c
14+++ b/bios/rombios32.c
15@@ -985,11 +985,13 @@ static void pci_bios_init_device(PCIDevice *d)
16 int ofs;
17 uint32_t val, size ;
18
19- if (i == PCI_ROM_SLOT)
20+ if (i == PCI_ROM_SLOT) {
21 ofs = 0x30;
22- else
23+ pci_config_writel(d, ofs, 0xfffffffe);
24+ } else {
25 ofs = 0x10 + i * 4;
26- pci_config_writel(d, ofs, 0xffffffff);
27+ pci_config_writel(d, ofs, 0xffffffff);
28+ }
29 val = pci_config_readl(d, ofs);
30 if (val != 0) {
31 size = (~(val & ~0xf)) + 1;
32
33