Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81339?usp=email )
Change subject: vc/amd/opensil/*/mpio: add ENGINE_UNUSED mpio_type enum element ......................................................................
vc/amd/opensil/*/mpio: add ENGINE_UNUSED mpio_type enum element
Add ENGINE_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 ENGINE_UNUSED. If the type is set to ENGINE_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 --- M src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c M src/vendorcode/amd/opensil/genoa_poc/mpio/chip.h M src/vendorcode/amd/opensil/stub/mpio/chip.h 3 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/81339/1
diff --git a/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c b/src/vendorcode/amd/opensil/genoa_poc/mpio/chip.c index 1876da7..5a07767 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 @@ printk(BIOS_DEBUG, "Setting MPIO port for domain 0x%x, PCI %d:%d\n", domain, PCI_SLOT(devfn), PCI_FUNC(devfn));
+ if (config->type == ENGINE_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 3717374..9b8d392 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 { + ENGINE_UNUSED, ENGINE_PCIE, ENGINE_SATA, }; diff --git a/src/vendorcode/amd/opensil/stub/mpio/chip.h b/src/vendorcode/amd/opensil/stub/mpio/chip.h index 53d22a0..8b28c47d 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 { + ENGINE_UNUSED, ENGINE_PCIE, ENGINE_SATA, };