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/mt6366.h>
#include <soc/pmic_wrap.h>
#include <timer.h>
Include dependency graph for rtc.c:

Go to the source code of this file.

Macros

#define MT8186_RTC_DXCO_CAPID   0xE0
 

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)
 
static void mt6366_dcxo_disable_unused (void)
 
static void rtc_set_capid (u16 capid)
 
int rtc_init (int recover)
 
void rtc_bbpu_power_on (void)
 
static void dcxo_init (void)
 
void rtc_boot (void)
 

Macro Definition Documentation

◆ MT8186_RTC_DXCO_CAPID

#define MT8186_RTC_DXCO_CAPID   0xE0

Definition at line 16 of file rtc.c.

Function Documentation

◆ dcxo_init()

static void dcxo_init ( void  )
static

◆ mt6366_dcxo_disable_unused()

static void mt6366_dcxo_disable_unused ( void  )
static

Definition at line 228 of file rtc.c.

References PMIC_RG_DCXO_CW00_CLR, PMIC_RG_DCXO_CW23, and rtc_write().

Referenced by dcxo_init().

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 307 of file rtc.c.

References mt6366_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().

Here is the call graph for this function:

◆ rtc_boot()

void rtc_boot ( void  )

Definition at line 358 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()

◆ rtc_hw_init()

static bool rtc_hw_init ( void  )
static

Definition at line 199 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 157 of file rtc.c.

References RTC_AL_SEC, RTC_CON, RTC_CON_EOSC32_LPEN, RTC_CON_XOSC32_LPEN, rtc_info, 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:

◆ rtc_set_capid()

static void rtc_set_capid ( u16  capid)
static

Definition at line 236 of file rtc.c.

References PMIC_RG_DCXO_CW03, rtc_info, rtc_read(), and rtc_write().

Referenced by dcxo_init().

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