From c4e5e91cbdf87842003e4569ddfb2f455c077593 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 22 Jan 2024 18:42:35 +0100 Subject: [PATCH] vc/amd/opensil/genoa_poc/mpio: don't add duplicate MPIO descriptors When the device right below the MPIO chip driver has downstream devices without another chip in between, those downstream devices will also have their chip_ops entry set to vendorcode_amd_opensil_genoa_poc_mpio_ops. To avoid adding the same MPIO descriptor again for those additional downstream devices, make sure that the chip_info pointer of the device isn't the same as the one of the parent device, since that's only the case for those additional downstream devices. TEST=Onyx still boots to the payload and the MPIO configuration reported from the openSIL code is still the same Signed-off-by: Felix Held Suggested-by: Nico Huber Change-Id: I6ba90fdc83ba089127e6722778bfef29dd480bb4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/80149 Reviewed-by: Arthur Heymans Reviewed-by: Marshall Dawson Tested-by: build bot (Jenkins) --- src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c index 28e529dc3e..89314ba8d7 100644 --- a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c +++ b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c @@ -186,8 +186,9 @@ void configure_mpio(void) mpio_global_config(mpio_data); nbio_config(); - /* Find all devices with this chip */ + /* Find all devices with this chip that are directly below the chip */ for (struct device *dev = &dev_root; dev; dev = dev->next) - if (dev->chip_ops == &vendorcode_amd_opensil_genoa_poc_mpio_ops) + if (dev->chip_ops == &vendorcode_amd_opensil_genoa_poc_mpio_ops && + dev->chip_info != dev->bus->dev->chip_info) per_device_config(mpio_data, dev->bus->dev, dev->chip_info); }