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

Go to the source code of this file.

Functions

static bool rtc_enable_dcxo (void)
 
bool rtc_gpio_init (void)
 
u16 rtc_get_frequency_meter (u16 val, u16 measure_src, u16 window_size)
 
static bool rtc_lpd_init (void)
 
static bool rtc_hw_init (void)
 
int rtc_init (int recover)
 
void rtc_bbpu_power_on (void)
 
void poweroff (void)
 
static void dcxo_init (void)
 
void mt6358_dcxo_disable_unused (void)
 
void rtc_boot (void)
 

Function Documentation

◆ dcxo_init()

static void dcxo_init ( void  )
static

Definition at line 298 of file rtc.c.

References mdelay(), PMIC_RG_DCXO_CW00, PMIC_RG_DCXO_CW07, PMIC_RG_DCXO_CW09, PMIC_RG_DCXO_CW11, PMIC_RG_DCXO_CW13, PMIC_RG_DCXO_CW15, PMIC_RG_DCXO_CW16, PMIC_RG_DCXO_CW21, PMIC_RG_DCXO_ELR0, PMIC_RG_TOP_TMA_KEY, rtc_write(), and udelay().

Referenced by rtc_boot().

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

◆ mt6358_dcxo_disable_unused()

void mt6358_dcxo_disable_unused ( void  )

Definition at line 326 of file rtc.c.

References PMIC_RG_DCXO_CW00_CLR, PMIC_RG_DCXO_CW23, and rtc_write().

Referenced by soc_init().

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

◆ poweroff()

void poweroff ( void  )

Definition at line 284 of file rtc.c.

References acpi_write32(), ENV_SMM, halt(), MMIO_ACPI_PM1_CNT_BLK, pmic_set_power_hold(), RTC_BBPU, RTC_BBPU_KEY, RTC_BBPU_PWREN, RTC_BBPU_RELOAD, rtc_info, rtc_write(), rtc_writeif_unlock(), SLP_EN, SLP_TYP_S5, and SLP_TYP_SHIFT.

Referenced by chromeec_process_one_event().

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

◆ rtc_bbpu_power_on()

void rtc_bbpu_power_on ( void  )

Definition at line 266 of file rtc.c.

References pmic_set_power_hold(), RTC_BBPU, RTC_BBPU_AUTO, RTC_BBPU_KEY, RTC_BBPU_PWREN, RTC_BBPU_RELOAD, rtc_info, rtc_read(), 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_boot()

void rtc_boot ( void  )

Definition at line 335 of file rtc.c.

References dcxo_init(), PMIC_RG_DCXO_CW02, PMIC_RG_SCK_TOP_CON0, pwrap_write_field(), rtc_bbpu_power_on(), rtc_boot_common(), rtc_enable_dcxo(), and rtc_info.

Here is the call graph for this function:

◆ rtc_enable_dcxo()

static bool rtc_enable_dcxo ( void  )
static

◆ rtc_get_frequency_meter()

◆ rtc_gpio_init()

bool rtc_gpio_init ( void  )

Definition at line 45 of file rtc.c.

References PMIC_RG_TOP_CKPDN_CON1_CLR, PMIC_RG_TOP_CKSEL_CON0_SET, pwrap_write_field(), RTC_CON, RTC_CON_EOSC32_LPEN, RTC_CON_F32KOB, RTC_CON_GOE, RTC_CON_GPEN, RTC_CON_LPRST, RTC_CON_LPSTA_RAW, RTC_CON_XOSC32_LPEN, rtc_read(), 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_hw_init()

static bool rtc_hw_init ( void  )
static

Definition at line 182 of file rtc.c.

References RTC_BBPU, RTC_BBPU_INIT, RTC_BBPU_KEY, RTC_BBPU_RELOAD, rtc_info, rtc_read(), rtc_write(), rtc_write_trigger(), and udelay().

Referenced by rtc_init().

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

◆ rtc_init()

◆ rtc_lpd_init()

static bool rtc_lpd_init ( void  )
static

Definition at line 144 of file rtc.c.

References RTC_AL_SEC, RTC_CON, RTC_CON_EOSC32_LPEN, RTC_CON_XOSC32_LPEN, RTC_LPD_OPT_EOSC_LPD, RTC_LPD_OPT_F32K_CK_ALIVE, RTC_LPD_OPT_MASK, rtc_lpen(), rtc_read(), 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: