From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WV65f-0004yT-Rk for qemu-devel@nongnu.org; Tue, 01 Apr 2014 17:19:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WV65Z-0007jy-V0 for qemu-devel@nongnu.org; Tue, 01 Apr 2014 17:19:27 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Tue, 1 Apr 2014 23:18:11 +0200 Message-Id: <1396387092-5667-2-git-send-email-hpoussin@reactos.org> In-Reply-To: <1396387092-5667-1-git-send-email-hpoussin@reactos.org> References: <1396387092-5667-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-ppc@nongnu.org Note that offsets are PReP ones, so this breaks compatibility with hardwa= re which has different values. Signed-off-by: Herv=C3=A9 Poussineau --- 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 =3D 0x30; /* PCI ROM */ else addr =3D 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)= ; + } } } } --=20 1.7.10.4