Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/63640 )
Change subject: soc/intel/common/smbus: Add `finalize` operation for smbus ......................................................................
soc/intel/common/smbus: Add `finalize` operation for smbus
This patch implements the required operations to perform prior to booting to OS using coreboot native driver when platform decides to skip FSP notify APIs i.e. Post PCI Enumeration.
The smbus `.final` operation ensures locking the TCO register when coreboot decides to skip FspNotifyApi() calls.
BUG=b:211954778 TEST=Able to build google/brya with these changes and coreboot log with this code change as below with ADL SoC skip calling into FspNotifyAPIs:
[INFO ] Finalize devices... [DEBUG] PCI: 00:1f.4 final
localhost ~ # lspci -xxx | less
00:1f.4 Intel Corporation Alder Lake PCH-P SMBus Host Controller (rev 01)
Offset 8, Bit 12 a.k.a TCO Lock bit is set (meaning locked).
Signed-off-by: Subrata Banik subratabanik@google.com Change-Id: Ie945680049514e6c5d797790a381a6946e836926 --- M src/soc/intel/common/block/smbus/smbus.c 1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/63640/1
diff --git a/src/soc/intel/common/block/smbus/smbus.c b/src/soc/intel/common/block/smbus/smbus.c index d1b6523..31fe120 100644 --- a/src/soc/intel/common/block/smbus/smbus.c +++ b/src/soc/intel/common/block/smbus/smbus.c @@ -7,6 +7,7 @@ #include <device/pci_ids.h> #include <soc/smbus.h> #include <device/smbus_host.h> +#include <intelblocks/tco.h> #include "smbuslib.h"
static int lsmbus_read_byte(struct device *dev, u8 address) @@ -63,6 +64,19 @@ IORESOURCE_STORED | IORESOURCE_ASSIGNED; }
+/* + * `smbus_final` function is native implementation of equivalent events + * performed by each FSP NotifyPhase() API invocations. + * + * Operations are: + * 1. TCO Lock. + */ +static void smbus_final(struct device *dev) +{ + if (!CONFIG(USE_FSP_NOTIFY_PHASE_POST_PCI_ENUM)) + tco_lockdown(); +} + static struct device_operations smbus_ops = { .read_resources = smbus_read_resources, .set_resources = pci_dev_set_resources, @@ -71,6 +85,7 @@ .init = pch_smbus_init, .ops_pci = &pci_dev_ops_pci, .ops_smbus_bus = &lops_smbus_bus, + .final = smbus_final, };
static const unsigned short pci_device_ids[] = {