Skip to contentSkip to conversation

RTC:driver for Cortina's SOC

PATCH Superseded Hans Ulli Kroll 4 participants 8 messages May 11, 2015 – May 13, 2015 Real time clock (RTC)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 RTC:driver for Cortina's SOC

this patch add's the RTC found on Gemini SoC.

changes
v2
- usage of readl/write
- spacing around *
- line wrapping aligned to open parenthesis
- add driver file to MAINTAINERS

Ulli

From: Hans Ulli Kroll <[email protected]>
Subject: [PATCHv2] RTC:driver for Cortina's SOC
In-Reply-To:

#1 lore raw

PATCH v2 1/1 RTC:driver for Cortina's SOC

Driver for the on chip RTC found on Cortina's SoC Gemini.

---
 MAINTAINERS              |   1 +
 drivers/rtc/Kconfig      |   9 +++
 drivers/rtc/Makefile     |   1 +
 drivers/rtc/rtc-gemini.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 202 insertions(+)
 create mode 100644 drivers/rtc/rtc-gemini.c
MAINTAINERS +1 -0
index c2781eb..2e91f68 100644
@@ -978,6 +978,7 @@ L:	[email protected] (moderated for non-subscribers)
 T:	git git://github.com/ulli-kroll/linux.git
 S:	Maintained
 F:	arch/arm/mach-gemini/
+F:	drivers/rtc/rtc-gemini.c
 
 ARM/CSR SIRFPRIMA2 MACHINE SUPPORT
 M:	Barry Song <[email protected]>
drivers/rtc/Kconfig +9 -0
index 6149ae0..c6ea9aa 100644
@@ -1362,6 +1362,15 @@ config RTC_DRV_ARMADA38X
 	  This driver can also be built as a module. If so, the module
 	  will be called armada38x-rtc.
 
+config RTC_DRV_GEMINI
+	tristate "Gemini SoC RTC"
+	help
+	  If you say Y here you will get support for the
+	  RTC found on Gemini SoC's.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-gemini.
+
 config RTC_DRV_PS3
 	tristate "PS3 RTC"
 	depends on PPC_PS3
drivers/rtc/Makefile +1 -0
index c31731c..0fd6e22 100644
@@ -64,6 +64,7 @@ obj-$(CONFIG_RTC_DRV_EFI)	+= rtc-efi.o
 obj-$(CONFIG_RTC_DRV_EM3027)	+= rtc-em3027.o
 obj-$(CONFIG_RTC_DRV_EP93XX)	+= rtc-ep93xx.o
 obj-$(CONFIG_RTC_DRV_FM3130)	+= rtc-fm3130.o
+obj-$(CONFIG_RTC_DRV_GEMINI)	+= rtc-gemini.o
 obj-$(CONFIG_RTC_DRV_GENERIC)	+= rtc-generic.o
 obj-$(CONFIG_RTC_DRV_HID_SENSOR_TIME) += rtc-hid-sensor-time.o
 obj-$(CONFIG_RTC_DRV_HYM8563)	+= rtc-hym8563.o
drivers/rtc/rtc-gemini.c new file +191 -0

191 lines not on this page · raw message

Signature · 1 line
2.3.5
#2 lore raw

drivers/rtc/Kconfig config RTC_DRV_ARMADA38X · line 1372

Quoted 11 lines · Hans Ulli Kroll
drivers/rtc/Kconfig +8 -0
 
+config RTC_DRV_GEMINI
+	tristate "Gemini SoC RTC"
+	help
+	  If you say Y here you will get support for the
+	  RTC found on Gemini SoC's.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called rtc-gemini.

This has, by the look of it, very little dependencies, probably just RTC_CLASS. So I think that this symbol can be enabled in allyesconfig, allmodconfig, and randconfig for most architectures. (I just tested this
- what a novel idea! - and it will indeed be set by allyesconfig and allmodconfig on x86_64.)

drivers/rtc/rtc-gemini.c

Quoted 4 lines
drivers/rtc/rtc-gemini.c new file +1 -0
 
+#include <mach/hardware.h>

Except for arm, builds using a .config containing
CONFIG_RTC_DRV_GEMINI=[my]

will fail here. (*/mach/hardware.h is mainly used for arm.) That is bound to generate, well, fanmail for you. Perhaps it's better if RTC_DRV_GEMINI depends on, say, ARCH_GEMINI.

Paul Bolle

#3 lore raw
Quoted 22 lines · On Tuesday 12 May 2015 11:05:34 Paul Bolle wrote:

drivers/rtc/Kconfig config RTC_DRV_ARMADA38X · line 1372

Quoted 11 lines · Hans Ulli Kroll
drivers/rtc/Kconfig +8 -0
 
+config RTC_DRV_GEMINI
+     tristate "Gemini SoC RTC"
+     help
+       If you say Y here you will get support for the
+       RTC found on Gemini SoC's.
+
+       This driver can also be built as a module. If so, the module
+       will be called rtc-gemini.

This has, by the look of it, very little dependencies, probably just RTC_CLASS. So I think that this symbol can be enabled in allyesconfig, allmodconfig, and randconfig for most architectures. (I just tested this
- what a novel idea! - and it will indeed be set by allyesconfig and allmodconfig on x86_64.)

