rtc: microchip: Add driver for PolarFire SoC
Subsystems (3)
Conor Dooley
maintainerv4 cover rtc: microchip: Add driver for PolarFire SoC
Hey all,
This is technically a v4 of [0], although a fair bit of time has passed since then. In the meantime I upstreamed the dt-binding, which was in the v1, and this patch depends on the fixes to the dt-binding and device tree etc which landed in v5.18-rc5.
The driver is quite substantially rewritten from the v1, as you wanted it to be switched to "binary" rather than calendar mode - so hopefully I have satisfied your concerns with the original driver. Specifically you had an significant issue with the counter being reset on startup & that is no longer the case.
Thanks,
Conor.
Changes since v3:
- invert read order of datetime registers so that they are properly aligned. reads of the upper register are aligned to the last read of the lower register
- move wakeup_irq out of mpfs_rtc_dev & into probe
- removed range_min since it is not set & implicity zero anyway
- rewrote the remove function to not call mpfs_rtc_alarm_irq_enable(,0)
Changes from v2:
- move prescaler out of mpfs_rtc_dev & into probe
Changes from v1:
- remove duplicate and unused defines
- remove oneline mpfs_rtc_set_prescaler function
- dont unconditionally turn off the rtc in the init function
- dont reset the rtc when init is run.
- dont disable the alarm when we boot
- use binary, not calendar mode
- delete mpfs_rtc_init & set prescale in probe
- use dev_pm_set_wake_irq rather than writing suspend/resume functions
- delete calendar mode only register defines
- since using binary mode, set range min to zero
- set range max to max alarm value (is this acceptable?)
- added a MAINTAINERS entry: when v1 was submitted there was nothing to add to, but there is now.
[0] https://lore.kernel.org/linux-rtc/[email protected]/
Conor Dooley (2):
rtc: Add driver for Microchip PolarFire SoC
MAINTAINERS: add PolarFire SoC's RTC
MAINTAINERS | 1 + drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-mpfs.c | 326 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 338 insertions(+) create mode 100644 drivers/rtc/rtc-mpfs.c
base-commit: c5eb0a61238dd6faf37f58c9ce61c9980aaffd7a
Signature · 1 line
2.36.1
Conor Dooley
maintainerPATCH v4 1/2 rtc: Add driver for Microchip PolarFire SoC
Add support for the built-in RTC on Microchip PolarFire SoC
--- drivers/rtc/Kconfig | 10 ++ drivers/rtc/Makefile | 1 + drivers/rtc/rtc-mpfs.c | 326 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 337 insertions(+) create mode 100644 drivers/rtc/rtc-mpfs.c
drivers/rtc/Kconfig +10 -0
@@ -1966,4 +1966,14 @@ config RTC_DRV_MSC313 This driver can also be built as a module, if so, the module will be called "rtc-msc313". +config RTC_DRV_POLARFIRE_SOC + tristate "Microchip PolarFire SoC built-in RTC" + depends on SOC_MICROCHIP_POLARFIRE + help + If you say yes here you will get support for the + built-in RTC on Polarfire SoC. + + This driver can also be built as a module, if so, the module + will be called "rtc-mpfs". + endif # RTC_CLASS
drivers/rtc/Makefile +1 -0
@@ -130,6 +130,7 @@ obj-$(CONFIG_RTC_DRV_PIC32) += rtc-pic32.o obj-$(CONFIG_RTC_DRV_PL030) += rtc-pl030.o obj-$(CONFIG_RTC_DRV_PL031) += rtc-pl031.o obj-$(CONFIG_RTC_DRV_PM8XXX) += rtc-pm8xxx.o +obj-$(CONFIG_RTC_DRV_POLARFIRE_SOC) += rtc-mpfs.o obj-$(CONFIG_RTC_DRV_PS3) += rtc-ps3.o obj-$(CONFIG_RTC_DRV_PXA) += rtc-pxa.o obj-$(CONFIG_RTC_DRV_R7301) += rtc-r7301.o
drivers/rtc/rtc-mpfs.c new file +326 -0
326 lines not on this page · raw message
Signature · 1 line
2.36.1
Conor Dooley
maintainerPATCH v4 2/2 MAINTAINERS: add PolarFire SoC's RTC
In reply to Conor DooleyAdd an entry for PolarFire SoC's RTC drver to the existing support for PolarFire SoC.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -16952,6 +16952,7 @@ L: [email protected] S: Supported F: arch/riscv/boot/dts/microchip/ F: drivers/mailbox/mailbox-mpfs.c +F: drivers/rtc/rtc-mpfs.c F: drivers/soc/microchip/ F: include/soc/microchip/mpfs.h
Signature · 1 line
2.36.1