Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30695
Change subject: [WIP] Fix amdfam10 regression on dev_find_slot() removal ......................................................................
[WIP] Fix amdfam10 regression on dev_find_slot() removal
For these platforms, the first PCI node on devicetree is not the root of PCI bus hierarchy.
Change-Id: I19745c3070c12e562ffab2f0243c9d91dd051c72 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/device/device_const.c 1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/30695/1
diff --git a/src/device/device_const.c b/src/device/device_const.c index ec128e8..53a23ca 100644 --- a/src/device/device_const.c +++ b/src/device/device_const.c @@ -190,7 +190,22 @@ pci_domain = dev_find_path(NULL, DEVICE_PATH_DOMAIN); if (!pci_domain) return NULL; + +#if !IS_ENABLED(CONFIG_NORTHBRIDGE_AMD_AMDFAM10) return pcidev_path_behind(pci_domain->link_list, devfn); +#else + DEVTREE_CONST struct device *rootnode, *dev; + DEVTREE_CONST struct bus *bus; + + rootnode = pcidev_path_behind(pci_domain->link_list, PCI_DEVFN(0x18, 0)); + + for (bus = rootnode->link_list; bus; bus = bus->next) { + dev = pcidev_path_behind(bus, devfn); + if (dev) + return dev; + } + return NULL; +#endif }
DEVTREE_CONST struct device *pcidev_on_root(uint8_t dev, uint8_t fn)