[OpenBIOS] [PATCH 2/3] pci: always use devfn 0 for PCI host bridge ranges

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Jul 8 21:19:40 CEST 2017


Always use devfn 0 for PCI host bridge ranges, regardless of the devfn of the
bridge itself. This generates a PCI host bridge ranges property matching that
of real hardware for PPC machines.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 drivers/pci.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci.c b/drivers/pci.c
index bd8b87e..b533898 100644
--- a/drivers/pci.c
+++ b/drivers/pci.c
@@ -488,26 +488,26 @@ static void pci_host_set_ranges(const pci_config_t *config)
            bridges except for SPARC, particularly as it causes Darwin/OS X
            to incorrectly calculated PCI memory space ranges on PPC. */
 	ncells += pci_encode_phys_addr(props + ncells, 0, CONFIGURATION_SPACE,
-                     config->dev, 0, 0);
+                     0, 0, 0);
         ncells += host_encode_phys_addr(props + ncells, arch->cfg_addr);
         ncells += pci_encode_size(props + ncells, arch->cfg_len);
 #endif
 
 	if (arch->io_base) {
 	    ncells += pci_encode_phys_addr(props + ncells, 0, IO_SPACE,
-				     config->dev, 0, 0);
+				     0, 0, 0);
         ncells += host_encode_phys_addr(props + ncells, arch->io_base);
         ncells += pci_encode_size(props + ncells, arch->io_len);
 	}
 	if (arch->rbase) {
 	    ncells += pci_encode_phys_addr(props + ncells, 0, MEMORY_SPACE_32,
-				     config->dev, 0, 0);
+				     0, 0, 0);
         ncells += host_encode_phys_addr(props + ncells, arch->rbase);
         ncells += pci_encode_size(props + ncells, arch->rlen);
 	}
 	if (arch->pci_mem_base) {
 	    ncells += pci_encode_phys_addr(props + ncells, 0, MEMORY_SPACE_32,
-				     config->dev, 0, arch->pci_mem_base);
+				     0, 0, arch->pci_mem_base);
         ncells += host_encode_phys_addr(props + ncells, arch->host_pci_base +
 				     arch->pci_mem_base);
 	ncells += pci_encode_size(props + ncells, arch->mem_len);
-- 
1.7.10.4




More information about the OpenBIOS mailing list