Rizwan Qureshi has uploaded this change for review. ( https://review.coreboot.org/28057
Change subject: soc/intel/common: Add function to set BILD bit in RTC ......................................................................
soc/intel/common: Add function to set BILD bit in RTC
Add a function to set the Bios Interface Lock Down bit (bit 31) in RTC Configuration register (0x3400). This bit when set prevents the top swap enable bit (bit 0) in the RTC BUC register (0x3414) from being changed.
Change-Id: Iacaeeb0d6cabcf0c2c46a58948457ab832351476 Signed-off-by: Rizwan Qureshi rizwan.qureshi@intel.com --- M src/soc/intel/common/block/include/intelblocks/rtc.h M src/soc/intel/common/block/rtc/rtc.c 2 files changed, 12 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/28057/1
diff --git a/src/soc/intel/common/block/include/intelblocks/rtc.h b/src/soc/intel/common/block/include/intelblocks/rtc.h index 56cfb2e..0faf0b0 100644 --- a/src/soc/intel/common/block/include/intelblocks/rtc.h +++ b/src/soc/intel/common/block/include/intelblocks/rtc.h @@ -45,4 +45,6 @@ */ enum ts_config get_rtc_buc_top_swap_status(void);
+/* Set RTC Configuration BILD bit. */ +void rtc_conf_set_bios_interface_lockdown(void); #endif /* SOC_INTEL_COMMON_BLOCK_RTC_H */ diff --git a/src/soc/intel/common/block/rtc/rtc.c b/src/soc/intel/common/block/rtc/rtc.c index b8c8849..2fe4bd9 100644 --- a/src/soc/intel/common/block/rtc/rtc.c +++ b/src/soc/intel/common/block/rtc/rtc.c @@ -27,7 +27,10 @@ #define PCR_RTC_CONF_RESERVED (1 << 31) /* RTC backed up control register */ #define PCR_RTC_BUC 0x3414 -#define PCR_RTC_BUC_TOP_SWAP (1 << 0) +#define PCR_RTC_BUC_TOP_SWAP (1 << 0) + +#define PCR_RTC_CONF 0x3400 +#define PCR_RTC_CONF_BILD (1 << 31)
void enable_rtc_upper_bank(void) { @@ -48,6 +51,12 @@ cmos_init(soc_get_rtc_failed()); }
+void rtc_conf_set_bios_interface_lockdown(void) +{ + pcr_rmw32(PID_RTC, PCR_RTC_CONF, ~PCR_RTC_CONF_BILD, + PCR_RTC_CONF_BILD); +} + #if IS_ENABLED(CONFIG_INTEL_HAS_TOP_SWAP) void configure_rtc_buc_top_swap(enum ts_config ts_state) {