Subrata Banik has submitted this change. ( 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63640 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Arthur Heymans arthur@aheymans.xyz Reviewed-by: Lean Sheng Tan sheng.tan@9elements.com --- M src/soc/intel/common/block/smbus/smbus.c 1 file changed, 15 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved Lean Sheng Tan: Looks good to me, approved
diff --git a/src/soc/intel/common/block/smbus/smbus.c b/src/soc/intel/common/block/smbus/smbus.c index d1b6523..7fdbffc 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; }
+/* + * `finalize_smbus` function is native implementation of equivalent events + * performed by each FSP NotifyPhase() API invocations. + * + * Operations are: + * 1. TCO Lock. + */ +static void finalize_smbus(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 = finalize_smbus, };
static const unsigned short pci_device_ids[] = {
6 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.