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

Go to the source code of this file.

Functions

void rtc_read (u16 addr, u16 *rdata)
 
void rtc_write (u16 addr, u16 wdata)
 
static void rtc_write_field (u16 reg, u16 val, u16 mask, u16 shift)
 
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)
 
void rtc_boot (void)
 

Variables

static struct pmifpmif_arb = NULL
 

Function Documentation

◆ poweroff()

void poweroff ( void  )

Definition at line 301 of file rtc_mt6359p.c.

References halt(), PMIC_PWRHOLD, RTC_BBPU, RTC_BBPU_ENABLE_ALARM, RTC_BBPU_KEY, rtc_info, rtc_write(), rtc_write_field(), and rtc_writeif_unlock().

Here is the call graph for this function:

◆ rtc_bbpu_power_on()

void rtc_bbpu_power_on ( void  )

Definition at line 286 of file rtc_mt6359p.c.

References PMIC_PWRHOLD, RTC_BBPU, RTC_BBPU_ENABLE_ALARM, RTC_BBPU_KEY, rtc_info, rtc_read(), rtc_write(), rtc_write_field(), 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 315 of file rtc_mt6359p.c.

References PMIC_RG_DCXO_CW02, PMIC_RG_SCK_TOP_CON0, rtc_bbpu_power_on(), rtc_boot_common(), rtc_enable_dcxo(), rtc_info, rtc_read(), and rtc_write_field().

Referenced by platform_romstage_main().

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

◆ rtc_enable_dcxo()

static bool rtc_enable_dcxo ( void  )
static

Definition at line 43 of file rtc_mt6359p.c.

References OSC32CON_ANALOG_SETTING, RTC_AL_SEC, RTC_BBPU, RTC_BBPU_KEY, RTC_BBPU_RELOAD, RTC_CON, RTC_EMBCK_SEL_MODE_MASK, RTC_EMBCK_SRC_SEL, rtc_info, RTC_OSC32CON, rtc_read(), RTC_REG_XOSC32_ENB, rtc_write(), rtc_write_trigger(), rtc_writeif_unlock(), and rtc_xosc_write().

Referenced by rtc_boot().

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

◆ rtc_get_frequency_meter()

◆ rtc_gpio_init()

bool rtc_gpio_init ( void  )

Definition at line 71 of file rtc_mt6359p.c.

References RTC_CON, RTC_CON_EOSC32_LPEN, RTC_CON_F32KOB, RTC_CON_GOE, RTC_CON_GPEN, RTC_CON_GPU, RTC_CON_LPRST, RTC_CON_LPSTA_RAW, RTC_CON_XOSC32_LPEN, rtc_read(), rtc_write(), and rtc_write_trigger().

Referenced by rtc_init(), and rtc_osc_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 196 of file rtc_mt6359p.c.

References RTC_BBPU, RTC_BBPU_KEY, RTC_BBPU_RELOAD, RTC_BBPU_RESET_ALARM, RTC_BBPU_RESET_SPAR, RTC_BBPU_SPAR_SW, 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 164 of file rtc_mt6359p.c.

References RTC_AL_SEC, RTC_CON, RTC_CON_EOSC32_LPEN, RTC_CON_XOSC32_LPEN, rtc_info, RTC_LPD_OPT_F32K_CK_ALIVE, 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_read()

◆ rtc_write()

◆ rtc_write_field()

static void rtc_write_field ( u16  reg,
u16  val,
u16  mask,
u16  shift 
)
static

Definition at line 32 of file rtc_mt6359p.c.

References mask, rtc_read(), rtc_write(), and val.

Referenced by poweroff(), rtc_bbpu_power_on(), rtc_boot(), and rtc_get_frequency_meter().

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

Variable Documentation

◆ pmif_arb

struct pmif* pmif_arb = NULL
static

Definition at line 12 of file rtc_mt6359p.c.

Referenced by rtc_read(), and rtc_write().