From 6b93866f5ef5efae6542011ad1c84afc86f1bda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Niew=C3=B6hner?= Date: Fri, 24 Sep 2021 23:57:37 +0200 Subject: [PATCH] soc/intel/xeon_sp: disable PM ACPI timer if chosen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable the PM ACPI timer during PMC init, when `USE_PM_ACPI_TIMER` is disabled. This is done to bring SKL, CNL, DNV in line with the other platforms, in order to transition handling of the PM timer from FSP to coreboot in the follow-up changes. Disabling is done in `finalize` since FSP makes use of the PMtimer. Without PM Timer emulation disabling it too early would block. Change-Id: If85c64ba578991a1b112ceac7dd10276b58b0900 Signed-off-by: Michael Niewöhner Reviewed-on: https://review.coreboot.org/c/coreboot/+/58389 Tested-by: build bot (Jenkins) Reviewed-by: Lance Zhao --- src/soc/intel/xeon_sp/Kconfig | 1 + src/soc/intel/xeon_sp/finalize.c | 14 ++++++++++++++ src/soc/intel/xeon_sp/include/soc/pmc.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/src/soc/intel/xeon_sp/Kconfig b/src/soc/intel/xeon_sp/Kconfig index fa8403a235..94fed021f9 100644 --- a/src/soc/intel/xeon_sp/Kconfig +++ b/src/soc/intel/xeon_sp/Kconfig @@ -36,6 +36,7 @@ config CPU_SPECIFIC_OPTIONS select FSP_M_XIP select POSTCAR_STAGE select PARALLEL_MP_AP_WORK + select PM_ACPI_TIMER_OPTIONAL select PMC_GLOBAL_RESET_ENABLE_LOCK select INTEL_DESCRIPTOR_MODE_CAPABLE select SOC_INTEL_COMMON_BLOCK diff --git a/src/soc/intel/xeon_sp/finalize.c b/src/soc/intel/xeon_sp/finalize.c index 044c1cc138..76e3ef1125 100644 --- a/src/soc/intel/xeon_sp/finalize.c +++ b/src/soc/intel/xeon_sp/finalize.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "chip.h" @@ -26,6 +27,19 @@ static void soc_finalize(void *unused) { printk(BIOS_DEBUG, "Finalizing chipset.\n"); + /* + * Disable ACPI PM timer based on Kconfig + * + * Disabling ACPI PM timer is necessary for XTAL OSC shutdown. + * Disabling ACPI PM timer also switches off TCO. + * + * Note: In contrast to other platforms supporting PM timer emulation, + * disabling the PM timer must be done *after* FSP has run on Xeon-SP, + * because FSP makes use of the PM timer. + */ + if (!CONFIG(USE_PM_ACPI_TIMER)) + setbits8(pmc_mmio_regs() + PCH_PWRM_ACPI_TMR_CTL, ACPI_TIM_DIS); + apm_control(APM_CNT_FINALIZE); lock_pam0123(); diff --git a/src/soc/intel/xeon_sp/include/soc/pmc.h b/src/soc/intel/xeon_sp/include/soc/pmc.h index bbdb60bb4b..69299b6057 100644 --- a/src/soc/intel/xeon_sp/include/soc/pmc.h +++ b/src/soc/intel/xeon_sp/include/soc/pmc.h @@ -36,6 +36,8 @@ /* Memory mapped IO registers in PMC */ #define PMSYNC_TPR_CFG 0xc8 #define PMSYNC_LOCK (1 << 15) +#define PCH_PWRM_ACPI_TMR_CTL 0xfc +#define ACPI_TIM_DIS (1 << 1) #define GPIO_GPE_CFG 0x120 #define GPE0_DWX_MASK 0xf #define GPE0_DW_SHIFT(x) (4 * (x))