![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <commonlib/bsd/bcd.h>
#include <console/console.h>
#include <device/i2c_simple.h>
#include <rtc.h>
#include <stdint.h>
Go to the source code of this file.
Enumerations | |
enum | TPS65913_RTC_REG { TPS65913_SECONDS_REG = 0x00 , TPS65913_MINUTES_REG = 0x01 , TPS65913_HOURS_REG = 0x02 , TPS65913_DAYS_REG = 0x03 , TPS65913_MONTHS_REG = 0x04 , TPS65913_YEARS_REG = 0x05 , TPS65913_WEEKS_REG = 0x06 , TPS65913_RTC_CTRL_REG = 0x10 , TPS65913_RTC_STATUS_REG = 0x11 , TPS65913_RTC_INTERRUPTS_REG = 0x12 } |
enum | { TPS65913_RTC_CTRL_STOP = (1 << 0) , TPS65913_RTC_CTRL_GET_TIME = (1 << 6) , TPS65913_RTC_STATUS_RUN = (1 << 1) , TPS65913_RTC_RUNNING = (1 << 1) , TPS65913_RTC_FROZEN = (0 << 1) } |
Functions | |
static uint8_t | tps65913_read (enum TPS65913_RTC_REG reg) |
static void | tps65913_write (enum TPS65913_RTC_REG reg, uint8_t val) |
static void | tps65913_rtc_ctrl_clear (uint8_t bit) |
static void | tps65913_rtc_ctrl_set (uint8_t bit) |
static int | tps65913_is_rtc_running (void) |
static void | tps65913_rtc_shadow (void) |
static int | tps65913_rtc_stop (void) |
static int | tps65913_rtc_start (void) |
int | rtc_set (const struct rtc_time *time) |
int | rtc_get (struct rtc_time *time) |
anonymous enum |
Enumerator | |
---|---|
TPS65913_RTC_CTRL_STOP | |
TPS65913_RTC_CTRL_GET_TIME | |
TPS65913_RTC_STATUS_RUN | |
TPS65913_RTC_RUNNING | |
TPS65913_RTC_FROZEN |
Definition at line 22 of file tps65913rtc.c.
enum TPS65913_RTC_REG |
Definition at line 9 of file tps65913rtc.c.
int rtc_get | ( | struct rtc_time * | time | ) |
Definition at line 126 of file tps65913rtc.c.
References bcd2bin(), rtc_time::hour, rtc_time::mday, rtc_time::min, rtc_time::mon, rtc_time::sec, TPS65913_DAYS_REG, TPS65913_HOURS_REG, TPS65913_MINUTES_REG, TPS65913_MONTHS_REG, tps65913_read(), tps65913_rtc_shadow(), TPS65913_SECONDS_REG, TPS65913_YEARS_REG, and rtc_time::year.
int rtc_set | ( | const struct rtc_time * | time | ) |
Definition at line 106 of file tps65913rtc.c.
References bin2bcd(), rtc_time::hour, rtc_time::mday, rtc_time::min, rtc_time::mon, rtc_time::sec, TPS65913_DAYS_REG, TPS65913_HOURS_REG, TPS65913_MINUTES_REG, TPS65913_MONTHS_REG, tps65913_rtc_start(), tps65913_rtc_stop(), TPS65913_SECONDS_REG, tps65913_write(), TPS65913_YEARS_REG, and rtc_time::year.
|
static |
Definition at line 61 of file tps65913rtc.c.
References tps65913_read(), TPS65913_RTC_RUNNING, TPS65913_RTC_STATUS_REG, and TPS65913_RTC_STATUS_RUN.
Referenced by tps65913_rtc_start(), and tps65913_rtc_stop().
|
inlinestatic |
Definition at line 31 of file tps65913rtc.c.
References i2c_readb(), and val.
Referenced by rtc_get(), tps65913_is_rtc_running(), tps65913_rtc_ctrl_clear(), and tps65913_rtc_ctrl_set().
Definition at line 45 of file tps65913rtc.c.
References tps65913_read(), TPS65913_RTC_CTRL_REG, and tps65913_write().
Referenced by tps65913_rtc_shadow(), and tps65913_rtc_stop().
Definition at line 53 of file tps65913rtc.c.
References tps65913_read(), TPS65913_RTC_CTRL_GET_TIME, TPS65913_RTC_CTRL_REG, and tps65913_write().
Referenced by tps65913_rtc_shadow(), and tps65913_rtc_start().
Definition at line 74 of file tps65913rtc.c.
References tps65913_rtc_ctrl_clear(), TPS65913_RTC_CTRL_GET_TIME, and tps65913_rtc_ctrl_set().
Referenced by rtc_get().
|
static |
Definition at line 93 of file tps65913rtc.c.
References BIOS_ERR, printk, tps65913_is_rtc_running(), tps65913_rtc_ctrl_set(), and TPS65913_RTC_CTRL_STOP.
Referenced by rtc_set().
|
static |
Definition at line 80 of file tps65913rtc.c.
References BIOS_ERR, printk, tps65913_is_rtc_running(), tps65913_rtc_ctrl_clear(), and TPS65913_RTC_CTRL_STOP.
Referenced by rtc_set().
|
inlinestatic |
Definition at line 39 of file tps65913rtc.c.
References i2c_writeb(), and val.
Referenced by rtc_set(), tps65913_rtc_ctrl_clear(), and tps65913_rtc_ctrl_set().