aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexey Korolev <alexey.korolev@endace.com>2012-04-19 17:40:13 +1200
committerKevin O'Connor <kevin@koconnor.net>2012-04-26 21:52:30 -0400
commit1a9f47f91080e7b2ddfffbe4ebf0a3bd1845539f (patch)
tree19fe9fd83737d2ab1803d6524b36ead76f1245b1 /src
parent3d1bc9d8b1013959a05ff085b281f17750f9c886 (diff)
downloadseabios-hppa-1a9f47f91080e7b2ddfffbe4ebf0a3bd1845539f.zip
seabios-hppa-1a9f47f91080e7b2ddfffbe4ebf0a3bd1845539f.tar.gz
seabios-hppa-1a9f47f91080e7b2ddfffbe4ebf0a3bd1845539f.tar.bz2
pciinit: bridges can have two regions too
Patch takes into account PCI bar and ROM regions of PCI bridges Original patch by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin O'Connor <kevin@koconnor.net> Signed-off-by: Alexey Korolev <alexey.korolev@endace.com>
Diffstat (limited to 'src')
-rw-r--r--src/pci.h1
-rw-r--r--src/pciinit.c8
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)