rtc: add support for DS3232 device
PATCH 1/1 rtc: add support for DS3232 device
DS3232 is an i2c RTC with 236 bytes of battery-backed SRAM.
Add an RTC driver for DS3232 device, which provides time and date support. Also read and write functions are provided, which can be used to access the SRAM memory.
---
Notes:
Description
----------
Add support for RTC DS3232 device.
Testing
------
1. Check that date/time can be reset: PASS
U-Boot> date reset
Reset RTC...
Date: 2000-01-01 (Saturday) Time: 0:00:00
2. Check that setting the date/time is successful: PASS
U-Boot> date 040114012019.00
Date: 2019-04-01 (Monday) Time: 14:01:00
3. Check that getting the date/time is successful: PASS
U-Boot> date
Date: 2019-04-01 (Monday) Time: 14:01:58
4. Verify that the date configured in U-Boot is the same read in Kernel.
doc/device-tree-bindings/rtc/ds3232.txt | 15 ++ drivers/rtc/Kconfig | 8 + drivers/rtc/Makefile | 1 + drivers/rtc/ds3232.c | 274 ++++++++++++++++++++++++ 4 files changed, 298 insertions(+) create mode 100644 doc/device-tree-bindings/rtc/ds3232.txt create mode 100644 drivers/rtc/ds3232.c
doc/device-tree-bindings/rtc/ds3232.txt new file +15 -0
@@ -0,0 +1,15 @@ +DS3232 Real-Time Clock with SRAM + +The RTC driver provides time and date functionality. Also read and write +functions are provided that can be used to access the SRAM memory. + +Required properties: +- compatible : should contain "dallas,ds3232" +- reg : the I2C RTC address + +Example: + +rtc at 68 { + compatible = "dallas,ds3232"; + reg = <0x68>; +};
drivers/rtc/Kconfig +8 -0
@@ -54,6 +54,14 @@ config RTC_DS1307 Support for Dallas Semiconductor (now Maxim) DS1307 and DS1338/9 and compatible Real Time Clock devices. +config RTC_DS3232 + bool "Enable DS3232 driver" + depends on DM_RTC + depends on DM_I2C + help + Support for Dallas Semiconductor (now Maxim) DS3232 compatible + Real Time Clock devices. + config RTC_ISL1208 bool "Enable ISL1208 driver" depends on DM_RTC
drivers/rtc/Makefile +1 -0
@@ -22,6 +22,7 @@ obj-$(CONFIG_RTC_DS1556) += ds1556.o obj-$(CONFIG_RTC_DS164x) += ds164x.o obj-$(CONFIG_RTC_DS174x) += ds174x.o obj-$(CONFIG_RTC_DS3231) += ds3231.o +obj-$(CONFIG_RTC_DS3232) += ds3232.o obj-$(CONFIG_RTC_FTRTC010) += ftrtc010.o obj-$(CONFIG_SANDBOX) += i2c_rtc_emul.o obj-$(CONFIG_RTC_IMXDI) += imxdi.o
drivers/rtc/ds3232.c new file +274 -0
274 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH 1/1 rtc: add support for DS3232 device
Quoted 7 lines · Han Nandor
DS3232 is an i2c RTC with 236 bytes of battery-backed SRAM.
Add an RTC driver for DS3232 device, which provides time and date support. Also read and write functions are provided, which can be used to access the SRAM memory.
Signed-off-by Nandor Han <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200110/f34240f9/attachment.sig>