[coreboot] [PATCH] v3: fix PCI bus scan / device tree interaction

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Fri Aug 29 12:30:14 CEST 2008


On 29.08.2008 08:38, Stefan Reinauer wrote:
> Carl-Daniel Hailfinger wrote:
>   
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>>
>>   
>>     
> NACK !
>   
>> This patch fixes the dts lookup, BUT it introduces new undesired behaviour:
>>
>> - Only the first bus of a PCI domain is scanned.  That's fixable in an
>> obvious way.
>>     

The comment in the old code suggests that there can be only one PCI bus
below a PCI domain ("There is only one link on this device, and it is
always link 0"). Is that true? In that case, the new behaviour wouldn't
be undesired, but conform to the spec.

> Please just send that obvious patch and it can be reviewed.
>   

Sure.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: corebootv3-pci_scan_bus/device/pci_device.c
===================================================================
--- corebootv3-pci_scan_bus/device/pci_device.c	(Revision 845)
+++ corebootv3-pci_scan_bus/device/pci_device.c	(Arbeitskopie)
@@ -1196,8 +1196,16 @@
 unsigned int pci_domain_scan_bus(struct device *dev, unsigned int max)
 {
 	printk(BIOS_SPEW, "pci_domain_scan_bus: calling pci_scan_bus\n");
-	/* There is only one link on this device, and it is always link 0. */
-	return pci_scan_bus(&dev->link[0], PCI_DEVFN(0, 0), 0xff, max);
+	/* There is only one link on this device, and it is always link 0.
+	 * dev->link[0] for a PCI domain is the domain link.
+	 * The child of the domain link is the PCI bus device.
+	 * We want to scan the bus link of the PCI bus device.
+	 * dev->link[0].children->link[0] is that PCI bus link.
+	 * If there can be multiple PCI buses below a PCI domain, we have to
+	 * iterate over the PCI buses in a loop.
+	 */
+	return pci_scan_bus(&dev->link[0].children->link[0], PCI_DEVFN(0, 0),
+			    0xff, max);
 }
 
 /**


-- 
http://www.hailfinger.org/





More information about the coreboot mailing list