vc/amd/opensil/*/mpio: add IFTYPE_UNUSED mpio_type enum element

Add IFTYPE_UNUSED as first element to the mpio_type enum. This allows
checking if the type was set in the devicetree, since the default will
now be IFTYPE_UNUSED. If the type is set to IFTYPE_UNUSED although the
corresponding PCI device function, a warning is printed and the PCI
device function is disabled.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I85e2589c021b4f05662369fd551146b6f2fa0ad4
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81339
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Felix Held
2024-03-15 19:19:46 +01:00
parent c12ef5d7b7
commit 929ef5f7f1
3 changed files with 10 additions and 0 deletions

View File

@ -134,6 +134,14 @@ static void per_device_config(MPIOCLASS_INPUT_BLK *mpio_data, struct device *dev
printk(BIOS_DEBUG, "Setting MPIO port for domain 0x%x, PCI %d:%d\n",
domain, PCI_SLOT(devfn), PCI_FUNC(devfn));
if (config->type == IFTYPE_UNUSED) {
if (is_dev_enabled(dev)) {
printk(BIOS_WARNING, "Unused MPIO engine, disabling PCI device.\n");
dev->enabled = false;
}
return;
}
if (config->bmc) {
setup_bmc_lanes(config->start_lane, 0); // TODO support multiple sockets
return;

View File

@ -17,6 +17,7 @@
*/
enum mpio_type {
IFTYPE_UNUSED,
IFTYPE_PCIE,
IFTYPE_SATA,
};

View File

@ -3,6 +3,7 @@
#include <types.h>
enum mpio_engine_type {
IFTYPE_UNUSED,
IFTYPE_PCIE,
IFTYPE_SATA,
};