From e7c1f7da25651a649a832157f7cf01176b18cec5 Mon Sep 17 00:00:00 2001 From: Dinesh Gehlot Date: Tue, 6 Dec 2022 10:58:48 +0000 Subject: soc/intel/meteorlake: Allow configuring 8254 timer via CMOS Currently, the `USE_LEGACY_8254_TIMER` Kconfig option is the only way to enable or disable the legacy 8254 timer. Add the `legacy_8254_timer` CMOS option to allow enabling and disabling the 8254 timer without having to rebuild and reflash coreboot. If options are not enabled or the option is missing in cmos.layout, the Kconfig setting is used. BUG=none TEST=Build and Boot verified on google/rex Port of 'commit bc35bed18eba ("soc/intel/*: Allow configuring 8254 timer via CMOS")' Signed-off-by: Dinesh Gehlot Change-Id: Ibf6c43ddecb3da325c22228205243bb6af00d1d2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/70423 Reviewed-by: Subrata Banik Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) --- src/soc/intel/meteorlake/fsp_params.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/soc/intel/meteorlake/fsp_params.c b/src/soc/intel/meteorlake/fsp_params.c index 53220ec96b..dc51d7bddd 100644 --- a/src/soc/intel/meteorlake/fsp_params.c +++ b/src/soc/intel/meteorlake/fsp_params.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,7 @@ #include #include #include +#include /* THC assignment definition */ #define THC_NONE 0 @@ -345,8 +347,9 @@ static void fill_fsps_8254_params(FSP_S_CONFIG *s_cfg, const struct soc_intel_meteorlake_config *config) { /* Legacy 8254 timer support */ - s_cfg->Enable8254ClockGating = !CONFIG(USE_LEGACY_8254_TIMER); - s_cfg->Enable8254ClockGatingOnS3 = !CONFIG(USE_LEGACY_8254_TIMER); + bool use_8254 = get_uint_option("legacy_8254_timer", CONFIG(USE_LEGACY_8254_TIMER)); + s_cfg->Enable8254ClockGating = !use_8254; + s_cfg->Enable8254ClockGatingOnS3 = !use_8254; } static void fill_fsps_pm_timer_params(FSP_S_CONFIG *s_cfg, -- cgit v1.2.3