summaryrefslogtreecommitdiff
path: root/include/rtc.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-01-19 22:16:10 -0700
committerSimon Glass <sjg@chromium.org>2015-01-24 06:13:44 -0700
commitfc4860c089a6b6603e1ae4f9c1f8bd1b3aadfc8b (patch)
tree7db356c7510493cb716dd2c33f2a3a181a35f563 /include/rtc.h
parentb18c68d8918095672b295aef7bfbfc466b82c710 (diff)
downloadu-boot-imx-fc4860c089a6b6603e1ae4f9c1f8bd1b3aadfc8b.zip
u-boot-imx-fc4860c089a6b6603e1ae4f9c1f8bd1b3aadfc8b.tar.gz
u-boot-imx-fc4860c089a6b6603e1ae4f9c1f8bd1b3aadfc8b.tar.bz2
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>
Diffstat (limited to 'include/rtc.h')
-rw-r--r--include/rtc.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/rtc.h b/include/rtc.h
index d11aa8b..54e361e 100644
--- a/include/rtc.h
+++ b/include/rtc.h
@@ -51,6 +51,38 @@ 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
*/
void rtc_init(void);