diff options
author | Pratikkumar Prajapati <pratikkumar.v.prajapati@intel.com> | 2023-07-10 15:44:21 -0700 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2023-09-01 21:14:37 +0000 |
commit | 0dc607f68d318d670f3edc084280b8e5c339847e (patch) | |
tree | cf3875e0af7c43e9c526310e417710e927cb69e7 | |
parent | 4d0b18480d7d0a85bef0d1adcf4837549118473e (diff) |
soc/intel/meteorlake: Adjust discovery table offset based on CPUID
CPUID CPUID_METEORLAKE_B0 onwards the discovery table offset needs
to be left-shifted by 3.
Reference: EDS Vol 1 (640228)
BUG=b:289600699
TEST=Able to boot google/rex with crashlog enabled.
Change-Id: I90647fb6190a52b42298398263978beaf931b035
Signed-off-by: Pratikkumar Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76400
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
-rw-r--r-- | src/soc/intel/meteorlake/crashlog.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/soc/intel/meteorlake/crashlog.c b/src/soc/intel/meteorlake/crashlog.c index 2e3c97ae4a..219c7e8256 100644 --- a/src/soc/intel/meteorlake/crashlog.c +++ b/src/soc/intel/meteorlake/crashlog.c @@ -2,6 +2,8 @@ #include <arch/bert_storage.h> #include <console/console.h> +#include <cpu/cpu.h> +#include <cpu/intel/cpu_ids.h> #include <device/pci_ops.h> #include <intelblocks/crashlog.h> #include <intelblocks/pmc_ipc.h> @@ -351,6 +353,17 @@ static bool cpu_cl_get_capability(tel_crashlog_devsc_cap_t *cl_devsc_cap) return true; } +static u32 get_disc_table_offset(void) +{ + u32 offset = cpu_cl_devsc_cap.discovery_data.fields.discovery_table_offset; + if (cpu_get_cpuid() >= CPUID_METEORLAKE_B0) { + offset <<= 3; + printk(BIOS_DEBUG, "adjusted cpu discovery table offset: 0x%x\n", offset); + } + + return offset; +} + static bool cpu_cl_gen_discovery_table(void) { u32 bar_addr = 0, disc_tab_addr = 0; @@ -359,16 +372,10 @@ static bool cpu_cl_gen_discovery_table(void) if (!bar_addr) return false; - disc_tab_addr = bar_addr + - cpu_cl_devsc_cap.discovery_data.fields.discovery_table_offset; + disc_tab_addr = bar_addr + get_disc_table_offset(); memset(&cpu_cl_disc_tab, 0, sizeof(cpu_crashlog_discovery_table_t)); - - printk(BIOS_DEBUG, "cpu discovery table offset: 0x%x\n", - cpu_cl_devsc_cap.discovery_data.fields.discovery_table_offset); - cpu_cl_disc_tab.header.data = ((u64)read32((u32 *)disc_tab_addr) + ((u64)read32((u32 *)(disc_tab_addr + 4)) << 32)); - printk(BIOS_DEBUG, "cpu_crashlog_discovery_table buffer count: 0x%x\n", cpu_cl_disc_tab.header.fields.count); |