diff options
author | Subrata Banik <subratabanik@google.com> | 2023-04-14 12:59:19 +0530 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-04-21 17:22:31 +0000 |
commit | 13bbb04acdbd4592608590a2853ab5f91c7d17f7 (patch) | |
tree | c0450560322ad83026d4dc3e4274dcabac7e37e7 /src/drivers/intel | |
parent | b1b7c532b0909d958d2f47f285d73836b689cefa (diff) |
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 <digehlot@google.com>
Change-Id: Ib3f983d5de5b169474bcdb1e9e2934174a9dadf8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74209
Reviewed-by: Kangheui Won <khwon@chromium.org>
Reviewed-by: Sridhar Siricilla <sridhar.siricilla@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/drivers/intel')
-rw-r--r-- | src/drivers/intel/ish/ish.c | 22 |
1 files changed, 22 insertions, 0 deletions
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 <acpi/acpi_device.h> #include <acpi/acpigen.h> +#include <cbmem.h> #include <console/console.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <intelblocks/cse.h> #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[] = { |