x86: rtc: mc146818: Add helpers to read/write CMOS RAM
On x86 we use CMOS RAM to read and write some settings. Add basic support for this, including access to registers 128-255. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -50,6 +50,38 @@ void to_tm (int, struct rtc_time *);
|
||||
unsigned long mktime (unsigned int, unsigned int, unsigned int,
|
||||
unsigned int, unsigned int, unsigned int);
|
||||
|
||||
/**
|
||||
* rtc_read8() - Read an 8-bit register
|
||||
*
|
||||
* @reg: Register to read
|
||||
* @return value read
|
||||
*/
|
||||
int rtc_read8(int reg);
|
||||
|
||||
/**
|
||||
* rtc_write8() - Write an 8-bit register
|
||||
*
|
||||
* @reg: Register to write
|
||||
* @value: Value to write
|
||||
*/
|
||||
void rtc_write8(int reg, uchar val);
|
||||
|
||||
/**
|
||||
* rtc_read32() - Read a 32-bit value from the RTC
|
||||
*
|
||||
* @reg: Offset to start reading from
|
||||
* @return value read
|
||||
*/
|
||||
u32 rtc_read32(int reg);
|
||||
|
||||
/**
|
||||
* rtc_write32() - Write a 32-bit value to the RTC
|
||||
*
|
||||
* @reg: Register to start writing to
|
||||
* @value: Value to write
|
||||
*/
|
||||
void rtc_write32(int reg, u32 value);
|
||||
|
||||
/**
|
||||
* rtc_init() - Set up the real time clock ready for use
|
||||
*/
|
||||
|
Reference in New Issue
Block a user