From 33eabc07305e98decb28ba72f313c7a0335c0288 Mon Sep 17 00:00:00 2001 From: "Igor V. Kovalenko" Date: Thu, 27 May 2010 20:12:23 +0000 Subject: [PATCH] pci: allow BARs with zero assigned address - consider only PCI BARs with non-zero region size when pupulating "reg" and "assigned-addresses" properties Signed-off-by: Igor V. Kovalenko Signed-off-by: Blue Swirl git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@789 f158a5a8-5612-0410-a976-696ce0be7e32 --- drivers/pci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pci.c b/drivers/pci.c index 41f96dd..aa4ca2c 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -603,7 +603,8 @@ static void pci_set_assigned_addresses(phandle_t phandle, ncells = 0; for (i = 0; i < num_bars; i++) { - if (!config->assigned[i] || !config->sizes[i]) + /* consider only bars with non-zero region size */ + if (!config->sizes[i]) continue; pci_decode_pci_addr(config->assigned[i], &flags, &space_code, &mask); @@ -662,7 +663,8 @@ static void pci_set_reg(phandle_t phandle, ncells += pci_encode_size(props + ncells, 0); for (i = 0; i < num_bars; i++) { - if (!config->assigned[i] || !config->sizes[i]) + /* consider only bars with non-zero region size */ + if (!config->sizes[i]) continue; pci_decode_pci_addr(config->regions[i],