coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
rtc.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <intelblocks/pcr.h>
4 #include <intelblocks/rtc.h>
5 #include <soc/pcr_ids.h>
6 #include <pc80/mc146818rtc.h>
7 
8 /* RTC PCR configuration */
9 #define PCR_RTC_CONF 0x3400
10 #define PCR_RTC_CONF_UCMOS_EN (1 << 2)
11 #define PCR_RTC_CONF_LCMOS_LOCK (1 << 3)
12 #define PCR_RTC_CONF_UCMOS_LOCK (1 << 4)
13 #define PCR_RTC_CONF_BILD (1 << 31)
14 /* RTC backed up control register */
15 #define PCR_RTC_BUC 0x3414
16 #define PCR_RTC_BUC_TOP_SWAP (1 << 0)
17 
19 {
20  /* Enable upper 128 bytes of CMOS */
22 }
23 
25 {
26  return 0;
27 }
28 
29 void rtc_init(void)
30 {
31  /* Ensure the date is set including century byte. */
33 
35 }
36 
38 {
41 }
42 
43 #if CONFIG(INTEL_HAS_TOP_SWAP)
44 void configure_rtc_buc_top_swap(enum ts_config ts_state)
45 {
47 }
48 
50 {
52  return TS_ENABLE;
53  else
54  return TS_DISABLE;
55 }
56 #endif
#define PID_RTC
Definition: pcr_ids.h:32
void pcr_rmw32(uint8_t pid, uint16_t offset, uint32_t anddata, uint32_t ordata)
Definition: pcr.c:154
uint32_t pcr_read32(uint8_t pid, uint16_t offset)
Definition: pcr.c:89
void pcr_or32(uint8_t pid, uint16_t offset, uint32_t ordata)
Definition: pcr.c:184
void cmos_check_update_date(void)
Definition: mc146818rtc.c:192
void cmos_init(bool invalid)
Definition: mc146818rtc.c:156
const struct smm_save_state_ops *legacy_ops __weak
Definition: save_state.c:8
ts_config
Definition: rtc.h:7
@ TS_DISABLE
Definition: rtc.h:8
@ TS_ENABLE
Definition: rtc.h:9
enum ts_config get_rtc_buc_top_swap_status(void)
void configure_rtc_buc_top_swap(enum ts_config ts_state)
#define PCR_RTC_CONF_BILD
Definition: rtc.c:13
void enable_rtc_upper_bank(void)
Definition: rtc.c:18
__weak int soc_get_rtc_failed(void)
Definition: rtc.c:24
#define PCR_RTC_BUC
Definition: rtc.c:15
#define PCR_RTC_CONF
Definition: rtc.c:9
#define PCR_RTC_BUC_TOP_SWAP
Definition: rtc.c:16
#define PCR_RTC_CONF_UCMOS_EN
Definition: rtc.c:10
void rtc_conf_set_bios_interface_lockdown(void)
Definition: rtc.c:37
void rtc_init(void)
Definition: rtc.c:29