Quoted 2 lines
drivers/rtc/rtc-gemini.c new file +0 -0
Quoted 8 lines
Quoted 1 line

+#include <mach/hardware.h>

Except for arm, builds using a .config containing
CONFIG_RTC_DRV_GEMINI=[my]

will fail here. (*/mach/hardware.h is mainly used for arm.) That is bound to generate, well, fanmail for you. Perhaps it's better if RTC_DRV_GEMINI depends on, say, ARCH_GEMINI.

Well spotted, thanks for the report.

I have a patch that will turn mach-gemini into multiplatform, and at that point it will also fail there. The correct solution I think is to move the GEMINI_RTC_SECOND etc definitions into rtc-gemini.c itself and remove the #include.

It still makes sense to have a dependency, but I'd express it as

	depends on ARCH_GEMINI || COMPILE_TEST

in order to let the driver get compiled for an allyesconfig kernel on all architectures, but not appear as an option for normal builds that do not set COMPILE_TEST.

Arnd

#4 lore raw
Quoted 32 lines · Arnd Bergmann
Quoted 22 lines · On Tuesday 12 May 2015 11:05:34 Paul Bolle wrote:

drivers/rtc/Kconfig config RTC_DRV_ARMADA38X · line 1372

Quoted 11 lines · Hans Ulli Kroll
drivers/rtc/Kconfig +8 -0
 
+config RTC_DRV_GEMINI
+     tristate "Gemini SoC RTC"
+     help
+       If you say Y here you will get support for the
+       RTC found on Gemini SoC's.
+
+       This driver can also be built as a module. If so, the module
+       will be called rtc-gemini.

This has, by the look of it, very little dependencies, probably just RTC_CLASS. So I think that this symbol can be enabled in allyesconfig, allmodconfig, and randconfig for most architectures. (I just tested this
- what a novel idea! - and it will indeed be set by allyesconfig and allmodconfig on x86_64.)

Quoted 2 lines
drivers/rtc/rtc-gemini.c new file +0 -0
Quoted 8 lines
Quoted 1 line

+#include <mach/hardware.h>

Except for arm, builds using a .config containing
CONFIG_RTC_DRV_GEMINI=[my]

will fail here. (*/mach/hardware.h is mainly used for arm.) That is bound to generate, well, fanmail for you. Perhaps it's better if RTC_DRV_GEMINI depends on, say, ARCH_GEMINI.

Quoted 7 lines

Well spotted, thanks for the report.

I have a patch that will turn mach-gemini into multiplatform, and at that point it will also fail there. The correct solution I think is to move the GEMINI_RTC_SECOND etc definitions into rtc-gemini.c itself and remove the #include.

GEMINI_RTC_SECOND and other register offset are in the driver. The only address I get from the #include is the base address of the RTC

Quoted 5 lines

It still makes sense to have a dependency, but I'd express it as

	depends on ARCH_GEMINI || COMPILE_TEST

Is done in series three. Without COMPILE_TEST
Hmm I missied someone to send ...

Ulli

#5 lore raw
Quoted 9 lines · On Wednesday 13 May 2015 20:23:40 Hans Ulli Kroll wrote:
Quoted 5 lines

I have a patch that will turn mach-gemini into multiplatform, and at that point it will also fail there. The correct solution I think is to move the GEMINI_RTC_SECOND etc definitions into rtc-gemini.c itself and remove the #include.

GEMINI_RTC_SECOND and other register offset are in the driver. The only address I get from the #include is the base address of the RTC

Ah, I see. Please pass a struct resource for this then when you call platform_device_register_simple from the platform code, and use platform_get_resource/devm_ioremap_resource to map it so you can remove that inclusion.

Arnd

#6 lore raw
Quoted 11 lines · On Wednesday 13 May 2015 21:03:29 Arnd Bergmann wrote:

From: Arnd Bergmann <[email protected]>
To: Hans Ulli Kroll <[email protected]>
CC: Paul Bolle <[email protected]>, Alexandre Belloni <[email protected]>, [email protected]
Date: Today 21:03:29

Quoted 6 lines · On Wednesday 13 May 2015 20:23:40 Hans Ulli Kroll wrote:
Quoted 5 lines

I have a patch that will turn mach-gemini into multiplatform, and at that point it will also fail there. The correct solution I think is to move the GEMINI_RTC_SECOND etc definitions into rtc-gemini.c itself and remove the #include.

Quoted 8 lines
Quoted 3 lines

GEMINI_RTC_SECOND and other register offset are in the driver. The only address I get from the #include is the base address of the RTC

Ah, I see. Please pass a struct resource for this then when you call platform_device_register_simple from the platform code, and use platform_get_resource/devm_ioremap_resource to map it so you can remove that inclusion.

I just saw that you already do this, so the #include should not be needed at all.

Arnd

#7 lore raw
In reply to Hans Ulli Kroll

Hi,

Quoted 6 lines · Hans Ulli Kroll

this patch add's the RTC found on Gemini SoC.

changes
v2
- usage of readl/write
- spacing around *

I don't see that one being fixed

Quoted 1 line

- line wrapping aligned to open parenthesis

There is still one near the request_irq.

Quoted 2 lines

- add driver file to MAINTAINERS

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com