Sukumar Ghorai has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/78164?usp=email )
Change subject: soc/intel: fix slp-s0 residency counter frequency _lpit table ......................................................................
soc/intel: fix slp-s0 residency counter frequency _lpit table
Intel platforms using Low Power Idle Table(LPIT) to enumerate platform Low Power Idle states. Two types of low power residencies: a) CPU PKG C10 - read via MSR (Function fixed hardware interface) b) Platform Controller Hub (PCH) SLP_S0 - read via memory mapped interface Ref. https://www.uefi.org/sites/default/files/resources/Intel_ACPI_Low_Power_S0_I...
System sleep time i.e.,SLP_S0 signal asserted and counter measured in count in 122μs granularity/tick.
BUG=b:300440936 TEST=check kernel cpuidle sysfs for sleep residency cat /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us cat /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us
Change-Id: I401dd4a09a67d81a9ea3a56cd22f1a681e2a9349 Signed-off-by: Sukumar Ghorai sukumar.ghorai@intel.com --- M src/include/acpi/acpi.h M src/soc/intel/common/block/acpi/lpit.c M src/soc/intel/meteorlake/Kconfig 3 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/78164/1
diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h index 201d851..d356dc5 100644 --- a/src/include/acpi/acpi.h +++ b/src/include/acpi/acpi.h @@ -453,7 +453,11 @@ uint16_t reserved; } __packed acpi_lpi_desc_hdr_t;
+#if CONFIG_SOC_INTEL_SLP_S0_FREQ_TSC +#define ACPI_LPIT_CTR_FREQ_TSC CONFIG_SOC_INTEL_SLP_S0_FREQ_TSC +#else #define ACPI_LPIT_CTR_FREQ_TSC 0 +#endif
/* LPIT: Native C-state instruction based LPI structure */ typedef struct acpi_lpi_desc_ncst { diff --git a/src/soc/intel/common/block/acpi/lpit.c b/src/soc/intel/common/block/acpi/lpit.c index 38a402f..de3c922 100644 --- a/src/soc/intel/common/block/acpi/lpit.c +++ b/src/soc/intel/common/block/acpi/lpit.c @@ -31,7 +31,7 @@ pkg_counter->residency_counter.bit_width = 64; pkg_counter->residency_counter.space_id = ACPI_ADDRESS_SPACE_FIXED; pkg_counter->residency_counter.access_size = ACPI_ACCESS_SIZE_UNDEFINED; - pkg_counter->counter_frequency = ACPI_LPIT_CTR_FREQ_TSC; + pkg_counter->counter_frequency = 0; /* MSR value return in usec*/
/* Min. residency and worst-case latency (from FSP and vendor dumps) */ pkg_counter->min_residency = 30000; /* break-even: 30 ms */ diff --git a/src/soc/intel/meteorlake/Kconfig b/src/soc/intel/meteorlake/Kconfig index 1c61547..462b8b5 100644 --- a/src/soc/intel/meteorlake/Kconfig +++ b/src/soc/intel/meteorlake/Kconfig @@ -439,4 +439,10 @@ config HAVE_BMP_LOGO_COMPRESS_LZMA default n
+config SOC_INTEL_SLP_S0_FREQ_TSC + hex + default 0x2005 + help + slp_s0_residency granularity in 122μs tick + endif