coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mc146818rtc.c File Reference
#include <acpi/acpi.h>
#include <arch/io.h>
#include <commonlib/bsd/bcd.h>
#include <console/console.h>
#include <fallback.h>
#include <pc80/mc146818rtc.h>
#include <rtc.h>
#include <security/vboot/vbnv.h>
#include <security/vboot/vbnv_layout.h>
#include <types.h>
#include <version.h>
Include dependency graph for mc146818rtc.c:

Go to the source code of this file.

Macros

#define RTC_CONTROL_DEFAULT   (RTC_24H)
 
#define RTC_FREQ_SELECT_DEFAULT   (RTC_REF_CLCK_32KHZ | RTC_RATE_1024HZ)
 

Functions

static void cmos_reset_date (void)
 
int cmos_checksum_valid (int range_start, int range_end, int cks_loc)
 
void cmos_set_checksum (int range_start, int range_end, int cks_loc)
 
int cmos_error (void)
 
static bool __cmos_init (bool invalid)
 
static void cmos_init_vbnv (bool invalid)
 
void cmos_init (bool invalid)
 
static void wait_uip (void)
 
static int cmos_date_invalid (void)
 
void cmos_check_update_date (void)
 
int rtc_set (const struct rtc_time *time)
 
int rtc_get (struct rtc_time *time)
 
void set_boot_successful (void)
 

Macro Definition Documentation

◆ RTC_CONTROL_DEFAULT

#define RTC_CONTROL_DEFAULT   (RTC_24H)

Definition at line 65 of file mc146818rtc.c.

◆ RTC_FREQ_SELECT_DEFAULT

#define RTC_FREQ_SELECT_DEFAULT   (RTC_REF_CLCK_32KHZ | RTC_RATE_1024HZ)

Definition at line 66 of file mc146818rtc.c.

Function Documentation

◆ __cmos_init()

◆ cmos_check_update_date()

void cmos_check_update_date ( void  )

Definition at line 192 of file mc146818rtc.c.

References cmos_date_invalid(), cmos_read(), cmos_reset_date(), CONFIG, RTC_CLK_ALTCENTURY, RTC_CLK_YEAR, wait_uip(), and year.

Referenced by lpc_init(), and rtc_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_checksum_valid()

int cmos_checksum_valid ( int  range_start,
int  range_end,
int  cks_loc 
)

Definition at line 31 of file mc146818rtc.c.

References cmos_read(), and CONFIG.

Referenced by __cmos_init(), and cmos_lb_cks_valid().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_date_invalid()

static int cmos_date_invalid ( void  )
static

Definition at line 179 of file mc146818rtc.c.

References rtc_get(), and rtc_invalid().

Referenced by cmos_check_update_date().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_error()

int cmos_error ( void  )

Definition at line 60 of file mc146818rtc.c.

References cmos_read(), RTC_VALID, and RTC_VRT.

Referenced by __cmos_init(), do_normal_boot(), and sanitize_cmos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_init()

void cmos_init ( bool  invalid)

Definition at line 156 of file mc146818rtc.c.

References __cmos_init(), cmos_init_vbnv(), CONFIG, and ENV_SMM.

Referenced by i82801dx_rtc_init(), i82801gx_rtc_init(), i82801ix_rtc_init(), i82801jx_rtc_init(), isa_init(), lpc_init(), pch_rtc_init(), rtc_init(), sb_rtc_init(), sc_init(), soc_rtc_init(), and verify_psp_transfer_buf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_init_vbnv()

static void cmos_init_vbnv ( bool  invalid)
static

Definition at line 141 of file mc146818rtc.c.

References __cmos_init(), read_vbnv_cmos(), save_vbnv_cmos(), vbnv, and VBOOT_VBNV_BLOCK_SIZE.

Referenced by cmos_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_reset_date()

static void cmos_reset_date ( void  )
static

Definition at line 15 of file mc146818rtc.c.

References bcd2bin(), bcd_date::century, coreboot_build_date, bcd_date::day, bcd_date::month, rtc_set(), rtc_time::sec, bcd_date::weekday, and bcd_date::year.

Referenced by __cmos_init(), and cmos_check_update_date().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmos_set_checksum()

void cmos_set_checksum ( int  range_start,
int  range_end,
int  cks_loc 
)

Definition at line 47 of file mc146818rtc.c.

References cmos_read(), and cmos_write().

Referenced by __cmos_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rtc_get()

int rtc_get ( struct rtc_time time)

◆ rtc_set()

int rtc_set ( const struct rtc_time time)

Definition at line 210 of file mc146818rtc.c.

References bin2bcd(), cmos_write(), CONFIG, rtc_time::hour, rtc_time::mday, rtc_time::min, rtc_time::mon, RTC_CLK_ALTCENTURY, RTC_CLK_DAYOFMONTH, RTC_CLK_DAYOFWEEK, RTC_CLK_HOUR, RTC_CLK_MINUTE, RTC_CLK_MONTH, RTC_CLK_SECOND, RTC_CLK_YEAR, rtc_time::sec, rtc_time::wday, and rtc_time::year.

Referenced by cmos_reset_date().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_boot_successful()

void set_boot_successful ( void  )

Definition at line 248 of file mc146818rtc.c.

References CONFIG, inb(), outb(), RTC_BOOT_BYTE, RTC_BOOT_NORMAL, and RTC_PORT.

Referenced by acpi_resume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait_uip()

static void wait_uip ( void  )
static

Definition at line 172 of file mc146818rtc.c.

References cmos_read(), RTC_REG_A, and RTC_UIP.

Referenced by cmos_check_update_date(), and rtc_get().

Here is the call graph for this function:
Here is the caller graph for this function: