From 13bbb04acdbd4592608590a2853ab5f91c7d17f7 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Fri, 14 Apr 2023 12:59:19 +0530 Subject: [PATCH] drivers/intel/ish: Hook get ISH version into `.final` This patch creates .final hook to call into get ISH version function if platform has required config (`SOC_INTEL_STORE_CSE_FPT_PARTITION_VERSION`) support. BUG=b:273661726 TEST=The ISHC version, 5.4.2.7779, was retrieved on the google/nivviks. Signed-off-by: Dinesh Gehlot Change-Id: Ib3f983d5de5b169474bcdb1e9e2934174a9dadf8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74209 Reviewed-by: Kangheui Won Reviewed-by: Sridhar Siricilla Tested-by: build bot (Jenkins) --- src/drivers/intel/ish/ish.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/drivers/intel/ish/ish.c b/src/drivers/intel/ish/ish.c index a232217fe7..0415af0d9a 100644 --- a/src/drivers/intel/ish/ish.c +++ b/src/drivers/intel/ish/ish.c @@ -2,9 +2,11 @@ #include #include +#include #include #include #include +#include #include "chip.h" static void ish_fill_ssdt_generator(const struct device *dev) @@ -46,6 +48,25 @@ static void intel_ish_enable(struct device *dev) dev->ops = &intel_ish_ops; } +static void intel_ish_get_version(void) +{ + struct cse_fw_partition_info *version = cbmem_find(CBMEM_ID_CSE_PARTITION_VERSION); + if (version == NULL) + return; + + printk(BIOS_DEBUG, "ISH version: %d.%d.%d.%d\n", + version->ish_partition_info.cur_ish_fw_version.major, + version->ish_partition_info.cur_ish_fw_version.minor, + version->ish_partition_info.cur_ish_fw_version.hotfix, + version->ish_partition_info.cur_ish_fw_version.build); +} + +static void intel_ish_final(struct device *dev) +{ + if (CONFIG(SOC_INTEL_STORE_CSE_FPT_PARTITION_VERSION)) + intel_ish_get_version(); +} + /* Copy of default_pci_ops_dev with scan_bus addition */ static const struct device_operations pci_ish_device_ops = { .read_resources = pci_dev_read_resources, @@ -54,6 +75,7 @@ static const struct device_operations pci_ish_device_ops = { .init = pci_dev_init, .scan_bus = &scan_generic_bus, /* Non-default */ .ops_pci = &pci_dev_ops_pci, + .final = intel_ish_final, }; static const unsigned short pci_device_ids[] = {