[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of P
From: |
Hervé Poussineau |
Subject: |
[Qemu-ppc] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices |
Date: |
Tue, 1 Apr 2014 23:18:11 +0200 |
Note that offsets are PReP ones, so this breaks compatibility with hardware
which has different values.
Signed-off-by: Hervé Poussineau <address@hidden>
---
src/pci.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/pci.c b/src/pci.c
index 38aad27..7c0ebad 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));
- pci_config_writel(bridge, device->bus, device->devfn,
- addr, device->regions[i]);
+ if (device->regions[i] & 0x00000001) {
+ pci_config_writel(bridge, device->bus, device->devfn,
+ addr, device->regions[i] - 0x80000000);
+ } else {
+ pci_config_writel(bridge, device->bus, device->devfn,
+ addr, device->regions[i] - 0xc0000000);
+ }
}
}
}
--
1.7.10.4