[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v2 1/2] ohw: correctly program BAR addresses of PCI de
From: |
Hervé Poussineau |
Subject: |
[Qemu-ppc] [PATCH v2 1/2] ohw: correctly program BAR addresses of PCI devices |
Date: |
Wed, 23 Apr 2014 23:19:34 +0200 |
Note that offsets are PReP ones, so this breaks compatibility with hardware
which has different values.
Signed-off-by: Hervé Poussineau <address@hidden>
---
Indentation may look strange, but I tried to stay consistent with other parts
of the file.
src/pci.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/pci.c b/src/pci.c
index 38aad27..d917370 100644
--- a/src/pci.c
+++ b/src/pci.c
@@ -1723,8 +1723,13 @@ static inline void pci_update_device (pci_bridge_t
*bridge,
addr = 0x30; /* PCI ROM */
else
addr = 0x10 + (i * sizeof(uint32_t));
+ if (device->regions[i] & 0x00000001) {
pci_config_writel(bridge, device->bus, device->devfn,
- addr, device->regions[i]);
+ addr, device->regions[i] - 0x80000000);
+ } else {
+ pci_config_writel(bridge, device->bus, device->devfn,
+ addr, device->regions[i] - 0xc0000000);
+ }
}
}
}
--
1.7.10.4