second round of rtc
This is the second RFC for the RTC support. I have gone through and applied most of the suggested cleanups and done a bit more tidying.
The driver has a couple of extra debug prints, and also has a fixed rtc register write code (wrong order) so that it can now set a time from hwclock.
This has been tested on the an ODroid-C1 with battery connected to it.
RFC v2 1/4 rtc: support for amlogic meson rtc
Add support for the AMLogic meson8b/meson6 RTC block.
--- drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-meson.c | 345 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 356 insertions(+) create mode 100644 drivers/rtc/rtc-meson.c
drivers/rtc/Kconfig +10 -0
@@ -1222,6 +1222,16 @@ config RTC_DRV_IMXDI This driver can also be built as a module, if so, the module will be called "rtc-imxdi". +config RTC_DRV_MESON + tristate "AMLogic Meson Real Time Clock" + depends on ARCH_MESON || COMPILE_TEST + help + Support for AMLogic Meson RTC block + + This driver can also be built as a module, if so, the module + will be called "rtc-meson". + + config RTC_DRV_OMAP tristate "TI OMAP Real Time Clock" depends on ARCH_OMAP || ARCH_DAVINCI || COMPILE_TEST
drivers/rtc/Makefile +1 -0
@@ -93,6 +93,7 @@ obj-$(CONFIG_RTC_DRV_MAX8997) += rtc-max8997.o obj-$(CONFIG_RTC_DRV_MAX8998) += rtc-max8998.o obj-$(CONFIG_RTC_DRV_MC13XXX) += rtc-mc13xxx.o obj-$(CONFIG_RTC_DRV_MCP795) += rtc-mcp795.o +obj-$(CONFIG_RTC_DRV_MESON) += rtc-meson.o obj-$(CONFIG_RTC_DRV_MOXART) += rtc-moxart.o obj-$(CONFIG_RTC_DRV_MPC5121) += rtc-mpc5121.o obj-$(CONFIG_RTC_DRV_VRTC) += rtc-mrst.o
drivers/rtc/rtc-meson.c new file +345 -0
345 lines not on this page · raw message
Signature · 1 line
2.8.1
RFC v2 2/4 meson-rtc: add device-tree binding
In reply to Ben DooksAdd documentation for the AMLogic Meson RTC.
--- .../devicetree/bindings/rtc/rtc-amlogic.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-amlogic.txt
Documentation/devicetree/bindings/rtc/rtc-amlogic.txt new file +21 -0
@@ -0,0 +1,21 @@ +* AMlogic Meson RTC + +Required properties: +- compatible: should be one of the following describing the hardware: + * "amlogic,meson6-rtc" + * "amlogic,meson8-rtc" + * "amlogic,meson8b-rtc" + +- reg: physical register space for the controller's memory mapped registers. + +Optional properties: +- resets: reset controller reference to allow reset of the controller +- interrupts: single interrupt reference if interrupt support needed + +Example: + + rtc: rtc at c8100740 { + compatible = "amlogic,meson6-rtc"; + reg = <0xc8100740 0x14>; + status = "disabled"; + };
Signature · 1 line
2.8.1
RFC v2 3/4 ARM: dts: amlogic: add rtc node for meson8b
In reply to Ben DooksAdd the DT node for the RTC support.
--- arch/arm/boot/dts/meson8b.dtsi | 7 +++++++ 1 file changed, 7 insertions(+)
arch/arm/boot/dts/meson8b.dtsi +7 -0
@@ -156,6 +156,13 @@ status = "disabled"; }; + rtc: rtc at c8100740 { + compatible = "amlogic,meson8b-rtc"; + reg = <0xc8100740 0x14>; + resets = <&reset RESET_RTC>; + status = "disabled"; + }; + clkc: clock-controller at c1104000 { #clock-cells = <1>; compatible = "amlogic,meson8b-clkc";
Signature · 1 line
2.8.1
RFC v2 4/4 ARM: meson: enable RTC for ODRoid-C1
In reply to Ben DooksNow the RTC node has been added, enable it on the ODroid-C1 board.
--- arch/arm/boot/dts/meson8b-odroidc1.dts | 5 +++++ 1 file changed, 5 insertions(+)
arch/arm/boot/dts/meson8b-odroidc1.dts +5 -0
@@ -85,3 +85,8 @@ pinctrl-0 = <&uart_ao_a_pins>; pinctrl-names = "default"; }; + +&rtc { + status = "okay"; +}; +
Signature · 1 line
2.8.1