coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <arch/io.h>
#include <types.h>
Go to the source code of this file.
Macros | |
#define | RTC_BASE_PORT 0x70 |
#define | RTC_PORT(x) (RTC_BASE_PORT + (x)) |
#define | RTC_REG_A 10 |
#define | RTC_REG_B 11 |
#define | RTC_REG_C 12 |
#define | RTC_REG_D 13 |
#define | RTC_FREQ_SELECT RTC_REG_A |
#define | RTC_UIP 0x80 |
#define | RTC_DIV_CTL 0x70 |
#define | RTC_REF_CLCK_4MHZ 0x00 |
#define | RTC_REF_CLCK_1MHZ 0x10 |
#define | RTC_REF_CLCK_32KHZ 0x20 |
#define | RTC_DIV_RESET1 0x60 |
#define | RTC_DIV_RESET2 0x70 |
#define | RTC_RATE_SELECT 0x0F |
#define | RTC_RATE_NONE 0x00 |
#define | RTC_RATE_32786HZ 0x01 |
#define | RTC_RATE_16384HZ 0x02 |
#define | RTC_RATE_8192HZ 0x03 |
#define | RTC_RATE_4096HZ 0x04 |
#define | RTC_RATE_2048HZ 0x05 |
#define | RTC_RATE_1024HZ 0x06 |
#define | RTC_RATE_512HZ 0x07 |
#define | RTC_RATE_256HZ 0x08 |
#define | RTC_RATE_128HZ 0x09 |
#define | RTC_RATE_64HZ 0x0a |
#define | RTC_RATE_32HZ 0x0b |
#define | RTC_RATE_16HZ 0x0c |
#define | RTC_RATE_8HZ 0x0d |
#define | RTC_RATE_4HZ 0x0e |
#define | RTC_RATE_2HZ 0x0f |
#define | RTC_CONTROL RTC_REG_B |
#define | RTC_SET 0x80 /* disable updates for clock setting */ |
#define | RTC_PIE 0x40 /* periodic interrupt enable */ |
#define | RTC_AIE 0x20 /* alarm interrupt enable */ |
#define | RTC_UIE 0x10 /* update-finished interrupt enable */ |
#define | RTC_SQWE 0x08 /* enable square-wave output */ |
#define | RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */ |
#define | RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ |
#define | RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ |
#define | RTC_INTR_FLAGS RTC_REG_C |
#define | RTC_IRQF 0x80 /* any of the following 3 is active */ |
#define | RTC_PF 0x40 |
#define | RTC_AF 0x20 |
#define | RTC_UF 0x10 |
#define | RTC_VALID RTC_REG_D |
#define | RTC_VRT 0x80 /* valid RAM and time */ |
#define | RTC_CLK_SECOND 0 |
#define | RTC_CLK_SECOND_ALARM 1 |
#define | RTC_CLK_MINUTE 2 |
#define | RTC_CLK_MINUTE_ALARM 3 |
#define | RTC_CLK_HOUR 4 |
#define | RTC_CLK_HOUR_ALARM 5 |
#define | RTC_CLK_DAYOFWEEK 6 |
#define | RTC_CLK_DAYOFMONTH 7 |
#define | RTC_CLK_MONTH 8 |
#define | RTC_CLK_YEAR 9 |
#define | RTC_CLK_ALTCENTURY 0x32 |
#define | PC_CKS_RANGE_START 16 |
#define | PC_CKS_RANGE_END 45 |
#define | PC_CKS_LOC 46 |
#define | RTC_BOOT_BYTE 48 |
#define | RTC_BOOT_NORMAL 0x1 |
Functions | |
static unsigned char | cmos_read (unsigned char addr) |
static void | cmos_write_inner (unsigned char val, unsigned char addr) |
static u8 | cmos_disable_rtc (void) |
static void | cmos_restore_rtc (u8 control_state) |
static void | cmos_write (unsigned char val, unsigned char addr) |
static u32 | cmos_read32 (u8 offset) |
static void | cmos_write32 (u32 value, u8 offset) |
void | cmos_init (bool invalid) |
void | cmos_check_update_date (void) |
int | cmos_error (void) |
int | cmos_lb_cks_valid (void) |
int | cmos_checksum_valid (int range_start, int range_end, int cks_loc) |
void | cmos_set_checksum (int range_start, int range_end, int cks_loc) |
#define PC_CKS_LOC 46 |
Definition at line 99 of file mc146818rtc.h.
#define PC_CKS_RANGE_END 45 |
Definition at line 98 of file mc146818rtc.h.
#define PC_CKS_RANGE_START 16 |
Definition at line 97 of file mc146818rtc.h.
#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ |
Definition at line 67 of file mc146818rtc.h.
#define RTC_AF 0x20 |
Definition at line 75 of file mc146818rtc.h.
#define RTC_AIE 0x20 /* alarm interrupt enable */ |
Definition at line 63 of file mc146818rtc.h.
#define RTC_BASE_PORT 0x70 |
Definition at line 9 of file mc146818rtc.h.
#define RTC_BOOT_BYTE 48 |
Definition at line 102 of file mc146818rtc.h.
#define RTC_BOOT_NORMAL 0x1 |
Definition at line 103 of file mc146818rtc.h.
#define RTC_CLK_ALTCENTURY 0x32 |
Definition at line 94 of file mc146818rtc.h.
#define RTC_CLK_DAYOFMONTH 7 |
Definition at line 91 of file mc146818rtc.h.
#define RTC_CLK_DAYOFWEEK 6 |
Definition at line 90 of file mc146818rtc.h.
#define RTC_CLK_HOUR 4 |
Definition at line 88 of file mc146818rtc.h.
#define RTC_CLK_HOUR_ALARM 5 |
Definition at line 89 of file mc146818rtc.h.
#define RTC_CLK_MINUTE 2 |
Definition at line 86 of file mc146818rtc.h.
#define RTC_CLK_MINUTE_ALARM 3 |
Definition at line 87 of file mc146818rtc.h.
#define RTC_CLK_MONTH 8 |
Definition at line 92 of file mc146818rtc.h.
#define RTC_CLK_SECOND 0 |
Definition at line 84 of file mc146818rtc.h.
#define RTC_CLK_SECOND_ALARM 1 |
Definition at line 85 of file mc146818rtc.h.
#define RTC_CLK_YEAR 9 |
Definition at line 93 of file mc146818rtc.h.
#define RTC_CONTROL RTC_REG_B |
Definition at line 60 of file mc146818rtc.h.
#define RTC_DIV_CTL 0x70 |
Definition at line 30 of file mc146818rtc.h.
#define RTC_DIV_RESET1 0x60 |
Definition at line 36 of file mc146818rtc.h.
#define RTC_DIV_RESET2 0x70 |
Definition at line 37 of file mc146818rtc.h.
#define RTC_DM_BINARY 0x04 /* all time/date values are BCD if clear */ |
Definition at line 66 of file mc146818rtc.h.
#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ |
Definition at line 68 of file mc146818rtc.h.
#define RTC_FREQ_SELECT RTC_REG_A |
Definition at line 23 of file mc146818rtc.h.
#define RTC_INTR_FLAGS RTC_REG_C |
Definition at line 71 of file mc146818rtc.h.
#define RTC_IRQF 0x80 /* any of the following 3 is active */ |
Definition at line 73 of file mc146818rtc.h.
#define RTC_PF 0x40 |
Definition at line 74 of file mc146818rtc.h.
#define RTC_PIE 0x40 /* periodic interrupt enable */ |
Definition at line 62 of file mc146818rtc.h.
#define RTC_PORT | ( | x | ) | (RTC_BASE_PORT + (x)) |
Definition at line 11 of file mc146818rtc.h.
#define RTC_RATE_1024HZ 0x06 |
Definition at line 48 of file mc146818rtc.h.
#define RTC_RATE_128HZ 0x09 |
Definition at line 51 of file mc146818rtc.h.
#define RTC_RATE_16384HZ 0x02 |
Definition at line 44 of file mc146818rtc.h.
#define RTC_RATE_16HZ 0x0c |
Definition at line 54 of file mc146818rtc.h.
#define RTC_RATE_2048HZ 0x05 |
Definition at line 47 of file mc146818rtc.h.
#define RTC_RATE_256HZ 0x08 |
Definition at line 50 of file mc146818rtc.h.
#define RTC_RATE_2HZ 0x0f |
Definition at line 57 of file mc146818rtc.h.
#define RTC_RATE_32786HZ 0x01 |
Definition at line 43 of file mc146818rtc.h.
#define RTC_RATE_32HZ 0x0b |
Definition at line 53 of file mc146818rtc.h.
#define RTC_RATE_4096HZ 0x04 |
Definition at line 46 of file mc146818rtc.h.
#define RTC_RATE_4HZ 0x0e |
Definition at line 56 of file mc146818rtc.h.
#define RTC_RATE_512HZ 0x07 |
Definition at line 49 of file mc146818rtc.h.
#define RTC_RATE_64HZ 0x0a |
Definition at line 52 of file mc146818rtc.h.
#define RTC_RATE_8192HZ 0x03 |
Definition at line 45 of file mc146818rtc.h.
#define RTC_RATE_8HZ 0x0d |
Definition at line 55 of file mc146818rtc.h.
#define RTC_RATE_NONE 0x00 |
Definition at line 42 of file mc146818rtc.h.
#define RTC_RATE_SELECT 0x0F |
Definition at line 41 of file mc146818rtc.h.
#define RTC_REF_CLCK_1MHZ 0x10 |
Definition at line 33 of file mc146818rtc.h.
#define RTC_REF_CLCK_32KHZ 0x20 |
Definition at line 34 of file mc146818rtc.h.
#define RTC_REF_CLCK_4MHZ 0x00 |
Definition at line 32 of file mc146818rtc.h.
#define RTC_REG_A 10 |
Definition at line 15 of file mc146818rtc.h.
#define RTC_REG_B 11 |
Definition at line 16 of file mc146818rtc.h.
#define RTC_REG_C 12 |
Definition at line 17 of file mc146818rtc.h.
#define RTC_REG_D 13 |
Definition at line 18 of file mc146818rtc.h.
#define RTC_SET 0x80 /* disable updates for clock setting */ |
Definition at line 61 of file mc146818rtc.h.
#define RTC_SQWE 0x08 /* enable square-wave output */ |
Definition at line 65 of file mc146818rtc.h.
#define RTC_UF 0x10 |
Definition at line 76 of file mc146818rtc.h.
#define RTC_UIE 0x10 /* update-finished interrupt enable */ |
Definition at line 64 of file mc146818rtc.h.
#define RTC_UIP 0x80 |
Definition at line 29 of file mc146818rtc.h.
#define RTC_VALID RTC_REG_D |
Definition at line 79 of file mc146818rtc.h.
#define RTC_VRT 0x80 /* valid RAM and time */ |
Definition at line 80 of file mc146818rtc.h.
Definition at line 192 of file mc146818rtc.c.
References cmos_date_invalid(), cmos_read(), cmos_reset_date(), CONFIG, RTC_CLK_ALTCENTURY, RTC_CLK_YEAR, wait_uip(), and year.
Referenced by lpc_init(), and rtc_init().
int cmos_checksum_valid | ( | int | range_start, |
int | range_end, | ||
int | cks_loc | ||
) |
Definition at line 31 of file mc146818rtc.c.
References cmos_read(), and CONFIG.
Referenced by __cmos_init(), and cmos_lb_cks_valid().
Definition at line 127 of file mc146818rtc.h.
References cmos_read(), cmos_write_inner(), RTC_CONTROL, and RTC_SET.
Referenced by __cmos_init(), cmos_write(), and sanitize_cmos().
int cmos_error | ( | void | ) |
Definition at line 60 of file mc146818rtc.c.
References cmos_read(), RTC_VALID, and RTC_VRT.
Referenced by __cmos_init(), do_normal_boot(), and sanitize_cmos().
Definition at line 156 of file mc146818rtc.c.
References __cmos_init(), cmos_init_vbnv(), CONFIG, and ENV_SMM.
Referenced by i82801dx_rtc_init(), i82801gx_rtc_init(), i82801ix_rtc_init(), i82801jx_rtc_init(), isa_init(), lpc_init(), pch_rtc_init(), rtc_init(), sb_rtc_init(), sc_init(), soc_rtc_init(), and verify_psp_transfer_buf().
int cmos_lb_cks_valid | ( | void | ) |
Definition at line 194 of file option.c.
References cmos_checksum_valid().
Referenced by __cmos_init(), do_normal_boot(), and sanitize_cmos().
Definition at line 105 of file mc146818rtc.h.
References addr, inb(), outb(), and RTC_BASE_PORT.
Referenced by __cmos_init(), boot_count_cmos_read(), check_cmos_recovery(), cmos_check_update_date(), cmos_checksum_valid(), cmos_disable_rtc(), cmos_error(), cmos_post_code(), cmos_post_extra(), cmos_post_init(), cmos_post_previous_boot(), cmos_read32(), cmos_set_checksum(), do_normal_boot(), get_cmos_value(), mainboard_should_reset_usb(), prepare_mrc_cache(), read_training_restore_results(), read_vbnv_cmos(), rtc_get(), sdram_recover_receive_enable(), set_cmos_mrc_cold_boot_flag(), vbnv_cmos_failed(), verify_psp_transfer_buf(), wait_uip(), and write_training_restore_results().
Definition at line 157 of file mc146818rtc.h.
References cmos_read(), offset, and value.
Referenced by cmos_post_previous_boot(), and prepare_mrc_cache().
Definition at line 135 of file mc146818rtc.h.
References cmos_write_inner(), RTC_CONTROL, and RTC_SET.
Referenced by cmos_write(), and sanitize_cmos().
void cmos_set_checksum | ( | int | range_start, |
int | range_end, | ||
int | cks_loc | ||
) |
Definition at line 47 of file mc146818rtc.c.
References cmos_read(), and cmos_write().
Referenced by __cmos_init().
Definition at line 141 of file mc146818rtc.h.
References addr, cmos_disable_rtc(), cmos_restore_rtc(), cmos_write_inner(), RTC_CONTROL, and val.
Referenced by __cmos_init(), boot_count_cmos_write(), check_cmos_recovery(), cmos_post_code(), cmos_post_init(), cmos_set_checksum(), cmos_write32(), do_normal_boot(), mainboard_should_reset_usb(), read_training_store_results(), rtc_set(), save_mrc_data(), save_vbnv_cmos(), sdram_save_receive_enable(), set_cmos_mrc_cold_boot_flag(), verify_psp_transfer_buf(), and write_training_store_results().
Definition at line 166 of file mc146818rtc.h.
References cmos_write(), offset, and value.
Referenced by cmos_post_extra(), cmos_post_init(), and save_mrc_data().
Definition at line 116 of file mc146818rtc.h.
References addr, outb(), RTC_BASE_PORT, and val.
Referenced by cmos_disable_rtc(), cmos_restore_rtc(), cmos_write(), and sanitize_cmos().