rtc: Add ASPEED RTC driver
Joel Stanley
maintainerv3 cover rtc: Add ASPEED RTC driver
v3: Remove unnecessary locking, use ptR
v2: Address review from Alexandre
Joel Stanley (2):
dt-bindings: rtc: Add on-chip ASPEED RTC documentation
rtc: Add ASPEED RTC driver
.../devicetree/bindings/rtc/rtc-aspeed.txt | 22 +++ drivers/rtc/Kconfig | 11 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-aspeed.c | 138 ++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-aspeed.txt create mode 100644 drivers/rtc/rtc-aspeed.c
Signature · 1 line
2.20.1
Joel Stanley
maintainerPATCH v3 1/2 dt-bindings: rtc: Add on-chip ASPEED RTC documentation
Describe the RTC as used in the ASPEED BMC SoCs.
---
v3: Add interrupts property
--- .../devicetree/bindings/rtc/rtc-aspeed.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-aspeed.txt
Documentation/devicetree/bindings/rtc/rtc-aspeed.txt new file +22 -0
@@ -0,0 +1,22 @@ +ASPEED BMC RTC +============== + +Required properties: + - compatible: should be one of the following + * aspeed,ast2400-rtc for the ast2400 + * aspeed,ast2500-rtc for the ast2500 + * aspeed,ast2600-rtc for the ast2600 + + - reg: physical base address of the controller and length of memory mapped + region + + - interrupts: The interrupt number + +Example: + + rtc at 1e781000 { + compatible = "aspeed,ast2400-rtc"; + reg = <0x1e781000 0x18>; + interrupts = <22>; + status = "disabled"; + };
Signature · 1 line
2.20.1
Re: [PATCH v3 1/2] dt-bindings: rtc: Add on-chip ASPEED RTC documentation
Quoted 10 lines · Joel Stanley
Describe the RTC as used in the ASPEED BMC SoCs.
Signed-off-by Joel Stanley <[email protected]>---
v3: Add interrupts property--- .../devicetree/bindings/rtc/rtc-aspeed.txt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/rtc-aspeed.txt
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Joel Stanley
maintainerPATCH v3 2/2 rtc: Add ASPEED RTC driver
In reply to Joel StanleyRead and writes the time to the non-battery backed RTC in the ASPEED BMC system on chip families.
---
v3:
- Use %ptR
- Remove spinlock, as callback happen under the rtc_device.ops_lock
v2: Address review from Alexandre
- Use devm_rtc_allocate_device
- Fill in range_min
- Direcly fill in tm struct
- Return EINVAL when RTC is not enabled
v1: https://lore.kernel.org/linux-arm-kernel/20181003133155.27494-2-joel at jms.id.au/
Update kconfig text
--- drivers/rtc/Kconfig | 11 ++++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-aspeed.c | 138 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 drivers/rtc/rtc-aspeed.c
drivers/rtc/Kconfig +11 -0
@@ -1841,6 +1841,17 @@ config RTC_DRV_RTD119X If you say yes here, you get support for the RTD1295 SoC Real Time Clock. +config RTC_DRV_ASPEED + tristate "ASPEED RTC" + depends on OF + depends on ARCH_ASPEED || COMPILE_TEST + help + If you say yes here you get support for the ASPEED BMC SoC real time + clocks. + + This driver can also be built as a module, if so, the module + will be called "rtc-aspeed". + comment "HID Sensor RTC drivers" config RTC_DRV_HID_SENSOR_TIME
drivers/rtc/Makefile +1 -0
@@ -34,6 +34,7 @@ obj-$(CONFIG_RTC_DRV_AC100) += rtc-ac100.o obj-$(CONFIG_RTC_DRV_ARMADA38X) += rtc-armada38x.o obj-$(CONFIG_RTC_DRV_AS3722) += rtc-as3722.o obj-$(CONFIG_RTC_DRV_ASM9260) += rtc-asm9260.o +obj-$(CONFIG_RTC_DRV_ASPEED) += rtc-aspeed.o obj-$(CONFIG_RTC_DRV_AT91RM9200)+= rtc-at91rm9200.o obj-$(CONFIG_RTC_DRV_AT91SAM9) += rtc-at91sam9.o obj-$(CONFIG_RTC_DRV_AU1XXX) += rtc-au1xxx.o
drivers/rtc/rtc-aspeed.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.20.1
Quoted 18 lines · Joel Stanley
Read and writes the time to the non-battery backed RTC in the ASPEED BMC system on chip families.
Signed-off-by Joel Stanley <[email protected]>---
v3:
- Use %ptR
- Remove spinlock, as callback happen under the rtc_device.ops_lock
v2: Address review from Alexandre
- Usedevm_rtc_allocate_device
- Fill inrange_min
- Direcly fill in tm struct
- Return EINVAL when RTC is not enabledv1: https://lore.kernel.org/linux-arm-kernel/20181003133155.27494-2-joel at jms.id.au/
Update kconfig text
Quoted 8 lines
Signed-off-by Joel Stanley <[email protected]>--- drivers/rtc/Kconfig | 11 ++++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-aspeed.c | 138 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 drivers/rtc/rtc-aspeed.c
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com