summaryrefslogtreecommitdiff
path: root/src/mainboard/pcengines/apu2
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-07-03 10:49:44 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-07-04 09:35:13 +0000
commitdace2498ecfadf645599aaa3ba8fef8cbb111c2d (patch)
tree232bc02b5c634d0e7e157e6a6095106dddc26b7e /src/mainboard/pcengines/apu2
parent367497486d637ff07518872ad21f2cf2d8443e80 (diff)
pcengines/apuX: Replace use of dev_find_slot()
Find the NIC device based on the PCIe root port function. Change-Id: Ia8c6e115c9b836ee60862427dfc9d46ca3dd1b69 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/34003 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Diffstat (limited to 'src/mainboard/pcengines/apu2')
-rw-r--r--src/mainboard/pcengines/apu2/mainboard.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c
index 5a19d20efc..682120bc65 100644
--- a/src/mainboard/pcengines/apu2/mainboard.c
+++ b/src/mainboard/pcengines/apu2/mainboard.c
@@ -197,22 +197,15 @@ const char *smbios_mainboard_serial_number(void)
struct device *dev;
uintptr_t bar10;
u32 mac_addr = 0;
- u32 bus_no;
int i;
- /*
- * In case we have PCIe module connected to mPCIe2 slot, BDF 1:0.0 may
- * not be a NIC, because mPCIe2 slot is routed to the very first PCIe
- * bridge and the first NIC is connected to the second PCIe bridge.
- * Read secondary bus number from the PCIe bridge where the first NIC is
- * connected.
- */
- dev = pcidev_on_root(2, 2);
- if ((serial[0] != 0) || !dev)
+ /* Already initialized. */
+ if (serial[0] != 0)
return serial;
- bus_no = dev->link_list->secondary;
- dev = dev_find_slot(bus_no, PCI_DEVFN(0, 0));
+ dev = pcidev_on_root(2, 2);
+ if (dev)
+ dev = pcidev_path_behind(dev->link_list, PCI_DEVFN(0, 0));
if (!dev)
return serial;