[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/12] pciinit: bridges can have two regions too
From: |
Alexey Korolev |
Subject: |
[Qemu-devel] [PATCH 06/12] pciinit: bridges can have two regions too |
Date: |
Tue, 24 Apr 2012 18:18:24 +1200 |
Patch takes into account PCI bar and ROM regions of PCI bridges
Original patch by: Gerd Hoffmann <address@hidden>
Signed-off-by: Kevin O'Connor <address@hidden>
Signed-off-by: Alexey Korolev <address@hidden>
---
src/pci.h | 1 +
src/pciinit.c | 8 +++++---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/pci.h b/src/pci.h
index 5598100..6be838c 100644
--- a/src/pci.h
+++ b/src/pci.h
@@ -5,6 +5,7 @@
#define PCI_ROM_SLOT 6
#define PCI_NUM_REGIONS 7
+#define PCI_BRIDGE_NUM_REGIONS 2
static inline u8 pci_bdf_to_bus(u16 bdf) {
return bdf >> 8;
diff --git a/src/pciinit.c b/src/pciinit.c
index 2bd4426..9b521e3 100644
--- a/src/pciinit.c
+++ b/src/pciinit.c
@@ -370,13 +370,15 @@ static int pci_bios_check_devices(struct pci_bus *busses)
// Calculate resources needed for regular (non-bus) devices.
struct pci_device *pci;
foreachpci(pci) {
- if (pci->class == PCI_CLASS_BRIDGE_PCI) {
+ if (pci->class == PCI_CLASS_BRIDGE_PCI)
busses[pci->secondary_bus].bus_dev = pci;
- continue;
- }
+
struct pci_bus *bus = &busses[pci_bdf_to_bus(pci->bdf)];
int i;
for (i = 0; i < PCI_NUM_REGIONS; i++) {
+ if ((pci->class == PCI_CLASS_BRIDGE_PCI) &&
+ (i >= PCI_BRIDGE_NUM_REGIONS && i < PCI_ROM_SLOT))
+ continue;
u32 val, size;
pci_bios_get_bar(pci, i, &val, &size);
if (val == 0)
--
1.7.5.4
- [Qemu-devel] [Patch 0/12] Pciinit redesign and 64bit PCI support, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 01/12] pciinit: Introduction of pci_region_entry structure, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 02/12] pciinit: Move bus bar asignment, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 03/12] pciinit: Remove size element from pci_bus->r structure, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 04/12] pciinit: Use sorted order allocation, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 05/12] pciinit: Track region alignment explicitly., Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 06/12] pciinit: bridges can have two regions too,
Alexey Korolev <=
- [Qemu-devel] [PATCH 07/12] pciinit: Switch to 64bit variable types., Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 08/12] pciinit: Add pci_region structure., Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 09/12] pciinit: 64bit capability discovery for pci bridges, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 10/12] Calculate pci region stats on demand, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 10/12] Calculate pci region stats on demand, Alexey Korolev, 2012/04/24
- [Qemu-devel] [PATCH 11/12] Migrate 64bit entries to 64bit pci regions, Alexey Korolev, 2012/04/24