summaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/chip.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-07-03 07:25:59 +0300
committerNico Huber <nico.h@gmx.de>2019-07-04 09:48:22 +0000
commit903b40a8a46b6e8d853f509480661c8174311f17 (patch)
treefd07ccd13dd831f2a30fac410c89125ed9eae1ce /src/soc/intel/apollolake/chip.c
parent9c0e14e7c43e85e99c0bbfdff72019d908de1711 (diff)
soc/intel: Replace uses of dev_find_slot()
To call dev_find_slot(0, xx) in romstage can produce invalid results since PCI bus enumeration has not been progressed yet. Replace this with method that relies on bus topology that walks the root bus only. Change-Id: I2883610059bb9fa860bba01179e7d5c58cae00e5 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33996 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel/apollolake/chip.c')
-rw-r--r--src/soc/intel/apollolake/chip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index e9030dc2df..1d5e6d95ba 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -256,7 +256,7 @@ static void pcie_update_device_tree(unsigned int devfn0, int num_funcs)
int i;
unsigned int inc = PCI_DEVFN(0, 1);
- func0 = dev_find_slot(0, devfn0);
+ func0 = pcidev_path_on_root(devfn0);
if (func0 == NULL)
return;
@@ -272,7 +272,7 @@ static void pcie_update_device_tree(unsigned int devfn0, int num_funcs)
* as that port was move to func0.
*/
for (i = 1; i < num_funcs; i++, devfn += inc) {
- struct device *dev = dev_find_slot(0, devfn);
+ struct device *dev = pcidev_path_on_root(devfn);
if (dev == NULL)
continue;
@@ -760,7 +760,7 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *silupd)
apl_fsp_silicon_init_params_cb(cfg, silconfig);
/* Enable xDCI controller if enabled in devicetree and allowed */
- dev = dev_find_slot(0, PCH_DEVFN_XDCI);
+ dev = pcidev_path_on_root(PCH_DEVFN_XDCI);
if (!xdci_can_enable())
dev->enabled = 0;
silconfig->UsbOtg = dev->enabled;