aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2024-03-15 19:19:46 +0100
committerFelix Held <felix-coreboot@felixheld.de>2024-03-20 19:06:14 +0000
commit929ef5f7f1a3fb6155386d2f90f8f434ae02b6b6 (patch)
tree865143b21dda488d292efd48b4bd8d2b1a63cfea
parentc12ef5d7b77d4be76f43018458bfa184f182782e (diff)
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>
-rw-r--r--src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c8
-rw-r--r--src/vendorcode/amd/opensil/genoa_poc/mpio/chip.h1
-rw-r--r--src/vendorcode/amd/opensil/stub/mpio/chip.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c
index 61233a9a94..2d32ca5e64 100644
--- a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c
+++ b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c
@@ -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;
diff --git a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.h b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.h
index deb40387d3..4a78ef5f2b 100644
--- a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.h
+++ b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.h
@@ -17,6 +17,7 @@
*/
enum mpio_type {
+ IFTYPE_UNUSED,
IFTYPE_PCIE,
IFTYPE_SATA,
};
diff --git a/src/vendorcode/amd/opensil/stub/mpio/chip.h b/src/vendorcode/amd/opensil/stub/mpio/chip.h
index f2fb5da6a9..96f60bea4c 100644
--- a/src/vendorcode/amd/opensil/stub/mpio/chip.h
+++ b/src/vendorcode/amd/opensil/stub/mpio/chip.h
@@ -3,6 +3,7 @@
#include <types.h>
enum mpio_engine_type {
+ IFTYPE_UNUSED,
IFTYPE_PCIE,
IFTYPE_SATA,
};