amdfam10 boards: Fix regression on dev_find_slot() removal

For these platforms, the first PCI node on devicetree
is not the root of PCI bus hierarchy, and the topology
(bus->children and dev->sibling links) are getting
manipulated during HyperTransport enumeration.

This workaround reverts back to old dev_find_slot() with
its bad semantics.

Change-Id: I19745c3070c12e562ffab2f0243c9d91dd051c72
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/30695
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Kyösti Mälkki 2019-01-06 17:40:36 +02:00
parent a6ce5d3faa
commit db866ba200
1 changed files with 8 additions and 0 deletions

View File

@ -187,9 +187,17 @@ DEVTREE_CONST struct device *pcidev_path_on_root(pci_devfn_t devfn)
{
DEVTREE_CONST struct device *pci_domain;
/* Work around pcidev_path_behind() below failing
* due tue complicated devicetree with topology
* being manipulated on-the-fly.
*/
if (IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10))
return dev_find_slot(0, devfn);
pci_domain = dev_find_path(NULL, DEVICE_PATH_DOMAIN);
if (!pci_domain)
return NULL;
return pcidev_path_behind(pci_domain->link_list, devfn);
}