From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Cc: "Hervé Poussineau" <hpoussin@reactos.org>,
"Andreas Färber" <andreas.faerber@web.de>,
qemu-ppc@nongnu.org
Subject: [Qemu-devel] [PATCH for-2.0 1/2] ohw: correctly program BAR addresses of PCI devices
Date: Tue, 1 Apr 2014 23:18:11 +0200 [thread overview]
Message-ID: <1396387092-5667-2-git-send-email-hpoussin@reactos.org> (raw)
In-Reply-To: <1396387092-5667-1-git-send-email-hpoussin@reactos.org>
Note that offsets are PReP ones, so this breaks compatibility with hardware which has different values.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
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
next prev parent reply other threads:[~2014-04-01 21:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-01 21:18 [Qemu-devel] [PATCH for-2.0 0/2] prep: Remove some clearly wrong assumptions Hervé Poussineau
2014-04-01 21:18 ` Hervé Poussineau [this message]
2014-04-01 21:18 ` [Qemu-devel] [PATCH for-2.0 2/2] ohw: let the right reset entry point 0xfff00100 jump to the currently wrong entry point (0xfffffffc) Hervé Poussineau
2014-04-02 5:14 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-04-02 5:23 ` Hervé Poussineau
2014-04-02 5:36 ` Alexander Graf
2014-04-02 5:45 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1396387092-5667-2-git-send-email-hpoussin@reactos.org \
--to=hpoussin@reactos.org \
--cc=andreas.faerber@web.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.