From db866ba2009f6376dc8fd32e506a614439ba618c Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Sun, 6 Jan 2019 17:40:36 +0200 Subject: amdfam10 boards: Fix regression on dev_find_slot() removal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: https://review.coreboot.org/c/30695 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans --- src/device/device_const.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/device/device_const.c') diff --git a/src/device/device_const.c b/src/device/device_const.c index ec128e877d..f60f749c49 100644 --- a/src/device/device_const.c +++ b/src/device/device_const.c @@ -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); } -- cgit v1.2.3