coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
rtc.c File Reference
#include <soc/rtc_common.h>
#include <soc/rtc.h>
#include <timer.h>
Include dependency graph for rtc.c:

Go to the source code of this file.

Functions

static bool rtc_busy_wait (void)
 
bool rtc_write_trigger (void)
 
bool rtc_writeif_unlock (void)
 
int rtc_set (const struct rtc_time *time)
 
int rtc_get (struct rtc_time *time)
 
bool rtc_xosc_write (u16 val)
 
bool rtc_lpen (u16 con)
 
bool rtc_reg_init (void)
 
bool rtc_powerkey_init (void)
 
static u8 rtc_check_state (void)
 
void rtc_boot_common (void)
 

Function Documentation

◆ rtc_boot_common()

void rtc_boot_common ( void  )

Definition at line 190 of file rtc.c.

References RTC_BBPU, RTC_BBPU_KEY, RTC_BBPU_RELOAD, rtc_check_state(), RTC_CON, rtc_info, rtc_init(), RTC_IRQ_STA, rtc_osc_init(), rtc_read(), RTC_STATE_INIT, RTC_STATE_REBOOT, RTC_STATE_RECOVER, rtc_write(), and rtc_write_trigger().

Referenced by rtc_boot().

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

◆ rtc_busy_wait()

static bool rtc_busy_wait ( void  )
static

Definition at line 8 of file rtc.c.

References RTC_BBPU, RTC_BBPU_CBUSY, RTC_CBUSY_TIMEOUT_US, rtc_info, rtc_read(), stopwatch_expired(), and stopwatch_init_usecs_expire().

Referenced by rtc_check_state(), rtc_write_trigger(), and rtc_xosc_write().

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

◆ rtc_check_state()

static u8 rtc_check_state ( void  )
static

Definition at line 163 of file rtc.c.

References rtc_busy_wait(), RTC_CON, RTC_CON_LPSTA_RAW, rtc_info, RTC_POWERKEY1, RTC_POWERKEY1_KEY, RTC_POWERKEY2, RTC_POWERKEY2_KEY, rtc_read(), RTC_STATE_INIT, RTC_STATE_REBOOT, RTC_STATE_RECOVER, and rtc_writeif_unlock().

Referenced by rtc_boot_common().

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_lpen()

bool rtc_lpen ( u16  con)

Definition at line 97 of file rtc.c.

References RTC_CON, RTC_CON_LPRST, rtc_write(), and rtc_write_trigger().

Referenced by rtc_lpd_init().

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

◆ rtc_powerkey_init()

bool rtc_powerkey_init ( void  )

Definition at line 156 of file rtc.c.

References RTC_POWERKEY1, RTC_POWERKEY1_KEY, RTC_POWERKEY2, RTC_POWERKEY2_KEY, rtc_write(), and rtc_write_trigger().

Referenced by rtc_init().

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

◆ rtc_reg_init()

bool rtc_reg_init ( void  )

◆ rtc_set()

int rtc_set ( const struct rtc_time time)

Definition at line 47 of file rtc.c.

◆ rtc_write_trigger()

bool rtc_write_trigger ( void  )

Definition at line 27 of file rtc.c.

References rtc_busy_wait(), rtc_write(), and RTC_WRTGR.

Referenced by rtc_bbpu_power_on(), rtc_boot_common(), rtc_enable_dcxo(), rtc_get_frequency_meter(), rtc_gpio_init(), rtc_hw_init(), rtc_init(), rtc_lpd_init(), rtc_lpen(), rtc_powerkey_init(), rtc_reg_init(), rtc_writeif_unlock(), and rtc_xosc_write().

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

◆ rtc_writeif_unlock()

bool rtc_writeif_unlock ( void  )

Definition at line 34 of file rtc.c.

References RTC_PROT, RTC_PROT_UNLOCK1, RTC_PROT_UNLOCK2, rtc_write(), and rtc_write_trigger().

Referenced by poweroff(), rtc_check_state(), rtc_enable_dcxo(), and rtc_init().

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

◆ rtc_xosc_write()

bool rtc_xosc_write ( u16  val)

Definition at line 74 of file rtc.c.

References RTC_BBPU, RTC_BBPU_KEY, RTC_BBPU_RELOAD, rtc_busy_wait(), RTC_OSC32CON, RTC_OSC32CON_UNLOCK1, RTC_OSC32CON_UNLOCK2, rtc_read(), rtc_write(), rtc_write_trigger(), and val.

Referenced by rtc_enable_dcxo(), rtc_get_frequency_meter(), rtc_init(), and rtc_osc_init().

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