All of lore.kernel.org
 help / color / mirror / Atom feed
* [rtc-linux] [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1
@ 2017-03-16 17:51 ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Basically, the same RTC that was used in SuperH devices is now used in
RZ/A1 devices. Therefore with some slight changes, that driver can be
reused.

Additionally, since ARM architectures require Device Tree configurations,
device tree support has been added.

This was tested on RZ/A1H RSK board. Once the correct time was programmed
into the RTC running off a 32.768kHz crystal, you can retain an accurate
system clock between reboots (hard and soft) until power is finally removed
from the board (there is no batter backup on the RSK board).


Chris Brandt (5):
  rtc: rtc-sh: add support for rza series
  rtc: Add rtc-sh
  ARM: dts: r7s72100: add rtc clock to device tree
  ARM: dts: r7s72100: add rtc to device tree
  ARM: dts: rskrza1: add rtc DT support

 Documentation/devicetree/bindings/rtc/rtc-sh.txt | 19 +++++++++++++++++++
 arch/arm/boot/dts/r7s72100-rskrza1.dts           |  4 ++++
 arch/arm/boot/dts/r7s72100.dtsi                  | 20 ++++++++++++++++++++
 drivers/rtc/Kconfig                              |  4 ++--
 drivers/rtc/rtc-sh.c                             | 20 ++++++++++++++++++++
 include/dt-bindings/clock/r7s72100-clock.h       |  3 +++
 6 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1
@ 2017-03-16 17:51 ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

Basically, the same RTC that was used in SuperH devices is now used in
RZ/A1 devices. Therefore with some slight changes, that driver can be
reused.

Additionally, since ARM architectures require Device Tree configurations,
device tree support has been added.

This was tested on RZ/A1H RSK board. Once the correct time was programmed
into the RTC running off a 32.768kHz crystal, you can retain an accurate
system clock between reboots (hard and soft) until power is finally removed
from the board (there is no batter backup on the RSK board).


Chris Brandt (5):
  rtc: rtc-sh: add support for rza series
  rtc: Add rtc-sh
  ARM: dts: r7s72100: add rtc clock to device tree
  ARM: dts: r7s72100: add rtc to device tree
  ARM: dts: rskrza1: add rtc DT support

 Documentation/devicetree/bindings/rtc/rtc-sh.txt | 19 +++++++++++++++++++
 arch/arm/boot/dts/r7s72100-rskrza1.dts           |  4 ++++
 arch/arm/boot/dts/r7s72100.dtsi                  | 20 ++++++++++++++++++++
 drivers/rtc/Kconfig                              |  4 ++--
 drivers/rtc/rtc-sh.c                             | 20 ++++++++++++++++++++
 include/dt-bindings/clock/r7s72100-clock.h       |  3 +++
 6 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1
@ 2017-03-16 17:51 ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Basically, the same RTC that was used in SuperH devices is now used in
RZ/A1 devices. Therefore with some slight changes, that driver can be
reused.

Additionally, since ARM architectures require Device Tree configurations,
device tree support has been added.

This was tested on RZ/A1H RSK board. Once the correct time was programmed
into the RTC running off a 32.768kHz crystal, you can retain an accurate
system clock between reboots (hard and soft) until power is finally removed
from the board (there is no batter backup on the RSK board).


Chris Brandt (5):
  rtc: rtc-sh: add support for rza series
  rtc: Add rtc-sh
  ARM: dts: r7s72100: add rtc clock to device tree
  ARM: dts: r7s72100: add rtc to device tree
  ARM: dts: rskrza1: add rtc DT support

 Documentation/devicetree/bindings/rtc/rtc-sh.txt | 19 +++++++++++++++++++
 arch/arm/boot/dts/r7s72100-rskrza1.dts           |  4 ++++
 arch/arm/boot/dts/r7s72100.dtsi                  | 20 ++++++++++++++++++++
 drivers/rtc/Kconfig                              |  4 ++--
 drivers/rtc/rtc-sh.c                             | 20 ++++++++++++++++++++
 include/dt-bindings/clock/r7s72100-clock.h       |  3 +++
 6 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

-- 
2.10.1



^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] [PATCH 1/5] rtc: rtc-sh: add support for rza series
       [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
  2017-03-28 13:38   ` [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

This same RTC is used in RZ/A series MPUs, therefore with some slight
changes, this driver can be reused. Additionally, since ARM architectures
require Device Tree configurations, device tree support has been added.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 drivers/rtc/Kconfig  |  4 ++--
 drivers/rtc/rtc-sh.c | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index ee1b0e9..77d1495 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
 
 config RTC_DRV_SH
 	tristate "SuperH On-Chip RTC"
-	depends on SUPERH && HAVE_CLK
+	depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK
 	help
 	  Say Y here to enable support for the on-chip RTC found in
-	  most SuperH processors.
+	  most SuperH processors. This RTC is also found in RZ/A SoCs.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called rtc-sh.
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index c626e43..2ef4ac7 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -27,7 +27,15 @@
 #include <linux/log2.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
+#ifdef CONFIG_SUPERH
 #include <asm/rtc.h>
+#else
+/* Default values for RZ/A RTC */
+#define rtc_reg_size		sizeof(u16)
+#define RTC_BIT_INVERTED        0	/* no chip bugs */
+#define RTC_CAP_4_DIGIT_YEAR    (1 << 0)
+#define RTC_DEF_CAPABILITIES    RTC_CAP_4_DIGIT_YEAR
+#endif
 
 #define DRV_NAME	"sh-rtc"
 
@@ -570,6 +578,8 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	rtc->alarm_irq = platform_get_irq(pdev, 2);
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+	if (res == NULL)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (unlikely(res == NULL)) {
 		dev_err(&pdev->dev, "No IO resource\n");
 		return -ENOENT;
@@ -608,6 +618,8 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	clk_enable(rtc->clk);
 
 	rtc->capabilities = RTC_DEF_CAPABILITIES;
+
+#ifdef CONFIG_SUPERH
 	if (dev_get_platdata(&pdev->dev)) {
 		struct sh_rtc_platform_info *pinfo =
 			dev_get_platdata(&pdev->dev);
@@ -618,6 +630,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 		 */
 		rtc->capabilities |= pinfo->capabilities;
 	}
+#endif
 
 	if (rtc->carry_irq <= 0) {
 		/* register shared periodic/carry/alarm irq */
@@ -738,10 +751,17 @@ static int sh_rtc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
 
+static const struct of_device_id sh_rtc_of_match[] = {
+	{ .compatible = "renesas,sh-rtc", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sh_rtc_of_match);
+
 static struct platform_driver sh_rtc_platform_driver = {
 	.driver		= {
 		.name	= DRV_NAME,
 		.pm	= &sh_rtc_pm_ops,
+		.of_match_table = sh_rtc_of_match,
 	},
 	.remove		= __exit_p(sh_rtc_remove),
 };
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

This same RTC is used in RZ/A series MPUs, therefore with some slight
changes, this driver can be reused. Additionally, since ARM architectures
require Device Tree configurations, device tree support has been added.

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 drivers/rtc/Kconfig  |  4 ++--
 drivers/rtc/rtc-sh.c | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index ee1b0e9..77d1495 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
 
 config RTC_DRV_SH
 	tristate "SuperH On-Chip RTC"
-	depends on SUPERH && HAVE_CLK
+	depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK
 	help
 	  Say Y here to enable support for the on-chip RTC found in
-	  most SuperH processors.
+	  most SuperH processors. This RTC is also found in RZ/A SoCs.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called rtc-sh.
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index c626e43..2ef4ac7 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -27,7 +27,15 @@
 #include <linux/log2.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
+#ifdef CONFIG_SUPERH
 #include <asm/rtc.h>
+#else
+/* Default values for RZ/A RTC */
+#define rtc_reg_size		sizeof(u16)
+#define RTC_BIT_INVERTED        0	/* no chip bugs */
+#define RTC_CAP_4_DIGIT_YEAR    (1 << 0)
+#define RTC_DEF_CAPABILITIES    RTC_CAP_4_DIGIT_YEAR
+#endif
 
 #define DRV_NAME	"sh-rtc"
 
@@ -570,6 +578,8 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	rtc->alarm_irq = platform_get_irq(pdev, 2);
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+	if (res == NULL)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (unlikely(res == NULL)) {
 		dev_err(&pdev->dev, "No IO resource\n");
 		return -ENOENT;
@@ -608,6 +618,8 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	clk_enable(rtc->clk);
 
 	rtc->capabilities = RTC_DEF_CAPABILITIES;
+
+#ifdef CONFIG_SUPERH
 	if (dev_get_platdata(&pdev->dev)) {
 		struct sh_rtc_platform_info *pinfo =
 			dev_get_platdata(&pdev->dev);
@@ -618,6 +630,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 		 */
 		rtc->capabilities |= pinfo->capabilities;
 	}
+#endif
 
 	if (rtc->carry_irq <= 0) {
 		/* register shared periodic/carry/alarm irq */
@@ -738,10 +751,17 @@ static int sh_rtc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
 
+static const struct of_device_id sh_rtc_of_match[] = {
+	{ .compatible = "renesas,sh-rtc", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sh_rtc_of_match);
+
 static struct platform_driver sh_rtc_platform_driver = {
 	.driver		= {
 		.name	= DRV_NAME,
 		.pm	= &sh_rtc_pm_ops,
+		.of_match_table = sh_rtc_of_match,
 	},
 	.remove		= __exit_p(sh_rtc_remove),
 };
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

This same RTC is used in RZ/A series MPUs, therefore with some slight
changes, this driver can be reused. Additionally, since ARM architectures
require Device Tree configurations, device tree support has been added.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 drivers/rtc/Kconfig  |  4 ++--
 drivers/rtc/rtc-sh.c | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index ee1b0e9..77d1495 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
 
 config RTC_DRV_SH
 	tristate "SuperH On-Chip RTC"
-	depends on SUPERH && HAVE_CLK
+	depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK
 	help
 	  Say Y here to enable support for the on-chip RTC found in
-	  most SuperH processors.
+	  most SuperH processors. This RTC is also found in RZ/A SoCs.
 
 	  To compile this driver as a module, choose M here: the
 	  module will be called rtc-sh.
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index c626e43..2ef4ac7 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -27,7 +27,15 @@
 #include <linux/log2.h>
 #include <linux/clk.h>
 #include <linux/slab.h>
+#ifdef CONFIG_SUPERH
 #include <asm/rtc.h>
+#else
+/* Default values for RZ/A RTC */
+#define rtc_reg_size		sizeof(u16)
+#define RTC_BIT_INVERTED        0	/* no chip bugs */
+#define RTC_CAP_4_DIGIT_YEAR    (1 << 0)
+#define RTC_DEF_CAPABILITIES    RTC_CAP_4_DIGIT_YEAR
+#endif
 
 #define DRV_NAME	"sh-rtc"
 
@@ -570,6 +578,8 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	rtc->alarm_irq = platform_get_irq(pdev, 2);
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
+	if (res == NULL)
+		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (unlikely(res == NULL)) {
 		dev_err(&pdev->dev, "No IO resource\n");
 		return -ENOENT;
@@ -608,6 +618,8 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	clk_enable(rtc->clk);
 
 	rtc->capabilities = RTC_DEF_CAPABILITIES;
+
+#ifdef CONFIG_SUPERH
 	if (dev_get_platdata(&pdev->dev)) {
 		struct sh_rtc_platform_info *pinfo =
 			dev_get_platdata(&pdev->dev);
@@ -618,6 +630,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 		 */
 		rtc->capabilities |= pinfo->capabilities;
 	}
+#endif
 
 	if (rtc->carry_irq <= 0) {
 		/* register shared periodic/carry/alarm irq */
@@ -738,10 +751,17 @@ static int sh_rtc_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(sh_rtc_pm_ops, sh_rtc_suspend, sh_rtc_resume);
 
+static const struct of_device_id sh_rtc_of_match[] = {
+	{ .compatible = "renesas,sh-rtc", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, sh_rtc_of_match);
+
 static struct platform_driver sh_rtc_platform_driver = {
 	.driver		= {
 		.name	= DRV_NAME,
 		.pm	= &sh_rtc_pm_ops,
+		.of_match_table = sh_rtc_of_match,
 	},
 	.remove		= __exit_p(sh_rtc_remove),
 };
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [rtc-linux] [PATCH 2/5] rtc: Add rtc-sh
       [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
  2017-03-28 13:38   ` [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

rtc-sh is a RTC for SuperH and RZ/A SoCs.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/rtc/rtc-sh.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
new file mode 100644
index 0000000..2f0dc6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
@@ -0,0 +1,19 @@
+* Real Time Clock for Renesas SH and ARM SoCs
+
+Required properties:
+- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as a
+  fallback.
+- reg: physical base address and length of memory mapped region.
+- interrupts: 3 interrupts for alarm, period, and carry.
+- clocks: the clock source for the RTC controller.
+
+Example:
+rtc: rtc@fcff1000 {
+	compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+	reg = <0xfcff1000 0x2e>;
+	interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+		      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+		      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+	clocks = <&mstp6_clks R7S72100_CLK_RTC>;
+	power-domains = <&cpg_clocks>;
+};
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

rtc-sh is a RTC for SuperH and RZ/A SoCs.

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 Documentation/devicetree/bindings/rtc/rtc-sh.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
new file mode 100644
index 0000000..2f0dc6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
@@ -0,0 +1,19 @@
+* Real Time Clock for Renesas SH and ARM SoCs
+
+Required properties:
+- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as a
+  fallback.
+- reg: physical base address and length of memory mapped region.
+- interrupts: 3 interrupts for alarm, period, and carry.
+- clocks: the clock source for the RTC controller.
+
+Example:
+rtc: rtc@fcff1000 {
+	compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+	reg = <0xfcff1000 0x2e>;
+	interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+		      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+		      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+	clocks = <&mstp6_clks R7S72100_CLK_RTC>;
+	power-domains = <&cpg_clocks>;
+};
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

rtc-sh is a RTC for SuperH and RZ/A SoCs.

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 Documentation/devicetree/bindings/rtc/rtc-sh.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-sh.txt

diff --git a/Documentation/devicetree/bindings/rtc/rtc-sh.txt b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
new file mode 100644
index 0000000..2f0dc6c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
@@ -0,0 +1,19 @@
+* Real Time Clock for Renesas SH and ARM SoCs
+
+Required properties:
+- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as a
+  fallback.
+- reg: physical base address and length of memory mapped region.
+- interrupts: 3 interrupts for alarm, period, and carry.
+- clocks: the clock source for the RTC controller.
+
+Example:
+rtc: rtc@fcff1000 {
+	compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+	reg = <0xfcff1000 0x2e>;
+	interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+		      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+		      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+	clocks = <&mstp6_clks R7S72100_CLK_RTC>;
+	power-domains = <&cpg_clocks>;
+};
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [rtc-linux] [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
       [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
  2017-03-28 13:38   ` [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100.dtsi            | 9 +++++++++
 include/dt-bindings/clock/r7s72100-clock.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ed62e19..2a42a79 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -117,6 +117,15 @@
 			clock-output-names = "ostm0", "ostm1";
 		};
 
+		mstp6_clks: mstp6_clks@fcfe042c {
+			#clock-cells = <1>;
+			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0xfcfe042c 4>;
+			clocks = <&p0_clk>;
+			clock-indices = <R7S72100_CLK_RTC>;
+			clock-output-names = "rtc0";
+		};
+
 		mstp7_clks: mstp7_clks@fcfe0430 {
 			#clock-cells = <1>;
 			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
index cd2ed51..bc256d3 100644
--- a/include/dt-bindings/clock/r7s72100-clock.h
+++ b/include/dt-bindings/clock/r7s72100-clock.h
@@ -29,6 +29,9 @@
 #define R7S72100_CLK_OSTM0	1
 #define R7S72100_CLK_OSTM1	0
 
+/* MSTP6 */
+#define R7S72100_CLK_RTC	0
+
 /* MSTP7 */
 #define R7S72100_CLK_ETHER	4
 
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/boot/dts/r7s72100.dtsi            | 9 +++++++++
 include/dt-bindings/clock/r7s72100-clock.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ed62e19..2a42a79 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -117,6 +117,15 @@
 			clock-output-names = "ostm0", "ostm1";
 		};
 
+		mstp6_clks: mstp6_clks@fcfe042c {
+			#clock-cells = <1>;
+			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0xfcfe042c 4>;
+			clocks = <&p0_clk>;
+			clock-indices = <R7S72100_CLK_RTC>;
+			clock-output-names = "rtc0";
+		};
+
 		mstp7_clks: mstp7_clks@fcfe0430 {
 			#clock-cells = <1>;
 			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
index cd2ed51..bc256d3 100644
--- a/include/dt-bindings/clock/r7s72100-clock.h
+++ b/include/dt-bindings/clock/r7s72100-clock.h
@@ -29,6 +29,9 @@
 #define R7S72100_CLK_OSTM0	1
 #define R7S72100_CLK_OSTM1	0
 
+/* MSTP6 */
+#define R7S72100_CLK_RTC	0
+
 /* MSTP7 */
 #define R7S72100_CLK_ETHER	4
 
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100.dtsi            | 9 +++++++++
 include/dt-bindings/clock/r7s72100-clock.h | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index ed62e19..2a42a79 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -117,6 +117,15 @@
 			clock-output-names = "ostm0", "ostm1";
 		};
 
+		mstp6_clks: mstp6_clks@fcfe042c {
+			#clock-cells = <1>;
+			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
+			reg = <0xfcfe042c 4>;
+			clocks = <&p0_clk>;
+			clock-indices = <R7S72100_CLK_RTC>;
+			clock-output-names = "rtc0";
+		};
+
 		mstp7_clks: mstp7_clks@fcfe0430 {
 			#clock-cells = <1>;
 			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
index cd2ed51..bc256d3 100644
--- a/include/dt-bindings/clock/r7s72100-clock.h
+++ b/include/dt-bindings/clock/r7s72100-clock.h
@@ -29,6 +29,9 @@
 #define R7S72100_CLK_OSTM0	1
 #define R7S72100_CLK_OSTM1	0
 
+/* MSTP6 */
+#define R7S72100_CLK_RTC	0
+
 /* MSTP7 */
 #define R7S72100_CLK_ETHER	4
 
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [rtc-linux] [PATCH 4/5] ARM: dts: r7s72100: add rtc to device tree
  2017-03-16 17:51 ` Chris Brandt
@ 2017-03-16 17:51   ` Chris Brandt
  -1 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index 2a42a79..e047fc8 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -551,4 +551,15 @@
 		power-domains = <&cpg_clocks>;
 		status = "disabled";
 	};
+
+	rtc: rtc@fcff1000 {
+		compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+		reg = <0xfcff1000 0x2e>;
+		interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+		clocks = <&mstp6_clks R7S72100_CLK_RTC>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
 };
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 4/5] ARM: dts: r7s72100: add rtc to device tree
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
index 2a42a79..e047fc8 100644
--- a/arch/arm/boot/dts/r7s72100.dtsi
+++ b/arch/arm/boot/dts/r7s72100.dtsi
@@ -551,4 +551,15 @@
 		power-domains = <&cpg_clocks>;
 		status = "disabled";
 	};
+
+	rtc: rtc@fcff1000 {
+		compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+		reg = <0xfcff1000 0x2e>;
+		interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+		clocks = <&mstp6_clks R7S72100_CLK_RTC>;
+		power-domains = <&cpg_clocks>;
+		status = "disabled";
+	};
 };
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [rtc-linux] [PATCH 5/5] ARM: dts: rskrza1: add rtc DT support
       [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
  2017-03-28 13:38   ` [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100-rskrza1.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100-rskrza1.dts b/arch/arm/boot/dts/r7s72100-rskrza1.dts
index 6abb929..dfbb028 100644
--- a/arch/arm/boot/dts/r7s72100-rskrza1.dts
+++ b/arch/arm/boot/dts/r7s72100-rskrza1.dts
@@ -77,6 +77,10 @@
 	status = "okay";
 };
 
+&rtc {
+	status = "okay";
+};
+
 &scif2 {
 	status = "okay";
 };
-- 
2.10.1


-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 5/5] ARM: dts: rskrza1: add rtc DT support
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
---
 arch/arm/boot/dts/r7s72100-rskrza1.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100-rskrza1.dts b/arch/arm/boot/dts/r7s72100-rskrza1.dts
index 6abb929..dfbb028 100644
--- a/arch/arm/boot/dts/r7s72100-rskrza1.dts
+++ b/arch/arm/boot/dts/r7s72100-rskrza1.dts
@@ -77,6 +77,10 @@
 	status = "okay";
 };
 
+&rtc {
+	status = "okay";
+};
+
 &scif2 {
 	status = "okay";
 };
-- 
2.10.1


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [PATCH 5/5] ARM: dts: rskrza1: add rtc DT support
@ 2017-03-16 17:51   ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-16 17:51 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, Geert Uytterhoeven
  Cc: rtc-linux, devicetree, linux-renesas-soc, Chris Brandt

Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
---
 arch/arm/boot/dts/r7s72100-rskrza1.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/r7s72100-rskrza1.dts b/arch/arm/boot/dts/r7s72100-rskrza1.dts
index 6abb929..dfbb028 100644
--- a/arch/arm/boot/dts/r7s72100-rskrza1.dts
+++ b/arch/arm/boot/dts/r7s72100-rskrza1.dts
@@ -77,6 +77,10 @@
 	status = "okay";
 };
 
+&rtc {
+	status = "okay";
+};
+
 &scif2 {
 	status = "okay";
 };
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17  8:17     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:17 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> rtc-sh is a RTC for SuperH and RZ/A SoCs.

an RTC?

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> @@ -0,0 +1,19 @@
> +* Real Time Clock for Renesas SH and ARM SoCs
> +
> +Required properties:
> +- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as a

s/or/and/

> +  fallback.
> +- reg: physical base address and length of memory mapped region.
> +- interrupts: 3 interrupts for alarm, period, and carry.

If there's a need for multiple interrupts, it's always a good idea to use
interrupt-names. The datasheet calls them "arm", "prd", and "cup", but
I wouldn't object against "alarm", "period", and "carry" ;-)

> +- clocks: the clock source for the RTC controller.

The datasheet mentions 3 possible clock sources?

> +Example:
> +rtc: rtc@fcff1000 {
> +       compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +       reg = <0xfcff1000 0x2e>;
> +       interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> +                     GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> +                     GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> +       clocks = <&mstp6_clks R7S72100_CLK_RTC>;
> +       power-domains = <&cpg_clocks>;
> +};

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17  8:17     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:17 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> rtc-sh is a RTC for SuperH and RZ/A SoCs.

an RTC?

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> @@ -0,0 +1,19 @@
> +* Real Time Clock for Renesas SH and ARM SoCs
> +
> +Required properties:
> +- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as a

s/or/and/

> +  fallback.
> +- reg: physical base address and length of memory mapped region.
> +- interrupts: 3 interrupts for alarm, period, and carry.

If there's a need for multiple interrupts, it's always a good idea to use
interrupt-names. The datasheet calls them "arm", "prd", and "cup", but
I wouldn't object against "alarm", "period", and "carry" ;-)

> +- clocks: the clock source for the RTC controller.

The datasheet mentions 3 possible clock sources?

> +Example:
> +rtc: rtc@fcff1000 {
> +       compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +       reg = <0xfcff1000 0x2e>;
> +       interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> +                     GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> +                     GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> +       clocks = <&mstp6_clks R7S72100_CLK_RTC>;
> +       power-domains = <&cpg_clocks>;
> +};

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17  8:17     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:17 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> rtc-sh is a RTC for SuperH and RZ/A SoCs.

an RTC?

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-sh.txt
> @@ -0,0 +1,19 @@
> +* Real Time Clock for Renesas SH and ARM SoCs
> +
> +Required properties:
> +- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as a

s/or/and/

> +  fallback.
> +- reg: physical base address and length of memory mapped region.
> +- interrupts: 3 interrupts for alarm, period, and carry.

If there's a need for multiple interrupts, it's always a good idea to use
interrupt-names. The datasheet calls them "arm", "prd", and "cup", but
I wouldn't object against "alarm", "period", and "carry" ;-)

> +- clocks: the clock source for the RTC controller.

The datasheet mentions 3 possible clock sources?

> +Example:
> +rtc: rtc@fcff1000 {
> +       compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +       reg = <0xfcff1000 0x2e>;
> +       interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> +                     GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> +                     GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> +       clocks = <&mstp6_clks R7S72100_CLK_RTC>;
> +       power-domains = <&cpg_clocks>;
> +};

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17  8:22     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:22 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> This same RTC is used in RZ/A series MPUs, therefore with some slight
> changes, this driver can be reused. Additionally, since ARM architectures
> require Device Tree configurations, device tree support has been added.

Thanks for your patch!

> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
>
>  config RTC_DRV_SH
>         tristate "SuperH On-Chip RTC"
> -       depends on SUPERH && HAVE_CLK
> +       depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK

I believe the dependency on HAVE_CLK is not needed.
SuperH selects CLKDEV_LOOKUP, which selects HAVE_CLK.
ARM (and ARM64) selects COMMON_CLK, which selects HAVE_CLK.

interestingly, SuperH already did so at the time the dependency was added...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17  8:22     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:22 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> This same RTC is used in RZ/A series MPUs, therefore with some slight
> changes, this driver can be reused. Additionally, since ARM architectures
> require Device Tree configurations, device tree support has been added.

Thanks for your patch!

> Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>

> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
>
>  config RTC_DRV_SH
>         tristate "SuperH On-Chip RTC"
> -       depends on SUPERH && HAVE_CLK
> +       depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK

I believe the dependency on HAVE_CLK is not needed.
SuperH selects CLKDEV_LOOKUP, which selects HAVE_CLK.
ARM (and ARM64) selects COMMON_CLK, which selects HAVE_CLK.

interestingly, SuperH already did so at the time the dependency was added...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17  8:22     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:22 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> This same RTC is used in RZ/A series MPUs, therefore with some slight
> changes, this driver can be reused. Additionally, since ARM architectures
> require Device Tree configurations, device tree support has been added.

Thanks for your patch!

> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
>
>  config RTC_DRV_SH
>         tristate "SuperH On-Chip RTC"
> -       depends on SUPERH && HAVE_CLK
> +       depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK

I believe the dependency on HAVE_CLK is not needed.
SuperH selects CLKDEV_LOOKUP, which selects HAVE_CLK.
ARM (and ARM64) selects COMMON_CLK, which selects HAVE_CLK.

interestingly, SuperH already did so at the time the dependency was added...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17  8:27     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:27 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -117,6 +117,15 @@
>                         clock-output-names = "ostm0", "ostm1";
>                 };
>
> +               mstp6_clks: mstp6_clks@fcfe042c {
> +                       #clock-cells = <1>;
> +                       compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> +                       reg = <0xfcfe042c 4>;
> +                       clocks = <&p0_clk>;
> +                       clock-indices = <R7S72100_CLK_RTC>;
> +                       clock-output-names = "rtc0";

"rtc"? There's only one.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17  8:27     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:27 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>

> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -117,6 +117,15 @@
>                         clock-output-names = "ostm0", "ostm1";
>                 };
>
> +               mstp6_clks: mstp6_clks@fcfe042c {
> +                       #clock-cells = <1>;
> +                       compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> +                       reg = <0xfcfe042c 4>;
> +                       clocks = <&p0_clk>;
> +                       clock-indices = <R7S72100_CLK_RTC>;
> +                       clock-output-names = "rtc0";

"rtc"? There's only one.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17  8:27     ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17  8:27 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com> wrote:
> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -117,6 +117,15 @@
>                         clock-output-names = "ostm0", "ostm1";
>                 };
>
> +               mstp6_clks: mstp6_clks@fcfe042c {
> +                       #clock-cells = <1>;
> +                       compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> +                       reg = <0xfcfe042c 4>;
> +                       clocks = <&p0_clk>;
> +                       clock-indices = <R7S72100_CLK_RTC>;
> +                       clock-output-names = "rtc0";

"rtc"? There's only one.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:16       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,


Happy St Patrick's Day!

    (I know you are not Irish....but you are closer to Ireland than I am ;)


On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com>
> wrote:
> > rtc-sh is a RTC for SuperH and RZ/A SoCs.
>=20
> an RTC?

Good point. That's more better ;)


> > +Required properties:
> > +- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as
> > +a
>=20
> s/or/and/

OK


> > +  fallback.
> > +- reg: physical base address and length of memory mapped region.
> > +- interrupts: 3 interrupts for alarm, period, and carry.
>=20
> If there's a need for multiple interrupts, it's always a good idea to use
> interrupt-names. The datasheet calls them "arm", "prd", and "cup", but I
> wouldn't object against "alarm", "period", and "carry" ;-)

OK. I'll change.
I like the longer names as well ("prd" looks ugly)


> > +- clocks: the clock source for the RTC controller.
>=20
> The datasheet mentions 3 possible clock sources?

There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL), an=
d then a clock source that runs the register interface (run off of the p0 c=
lock). So I just need to turn on the p0 clock so I can get at the registers=
. Note that if you do a hard reset with a RESET button, and all the registe=
rs in the chip go back to their POR state, the counter still counts off of =
the 32KHz XTAL even though the "peripheral clock" is stopped (which just me=
ans you can't get to the registers).

In reality, you have to assume the RTC counting source has already been set=
 up by u-boot, or from a past reboot, so I don't do any of that select conf=
iguration at all.


Chris

--=20
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "=
rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:16       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Geert,


Happy St Patrick's Day!

    (I know you are not Irish....but you are closer to Ireland than I am ;)


On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> wrote:
> > rtc-sh is a RTC for SuperH and RZ/A SoCs.
> 
> an RTC?

Good point. That's more better ;)


> > +Required properties:
> > +- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as
> > +a
> 
> s/or/and/

OK


> > +  fallback.
> > +- reg: physical base address and length of memory mapped region.
> > +- interrupts: 3 interrupts for alarm, period, and carry.
> 
> If there's a need for multiple interrupts, it's always a good idea to use
> interrupt-names. The datasheet calls them "arm", "prd", and "cup", but I
> wouldn't object against "alarm", "period", and "carry" ;-)

OK. I'll change.
I like the longer names as well ("prd" looks ugly)


> > +- clocks: the clock source for the RTC controller.
> 
> The datasheet mentions 3 possible clock sources?

There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL), and then a clock source that runs the register interface (run off of the p0 clock). So I just need to turn on the p0 clock so I can get at the registers. Note that if you do a hard reset with a RESET button, and all the registers in the chip go back to their POR state, the counter still counts off of the 32KHz XTAL even though the "peripheral clock" is stopped (which just means you can't get to the registers).

In reality, you have to assume the RTC counting source has already been set up by u-boot, or from a past reboot, so I don't do any of that select configuration at all.


Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:16       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:16 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,


Happy St Patrick's Day!

    (I know you are not Irish....but you are closer to Ireland than I am ;)


On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com>
> wrote:
> > rtc-sh is a RTC for SuperH and RZ/A SoCs.
> 
> an RTC?

Good point. That's more better ;)


> > +Required properties:
> > +- compatible: Should be "renesas,r7s72100-rtc" or "renesas,sh-rtc" as
> > +a
> 
> s/or/and/

OK


> > +  fallback.
> > +- reg: physical base address and length of memory mapped region.
> > +- interrupts: 3 interrupts for alarm, period, and carry.
> 
> If there's a need for multiple interrupts, it's always a good idea to use
> interrupt-names. The datasheet calls them "arm", "prd", and "cup", but I
> wouldn't object against "alarm", "period", and "carry" ;-)

OK. I'll change.
I like the longer names as well ("prd" looks ugly)


> > +- clocks: the clock source for the RTC controller.
> 
> The datasheet mentions 3 possible clock sources?

There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL), and then a clock source that runs the register interface (run off of the p0 clock). So I just need to turn on the p0 clock so I can get at the registers. Note that if you do a hard reset with a RESET button, and all the registers in the chip go back to their POR state, the counter still counts off of the 32KHz XTAL even though the "peripheral clock" is stopped (which just means you can't get to the registers).

In reality, you have to assume the RTC counting source has already been set up by u-boot, or from a past reboot, so I don't do any of that select configuration at all.


Chris

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17 13:17       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > --- a/drivers/rtc/Kconfig
> > +++ b/drivers/rtc/Kconfig
> > @@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
> >
> >  config RTC_DRV_SH
> >         tristate "SuperH On-Chip RTC"
> > -       depends on SUPERH && HAVE_CLK
> > +       depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK
> 
> I believe the dependency on HAVE_CLK is not needed.
> SuperH selects CLKDEV_LOOKUP, which selects HAVE_CLK.
> ARM (and ARM64) selects COMMON_CLK, which selects HAVE_CLK.
> 
> interestingly, SuperH already did so at the time the dependency was
> added...

OK, I'll take it out.
I just didn't want to break any SH stuff.



Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17 13:17       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > --- a/drivers/rtc/Kconfig
> > +++ b/drivers/rtc/Kconfig
> > @@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
> >
> >  config RTC_DRV_SH
> >         tristate "SuperH On-Chip RTC"
> > -       depends on SUPERH && HAVE_CLK
> > +       depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK
> 
> I believe the dependency on HAVE_CLK is not needed.
> SuperH selects CLKDEV_LOOKUP, which selects HAVE_CLK.
> ARM (and ARM64) selects COMMON_CLK, which selects HAVE_CLK.
> 
> interestingly, SuperH already did so at the time the dependency was
> added...

OK, I'll take it out.
I just didn't want to break any SH stuff.



Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17 13:17       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:17 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > --- a/drivers/rtc/Kconfig
> > +++ b/drivers/rtc/Kconfig
> > @@ -1303,10 +1303,10 @@ config RTC_DRV_SA1100
> >
> >  config RTC_DRV_SH
> >         tristate "SuperH On-Chip RTC"
> > -       depends on SUPERH && HAVE_CLK
> > +       depends on (SUPERH || ARCH_RENESAS) && HAVE_CLK
> 
> I believe the dependency on HAVE_CLK is not needed.
> SuperH selects CLKDEV_LOOKUP, which selects HAVE_CLK.
> ARM (and ARM64) selects COMMON_CLK, which selects HAVE_CLK.
> 
> interestingly, SuperH already did so at the time the dependency was
> added...

OK, I'll take it out.
I just didn't want to break any SH stuff.



Chris

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:20       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > --- a/arch/arm/boot/dts/r7s72100.dtsi
> > +++ b/arch/arm/boot/dts/r7s72100.dtsi
> > @@ -117,6 +117,15 @@
> >                         clock-output-names = "ostm0", "ostm1";
> >                 };
> >
> > +               mstp6_clks: mstp6_clks@fcfe042c {
> > +                       #clock-cells = <1>;
> > +                       compatible = "renesas,r7s72100-mstp-clocks",
> "renesas,cpg-mstp-clocks";
> > +                       reg = <0xfcfe042c 4>;
> > +                       clocks = <&p0_clk>;
> > +                       clock-indices = <R7S72100_CLK_RTC>;
> > +                       clock-output-names = "rtc0";
> 
> "rtc"? There's only one.

The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver.


[ from the rtc-sh.c code ]

	clk_id = pdev->id;
	/* With a single device, the clock id is still "rtc0" */
	if (clk_id < 0)
		clk_id = 0;

	snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id);

	rtc->clk = devm_clk_get(&pdev->dev, clk_name);
	if (IS_ERR(rtc->clk)) {
		/*
		 * No error handling for rtc->clk intentionally, not all
		 * platforms will have a unique clock for the RTC, and
		 * the clk API can handle the struct clk pointer being
		 * NULL.
		 */
		rtc->clk = NULL;
	}

	clk_enable(rtc->clk);


Cheers

Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:20       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > --- a/arch/arm/boot/dts/r7s72100.dtsi
> > +++ b/arch/arm/boot/dts/r7s72100.dtsi
> > @@ -117,6 +117,15 @@
> >                         clock-output-names = "ostm0", "ostm1";
> >                 };
> >
> > +               mstp6_clks: mstp6_clks@fcfe042c {
> > +                       #clock-cells = <1>;
> > +                       compatible = "renesas,r7s72100-mstp-clocks",
> "renesas,cpg-mstp-clocks";
> > +                       reg = <0xfcfe042c 4>;
> > +                       clocks = <&p0_clk>;
> > +                       clock-indices = <R7S72100_CLK_RTC>;
> > +                       clock-output-names = "rtc0";
> 
> "rtc"? There's only one.

The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver.


[ from the rtc-sh.c code ]

	clk_id = pdev->id;
	/* With a single device, the clock id is still "rtc0" */
	if (clk_id < 0)
		clk_id = 0;

	snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id);

	rtc->clk = devm_clk_get(&pdev->dev, clk_name);
	if (IS_ERR(rtc->clk)) {
		/*
		 * No error handling for rtc->clk intentionally, not all
		 * platforms will have a unique clock for the RTC, and
		 * the clk API can handle the struct clk pointer being
		 * NULL.
		 */
		rtc->clk = NULL;
	}

	clk_enable(rtc->clk);


Cheers

Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:20       ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > --- a/arch/arm/boot/dts/r7s72100.dtsi
> > +++ b/arch/arm/boot/dts/r7s72100.dtsi
> > @@ -117,6 +117,15 @@
> >                         clock-output-names = "ostm0", "ostm1";
> >                 };
> >
> > +               mstp6_clks: mstp6_clks@fcfe042c {
> > +                       #clock-cells = <1>;
> > +                       compatible = "renesas,r7s72100-mstp-clocks",
> "renesas,cpg-mstp-clocks";
> > +                       reg = <0xfcfe042c 4>;
> > +                       clocks = <&p0_clk>;
> > +                       clock-indices = <R7S72100_CLK_RTC>;
> > +                       clock-output-names = "rtc0";
> 
> "rtc"? There's only one.

The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver.


[ from the rtc-sh.c code ]

	clk_id = pdev->id;
	/* With a single device, the clock id is still "rtc0" */
	if (clk_id < 0)
		clk_id = 0;

	snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id);

	rtc->clk = devm_clk_get(&pdev->dev, clk_name);
	if (IS_ERR(rtc->clk)) {
		/*
		 * No error handling for rtc->clk intentionally, not all
		 * platforms will have a unique clock for the RTC, and
		 * the clk API can handle the struct clk pointer being
		 * NULL.
		 */
		rtc->clk = NULL;
	}

	clk_enable(rtc->clk);


Cheers

Chris


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:21         ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:21 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:16 PM, Chris Brandt <Chris.Brandt@renesas.com> wr=
ote:
> Happy St Patrick's Day!
>
>     (I know you are not Irish....but you are closer to Ireland than I am =
;)

;-)

> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com>
>> wrote:
>> > +- clocks: the clock source for the RTC controller.
>>
>> The datasheet mentions 3 possible clock sources?
>
> There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL), =
and then a clock source that runs the register interface (run off of the p0=
 clock). So I just need to turn on the p0 clock so I can get at the registe=
rs. Note that if you do a hard reset with a RESET button, and all the regis=
ters in the chip go back to their POR state, the counter still counts off o=
f the 32KHz XTAL even though the "peripheral clock" is stopped (which just =
means you can't get to the registers).
>
> In reality, you have to assume the RTC counting source has already been s=
et up by u-boot, or from a past reboot, so I don't do any of that select co=
nfiguration at all.

it would still be good to have phandles to the external clock sources as we=
ll,
as that describes the hardware topology.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k=
.org

In personal conversations with technical people, I call myself a hacker. Bu=
t
when I'm talking to journalists I just say "programmer" or something like t=
hat.
                                -- Linus Torvalds

--=20
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---=20
You received this message because you are subscribed to the Google Groups "=
rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:21         ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:21 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:16 PM, Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> Happy St Patrick's Day!
>
>     (I know you are not Irish....but you are closer to Ireland than I am ;)

;-)

> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
>> wrote:
>> > +- clocks: the clock source for the RTC controller.
>>
>> The datasheet mentions 3 possible clock sources?
>
> There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL), and then a clock source that runs the register interface (run off of the p0 clock). So I just need to turn on the p0 clock so I can get at the registers. Note that if you do a hard reset with a RESET button, and all the registers in the chip go back to their POR state, the counter still counts off of the 32KHz XTAL even though the "peripheral clock" is stopped (which just means you can't get to the registers).
>
> In reality, you have to assume the RTC counting source has already been set up by u-boot, or from a past reboot, so I don't do any of that select configuration at all.

it would still be good to have phandles to the external clock sources as well,
as that describes the hardware topology.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:21         ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:21 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:16 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> Happy St Patrick's Day!
>
>     (I know you are not Irish....but you are closer to Ireland than I am ;)

;-)

> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt <chris.brandt@renesas.com>
>> wrote:
>> > +- clocks: the clock source for the RTC controller.
>>
>> The datasheet mentions 3 possible clock sources?
>
> There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL), and then a clock source that runs the register interface (run off of the p0 clock). So I just need to turn on the p0 clock so I can get at the registers. Note that if you do a hard reset with a RESET button, and all the registers in the chip go back to their POR state, the counter still counts off of the 32KHz XTAL even though the "peripheral clock" is stopped (which just means you can't get to the registers).
>
> In reality, you have to assume the RTC counting source has already been set up by u-boot, or from a past reboot, so I don't do any of that select configuration at all.

it would still be good to have phandles to the external clock sources as well,
as that describes the hardware topology.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:33         ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:33 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:20 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> > --- a/arch/arm/boot/dts/r7s72100.dtsi
>> > +++ b/arch/arm/boot/dts/r7s72100.dtsi
>> > @@ -117,6 +117,15 @@
>> >                         clock-output-names = "ostm0", "ostm1";
>> >                 };
>> >
>> > +               mstp6_clks: mstp6_clks@fcfe042c {
>> > +                       #clock-cells = <1>;
>> > +                       compatible = "renesas,r7s72100-mstp-clocks",
>> "renesas,cpg-mstp-clocks";
>> > +                       reg = <0xfcfe042c 4>;
>> > +                       clocks = <&p0_clk>;
>> > +                       clock-indices = <R7S72100_CLK_RTC>;
>> > +                       clock-output-names = "rtc0";
>>
>> "rtc"? There's only one.
>
> The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver.

Hmm...

> [ from the rtc-sh.c code ]
>
>         clk_id = pdev->id;
>         /* With a single device, the clock id is still "rtc0" */
>         if (clk_id < 0)
>                 clk_id = 0;
>
>         snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id);
>
>         rtc->clk = devm_clk_get(&pdev->dev, clk_name);

So in the absence of an "rtc0" clock in the device node (you don't have
"clock-names" properties in the rtc devvice node yet), it will fall back to
clk_get_sys(), and will find the global "rtc0" clock. Unless you call it
"rtc"...

Most drivers using a single clock just pass NULL instead of a name, so it
will match the first clock found.

I think the simplest solution is to check if your device is instantiated
from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
multiple clocks to the DT bindings) to devm_clk_get() if that's the case.

>         if (IS_ERR(rtc->clk)) {
>                 /*
>                  * No error handling for rtc->clk intentionally, not all
>                  * platforms will have a unique clock for the RTC, and
>                  * the clk API can handle the struct clk pointer being
>                  * NULL.
>                  */
>                 rtc->clk = NULL;
>         }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:33         ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:33 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:20 PM, Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> > --- a/arch/arm/boot/dts/r7s72100.dtsi
>> > +++ b/arch/arm/boot/dts/r7s72100.dtsi
>> > @@ -117,6 +117,15 @@
>> >                         clock-output-names = "ostm0", "ostm1";
>> >                 };
>> >
>> > +               mstp6_clks: mstp6_clks@fcfe042c {
>> > +                       #clock-cells = <1>;
>> > +                       compatible = "renesas,r7s72100-mstp-clocks",
>> "renesas,cpg-mstp-clocks";
>> > +                       reg = <0xfcfe042c 4>;
>> > +                       clocks = <&p0_clk>;
>> > +                       clock-indices = <R7S72100_CLK_RTC>;
>> > +                       clock-output-names = "rtc0";
>>
>> "rtc"? There's only one.
>
> The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver.

Hmm...

> [ from the rtc-sh.c code ]
>
>         clk_id = pdev->id;
>         /* With a single device, the clock id is still "rtc0" */
>         if (clk_id < 0)
>                 clk_id = 0;
>
>         snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id);
>
>         rtc->clk = devm_clk_get(&pdev->dev, clk_name);

So in the absence of an "rtc0" clock in the device node (you don't have
"clock-names" properties in the rtc devvice node yet), it will fall back to
clk_get_sys(), and will find the global "rtc0" clock. Unless you call it
"rtc"...

Most drivers using a single clock just pass NULL instead of a name, so it
will match the first clock found.

I think the simplest solution is to check if your device is instantiated
from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
multiple clocks to the DT bindings) to devm_clk_get() if that's the case.

>         if (IS_ERR(rtc->clk)) {
>                 /*
>                  * No error handling for rtc->clk intentionally, not all
>                  * platforms will have a unique clock for the RTC, and
>                  * the clk API can handle the struct clk pointer being
>                  * NULL.
>                  */
>                 rtc->clk = NULL;
>         }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:33         ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:33 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:20 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> > --- a/arch/arm/boot/dts/r7s72100.dtsi
>> > +++ b/arch/arm/boot/dts/r7s72100.dtsi
>> > @@ -117,6 +117,15 @@
>> >                         clock-output-names = "ostm0", "ostm1";
>> >                 };
>> >
>> > +               mstp6_clks: mstp6_clks@fcfe042c {
>> > +                       #clock-cells = <1>;
>> > +                       compatible = "renesas,r7s72100-mstp-clocks",
>> "renesas,cpg-mstp-clocks";
>> > +                       reg = <0xfcfe042c 4>;
>> > +                       clocks = <&p0_clk>;
>> > +                       clock-indices = <R7S72100_CLK_RTC>;
>> > +                       clock-output-names = "rtc0";
>>
>> "rtc"? There's only one.
>
> The rtc-sh.c code wants to have a number at the end. So if I just put "rtc" as the clock name, it does not find it. Again, I didn't want to break any SH builds, so I just changed the DT to match the driver.

Hmm...

> [ from the rtc-sh.c code ]
>
>         clk_id = pdev->id;
>         /* With a single device, the clock id is still "rtc0" */
>         if (clk_id < 0)
>                 clk_id = 0;
>
>         snprintf(clk_name, sizeof(clk_name), "rtc%d", clk_id);
>
>         rtc->clk = devm_clk_get(&pdev->dev, clk_name);

So in the absence of an "rtc0" clock in the device node (you don't have
"clock-names" properties in the rtc devvice node yet), it will fall back to
clk_get_sys(), and will find the global "rtc0" clock. Unless you call it
"rtc"...

Most drivers using a single clock just pass NULL instead of a name, so it
will match the first clock found.

I think the simplest solution is to check if your device is instantiated
from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
multiple clocks to the DT bindings) to devm_clk_get() if that's the case.

>         if (IS_ERR(rtc->clk)) {
>                 /*
>                  * No error handling for rtc->clk intentionally, not all
>                  * platforms will have a unique clock for the RTC, and
>                  * the clk API can handle the struct clk pointer being
>                  * NULL.
>                  */
>                 rtc->clk = NULL;
>         }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:41           ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> >> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt
> >> <chris.brandt@renesas.com>
> >> wrote:
> >> > +- clocks: the clock source for the RTC controller.
> >>
> >> The datasheet mentions 3 possible clock sources?
> >
> > There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL),
> and then a clock source that runs the register interface (run off of the
> p0 clock). So I just need to turn on the p0 clock so I can get at the
> registers. Note that if you do a hard reset with a RESET button, and all
> the registers in the chip go back to their POR state, the counter still
> counts off of the 32KHz XTAL even though the "peripheral clock" is stopped
> (which just means you can't get to the registers).
> >
> > In reality, you have to assume the RTC counting source has already been
> set up by u-boot, or from a past reboot, so I don't do any of that select
> configuration at all.
> 
> it would still be good to have phandles to the external clock sources as
> well, as that describes the hardware topology.

I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver
doesn't need them)


Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:41           ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> >> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt
> >> <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> >> wrote:
> >> > +- clocks: the clock source for the RTC controller.
> >>
> >> The datasheet mentions 3 possible clock sources?
> >
> > There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL),
> and then a clock source that runs the register interface (run off of the
> p0 clock). So I just need to turn on the p0 clock so I can get at the
> registers. Note that if you do a hard reset with a RESET button, and all
> the registers in the chip go back to their POR state, the counter still
> counts off of the 32KHz XTAL even though the "peripheral clock" is stopped
> (which just means you can't get to the registers).
> >
> > In reality, you have to assume the RTC counting source has already been
> set up by u-boot, or from a past reboot, so I don't do any of that select
> configuration at all.
> 
> it would still be good to have phandles to the external clock sources as
> well, as that describes the hardware topology.

I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver
doesn't need them)


Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:41           ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> > On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> >> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt
> >> <chris.brandt@renesas.com>
> >> wrote:
> >> > +- clocks: the clock source for the RTC controller.
> >>
> >> The datasheet mentions 3 possible clock sources?
> >
> > There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL),
> and then a clock source that runs the register interface (run off of the
> p0 clock). So I just need to turn on the p0 clock so I can get at the
> registers. Note that if you do a hard reset with a RESET button, and all
> the registers in the chip go back to their POR state, the counter still
> counts off of the 32KHz XTAL even though the "peripheral clock" is stopped
> (which just means you can't get to the registers).
> >
> > In reality, you have to assume the RTC counting source has already been
> set up by u-boot, or from a past reboot, so I don't do any of that select
> configuration at all.
> 
> it would still be good to have phandles to the external clock sources as
> well, as that describes the hardware topology.

I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver
doesn't need them)


Chris

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:48           ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:48 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> So in the absence of an "rtc0" clock in the device node (you don't have
> "clock-names" properties in the rtc devvice node yet), it will fall back
> to clk_get_sys(), and will find the global "rtc0" clock. Unless you call
> it "rtc"...
> 
> Most drivers using a single clock just pass NULL instead of a name, so it
> will match the first clock found.
> 
> I think the simplest solution is to check if your device is instantiated
> from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
> multiple clocks to the DT bindings) to devm_clk_get() if that's the case.


OK, so leave current SuperH code the way it is, but add the case for
(pdev->dev.of_node != NULL) and do things the 'new way' so I can have
an RTC clock name of "rtc".

Question: Is your idea to add all the clocks (X1, X3, EXTAL), but put the
first one as the peripheral clock (the one that runs the register interface 'p0')?


Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:48           ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:48 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> So in the absence of an "rtc0" clock in the device node (you don't have
> "clock-names" properties in the rtc devvice node yet), it will fall back
> to clk_get_sys(), and will find the global "rtc0" clock. Unless you call
> it "rtc"...
> 
> Most drivers using a single clock just pass NULL instead of a name, so it
> will match the first clock found.
> 
> I think the simplest solution is to check if your device is instantiated
> from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
> multiple clocks to the DT bindings) to devm_clk_get() if that's the case.


OK, so leave current SuperH code the way it is, but add the case for
(pdev->dev.of_node != NULL) and do things the 'new way' so I can have
an RTC clock name of "rtc".

Question: Is your idea to add all the clocks (X1, X3, EXTAL), but put the
first one as the peripheral clock (the one that runs the register interface 'p0')?


Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:48           ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-17 13:48 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Friday, March 17, 2017, Geert Uytterhoeven wrote:
> So in the absence of an "rtc0" clock in the device node (you don't have
> "clock-names" properties in the rtc devvice node yet), it will fall back
> to clk_get_sys(), and will find the global "rtc0" clock. Unless you call
> it "rtc"...
> 
> Most drivers using a single clock just pass NULL instead of a name, so it
> will match the first clock found.
> 
> I think the simplest solution is to check if your device is instantiated
> from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
> multiple clocks to the DT bindings) to devm_clk_get() if that's the case.


OK, so leave current SuperH code the way it is, but add the case for
(pdev->dev.of_node != NULL) and do things the 'new way' so I can have
an RTC clock name of "rtc".

Question: Is your idea to add all the clocks (X1, X3, EXTAL), but put the
first one as the peripheral clock (the one that runs the register interface 'p0')?


Chris


^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:55             ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:55 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:41 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> > On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> >> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt
>> >> <chris.brandt@renesas.com>
>> >> wrote:
>> >> > +- clocks: the clock source for the RTC controller.
>> >>
>> >> The datasheet mentions 3 possible clock sources?
>> >
>> > There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL),
>> and then a clock source that runs the register interface (run off of the
>> p0 clock). So I just need to turn on the p0 clock so I can get at the
>> registers. Note that if you do a hard reset with a RESET button, and all
>> the registers in the chip go back to their POR state, the counter still
>> counts off of the 32KHz XTAL even though the "peripheral clock" is stopped
>> (which just means you can't get to the registers).
>> >
>> > In reality, you have to assume the RTC counting source has already been
>> set up by u-boot, or from a past reboot, so I don't do any of that select
>> configuration at all.
>>
>> it would still be good to have phandles to the external clock sources as
>> well, as that describes the hardware topology.
>
> I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
> RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver

You still do something with them, as they'll be linked from the rtc device node.

> doesn't need them)

The driver may use them in the future.
E.g. to select among X1, X3, or EXTAL, depending on availability.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:55             ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:55 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:41 PM, Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> > On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> >> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt
>> >> <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
>> >> wrote:
>> >> > +- clocks: the clock source for the RTC controller.
>> >>
>> >> The datasheet mentions 3 possible clock sources?
>> >
>> > There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL),
>> and then a clock source that runs the register interface (run off of the
>> p0 clock). So I just need to turn on the p0 clock so I can get at the
>> registers. Note that if you do a hard reset with a RESET button, and all
>> the registers in the chip go back to their POR state, the counter still
>> counts off of the 32KHz XTAL even though the "peripheral clock" is stopped
>> (which just means you can't get to the registers).
>> >
>> > In reality, you have to assume the RTC counting source has already been
>> set up by u-boot, or from a past reboot, so I don't do any of that select
>> configuration at all.
>>
>> it would still be good to have phandles to the external clock sources as
>> well, as that describes the hardware topology.
>
> I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
> RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver

You still do something with them, as they'll be linked from the rtc device node.

> doesn't need them)

The driver may use them in the future.
E.g. to select among X1, X3, or EXTAL, depending on availability.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 13:55             ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:55 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:41 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> > On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> >> On Thu, Mar 16, 2017 at 6:51 PM, Chris Brandt
>> >> <chris.brandt@renesas.com>
>> >> wrote:
>> >> > +- clocks: the clock source for the RTC controller.
>> >>
>> >> The datasheet mentions 3 possible clock sources?
>> >
>> > There is the clock source that does the counting (RTC_X1, RTC_X3, XTAL),
>> and then a clock source that runs the register interface (run off of the
>> p0 clock). So I just need to turn on the p0 clock so I can get at the
>> registers. Note that if you do a hard reset with a RESET button, and all
>> the registers in the chip go back to their POR state, the counter still
>> counts off of the 32KHz XTAL even though the "peripheral clock" is stopped
>> (which just means you can't get to the registers).
>> >
>> > In reality, you have to assume the RTC counting source has already been
>> set up by u-boot, or from a past reboot, so I don't do any of that select
>> configuration at all.
>>
>> it would still be good to have phandles to the external clock sources as
>> well, as that describes the hardware topology.
>
> I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
> RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver

You still do something with them, as they'll be linked from the rtc device node.

> doesn't need them)

The driver may use them in the future.
E.g. to select among X1, X3, or EXTAL, depending on availability.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:57             ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:57 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:48 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> So in the absence of an "rtc0" clock in the device node (you don't have
>> "clock-names" properties in the rtc devvice node yet), it will fall back
>> to clk_get_sys(), and will find the global "rtc0" clock. Unless you call
>> it "rtc"...
>>
>> Most drivers using a single clock just pass NULL instead of a name, so it
>> will match the first clock found.
>>
>> I think the simplest solution is to check if your device is instantiated
>> from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
>> multiple clocks to the DT bindings) to devm_clk_get() if that's the case.
>
> OK, so leave current SuperH code the way it is, but add the case for
> (pdev->dev.of_node != NULL) and do things the 'new way' so I can have
> an RTC clock name of "rtc".

Indeed.

> Question: Is your idea to add all the clocks (X1, X3, EXTAL), but put the
> first one as the peripheral clock (the one that runs the register interface 'p0')?

Which one is the peripheral clock doesn't matter if you use clock-names.
The convention is to use "fck" for the functional clock of the device.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:57             ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:57 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:48 PM, Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> So in the absence of an "rtc0" clock in the device node (you don't have
>> "clock-names" properties in the rtc devvice node yet), it will fall back
>> to clk_get_sys(), and will find the global "rtc0" clock. Unless you call
>> it "rtc"...
>>
>> Most drivers using a single clock just pass NULL instead of a name, so it
>> will match the first clock found.
>>
>> I think the simplest solution is to check if your device is instantiated
>> from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
>> multiple clocks to the DT bindings) to devm_clk_get() if that's the case.
>
> OK, so leave current SuperH code the way it is, but add the case for
> (pdev->dev.of_node != NULL) and do things the 'new way' so I can have
> an RTC clock name of "rtc".

Indeed.

> Question: Is your idea to add all the clocks (X1, X3, EXTAL), but put the
> first one as the peripheral clock (the one that runs the register interface 'p0')?

Which one is the peripheral clock doesn't matter if you use clock-names.
The convention is to use "fck" for the functional clock of the device.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 13:57             ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-17 13:57 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Fri, Mar 17, 2017 at 2:48 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Geert Uytterhoeven wrote:
>> So in the absence of an "rtc0" clock in the device node (you don't have
>> "clock-names" properties in the rtc devvice node yet), it will fall back
>> to clk_get_sys(), and will find the global "rtc0" clock. Unless you call
>> it "rtc"...
>>
>> Most drivers using a single clock just pass NULL instead of a name, so it
>> will match the first clock found.
>>
>> I think the simplest solution is to check if your device is instantiated
>> from DT (pdev->dev.of_node != NULL), and pass NULL (or "fck", when you add
>> multiple clocks to the DT bindings) to devm_clk_get() if that's the case.
>
> OK, so leave current SuperH code the way it is, but add the case for
> (pdev->dev.of_node != NULL) and do things the 'new way' so I can have
> an RTC clock name of "rtc".

Indeed.

> Question: Is your idea to add all the clocks (X1, X3, EXTAL), but put the
> first one as the peripheral clock (the one that runs the register interface 'p0')?

Which one is the peripheral clock doesn't matter if you use clock-names.
The convention is to use "fck" for the functional clock of the device.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 15:05               ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:05 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Chris Brandt, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi,

On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
> >> it would still be good to have phandles to the external clock sources as
> >> well, as that describes the hardware topology.
> >
> > I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
> > RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver
> 
> You still do something with them, as they'll be linked from the rtc device node.
> 
> > doesn't need them)
> 
> The driver may use them in the future.
> E.g. to select among X1, X3, or EXTAL, depending on availability.
> 

I'm on Geert's side here, I wouldn't rely on the bootloader to set
everything up correctly.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 15:05               ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:05 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Chris Brandt, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi,

On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
> >> it would still be good to have phandles to the external clock sources as
> >> well, as that describes the hardware topology.
> >
> > I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
> > RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver
> 
> You still do something with them, as they'll be linked from the rtc device node.
> 
> > doesn't need them)
> 
> The driver may use them in the future.
> E.g. to select among X1, X3, or EXTAL, depending on availability.
> 

I'm on Geert's side here, I wouldn't rely on the bootloader to set
everything up correctly.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-17 15:05               ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:05 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Chris Brandt, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi,

On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
> >> it would still be good to have phandles to the external clock sources as
> >> well, as that describes the hardware topology.
> >
> > I'm confused, you mean make new clocks node for RTC_X1 (fixed at 32.768kHZ) and
> > RTC_X3 (fixed at 4MHz), but then not really do anything with then? (the driver
> 
> You still do something with them, as they'll be linked from the rtc device node.
> 
> > doesn't need them)
> 
> The driver may use them in the future.
> E.g. to select among X1, X3, or EXTAL, depending on availability.
> 

I'm on Geert's side here, I wouldn't rely on the bootloader to set
everything up correctly.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 1/5] rtc: rtc-sh: add support for rza series
  2017-03-16 17:51   ` Chris Brandt
@ 2017-03-17 15:11     ` Alexandre Belloni
  -1 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:11 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	Geert Uytterhoeven, rtc-linux, devicetree, linux-renesas-soc


Mostly good, one nitpick:

On 16/03/2017 at 13:51:08 -0400, Chris Brandt wrote:
>  	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
> +	if (res == NULL)

if (!res) is preferred here

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 1/5] rtc: rtc-sh: add support for rza series
@ 2017-03-17 15:11     ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:11 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	Geert Uytterhoeven, rtc-linux, devicetree, linux-renesas-soc


Mostly good, one nitpick:

On 16/03/2017 at 13:51:08 -0400, Chris Brandt wrote:
>  	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
> +	if (res == NULL)

if (!res) is preferred here

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 15:16     ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:16 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	Geert Uytterhoeven, rtc-linux, devicetree, linux-renesas-soc

On 16/03/2017 at 13:51:10 -0400, Chris Brandt wrote:

You should always include a commit message.

> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  arch/arm/boot/dts/r7s72100.dtsi            | 9 +++++++++
>  include/dt-bindings/clock/r7s72100-clock.h | 3 +++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
> index ed62e19..2a42a79 100644
> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -117,6 +117,15 @@
>  			clock-output-names = "ostm0", "ostm1";
>  		};
>  
> +		mstp6_clks: mstp6_clks@fcfe042c {
> +			#clock-cells = <1>;
> +			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> +			reg = <0xfcfe042c 4>;
> +			clocks = <&p0_clk>;
> +			clock-indices = <R7S72100_CLK_RTC>;
> +			clock-output-names = "rtc0";
> +		};
> +
>  		mstp7_clks: mstp7_clks@fcfe0430 {
>  			#clock-cells = <1>;
>  			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
> index cd2ed51..bc256d3 100644
> --- a/include/dt-bindings/clock/r7s72100-clock.h
> +++ b/include/dt-bindings/clock/r7s72100-clock.h
> @@ -29,6 +29,9 @@
>  #define R7S72100_CLK_OSTM0	1
>  #define R7S72100_CLK_OSTM1	0
>  
> +/* MSTP6 */
> +#define R7S72100_CLK_RTC	0
> +
>  /* MSTP7 */
>  #define R7S72100_CLK_ETHER	4
>  
> -- 
> 2.10.1
> 
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 15:16     ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:16 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	Geert Uytterhoeven, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA

On 16/03/2017 at 13:51:10 -0400, Chris Brandt wrote:

You should always include a commit message.

> Signed-off-by: Chris Brandt <chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> ---
>  arch/arm/boot/dts/r7s72100.dtsi            | 9 +++++++++
>  include/dt-bindings/clock/r7s72100-clock.h | 3 +++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
> index ed62e19..2a42a79 100644
> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -117,6 +117,15 @@
>  			clock-output-names = "ostm0", "ostm1";
>  		};
>  
> +		mstp6_clks: mstp6_clks@fcfe042c {
> +			#clock-cells = <1>;
> +			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> +			reg = <0xfcfe042c 4>;
> +			clocks = <&p0_clk>;
> +			clock-indices = <R7S72100_CLK_RTC>;
> +			clock-output-names = "rtc0";
> +		};
> +
>  		mstp7_clks: mstp7_clks@fcfe0430 {
>  			#clock-cells = <1>;
>  			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
> index cd2ed51..bc256d3 100644
> --- a/include/dt-bindings/clock/r7s72100-clock.h
> +++ b/include/dt-bindings/clock/r7s72100-clock.h
> @@ -29,6 +29,9 @@
>  #define R7S72100_CLK_OSTM0	1
>  #define R7S72100_CLK_OSTM1	0
>  
> +/* MSTP6 */
> +#define R7S72100_CLK_RTC	0
> +
>  /* MSTP7 */
>  #define R7S72100_CLK_ETHER	4
>  
> -- 
> 2.10.1
> 
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree
@ 2017-03-17 15:16     ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-17 15:16 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	Geert Uytterhoeven, rtc-linux, devicetree, linux-renesas-soc

On 16/03/2017 at 13:51:10 -0400, Chris Brandt wrote:

You should always include a commit message.

> Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
> ---
>  arch/arm/boot/dts/r7s72100.dtsi            | 9 +++++++++
>  include/dt-bindings/clock/r7s72100-clock.h | 3 +++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r7s72100.dtsi b/arch/arm/boot/dts/r7s72100.dtsi
> index ed62e19..2a42a79 100644
> --- a/arch/arm/boot/dts/r7s72100.dtsi
> +++ b/arch/arm/boot/dts/r7s72100.dtsi
> @@ -117,6 +117,15 @@
>  			clock-output-names = "ostm0", "ostm1";
>  		};
>  
> +		mstp6_clks: mstp6_clks@fcfe042c {
> +			#clock-cells = <1>;
> +			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> +			reg = <0xfcfe042c 4>;
> +			clocks = <&p0_clk>;
> +			clock-indices = <R7S72100_CLK_RTC>;
> +			clock-output-names = "rtc0";
> +		};
> +
>  		mstp7_clks: mstp7_clks@fcfe0430 {
>  			#clock-cells = <1>;
>  			compatible = "renesas,r7s72100-mstp-clocks", "renesas,cpg-mstp-clocks";
> diff --git a/include/dt-bindings/clock/r7s72100-clock.h b/include/dt-bindings/clock/r7s72100-clock.h
> index cd2ed51..bc256d3 100644
> --- a/include/dt-bindings/clock/r7s72100-clock.h
> +++ b/include/dt-bindings/clock/r7s72100-clock.h
> @@ -29,6 +29,9 @@
>  #define R7S72100_CLK_OSTM0	1
>  #define R7S72100_CLK_OSTM1	0
>  
> +/* MSTP6 */
> +#define R7S72100_CLK_RTC	0
> +
>  /* MSTP7 */
>  #define R7S72100_CLK_ETHER	4
>  
> -- 
> 2.10.1
> 
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 15:05                 ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-20 15:05 UTC (permalink / raw)
  To: Alexandre Belloni, Geert Uytterhoeven
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	RTCLINUX, devicetree, Linux-Renesas

Hi Alexandre and Geert,


On Friday, March 17, 2017, Alexandre Belloni wrote:
> On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
> > >> it would still be good to have phandles to the external clock
> > >> sources as well, as that describes the hardware topology.
> > >
> > > I'm confused, you mean make new clocks node for RTC_X1 (fixed at
> > > 32.768kHZ) and
> > > RTC_X3 (fixed at 4MHz), but then not really do anything with then?
> > > (the driver
> >
> > You still do something with them, as they'll be linked from the rtc
> device node.
> >
> > > doesn't need them)
> >
> > The driver may use them in the future.
> > E.g. to select among X1, X3, or EXTAL, depending on availability.
> >
> 
> I'm on Geert's side here, I wouldn't rely on the bootloader to set
> everything up correctly.

Part of my hesitation to putting in the clock source selection was that
this RTC block is used in a lot of parts, and it's always the same,
except for the last 3 registers which are different from device to
device because different SoCs have different clock sources options
and ways to set them up. So, making a driver that just 'reads' the
time seemed safer/easier.
Anyway, I'll add the clock setup in if that's the general consensus.


But, before I send out an updated version, what were you thinking
my DT should look like?

Should I make a "count-source" property for user to select what clock
will be used for the actually counting?


	clocks {
		ranges;
		#address-cells = <1>;
		#size-cells = <1>;
            . . .

+		rtc_x1_clk: rtc_x1 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* If clk present, value must be set by board to 32678 */
+			clock-frequency = <0>;
+		};
+
+		rtc_x3_clk: rtc_x3 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* If clk present, value must be set by board to 4000000 */
+			clock-frequency = <0>;
+		};
+




+	rtc: rtc@fcff1000 {
+		compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+		reg = <0xfcff1000 0x2e>;
+		interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "alarm", "period", "carry";
+		clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
+			  <&extal_clk> , <&rtc_x3_clk>;
+		clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
+		power-domains = <&cpg_clocks>;
+		count-source = "rtc_x1";    <<<<<<< this would be in the board dts file
+		status = "disabled";
+	};


Thank you,
Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 15:05                 ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-20 15:05 UTC (permalink / raw)
  To: Alexandre Belloni, Geert Uytterhoeven
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA, Linux-Renesas

Hi Alexandre and Geert,


On Friday, March 17, 2017, Alexandre Belloni wrote:
> On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
> > >> it would still be good to have phandles to the external clock
> > >> sources as well, as that describes the hardware topology.
> > >
> > > I'm confused, you mean make new clocks node for RTC_X1 (fixed at
> > > 32.768kHZ) and
> > > RTC_X3 (fixed at 4MHz), but then not really do anything with then?
> > > (the driver
> >
> > You still do something with them, as they'll be linked from the rtc
> device node.
> >
> > > doesn't need them)
> >
> > The driver may use them in the future.
> > E.g. to select among X1, X3, or EXTAL, depending on availability.
> >
> 
> I'm on Geert's side here, I wouldn't rely on the bootloader to set
> everything up correctly.

Part of my hesitation to putting in the clock source selection was that
this RTC block is used in a lot of parts, and it's always the same,
except for the last 3 registers which are different from device to
device because different SoCs have different clock sources options
and ways to set them up. So, making a driver that just 'reads' the
time seemed safer/easier.
Anyway, I'll add the clock setup in if that's the general consensus.


But, before I send out an updated version, what were you thinking
my DT should look like?

Should I make a "count-source" property for user to select what clock
will be used for the actually counting?


	clocks {
		ranges;
		#address-cells = <1>;
		#size-cells = <1>;
            . . .

+		rtc_x1_clk: rtc_x1 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* If clk present, value must be set by board to 32678 */
+			clock-frequency = <0>;
+		};
+
+		rtc_x3_clk: rtc_x3 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* If clk present, value must be set by board to 4000000 */
+			clock-frequency = <0>;
+		};
+




+	rtc: rtc@fcff1000 {
+		compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+		reg = <0xfcff1000 0x2e>;
+		interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "alarm", "period", "carry";
+		clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
+			  <&extal_clk> , <&rtc_x3_clk>;
+		clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
+		power-domains = <&cpg_clocks>;
+		count-source = "rtc_x1";    <<<<<<< this would be in the board dts file
+		status = "disabled";
+	};


Thank you,
Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 15:05                 ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-20 15:05 UTC (permalink / raw)
  To: Alexandre Belloni, Geert Uytterhoeven
  Cc: Alessandro Zummo, Rob Herring, Mark Rutland, Simon Horman,
	RTCLINUX, devicetree, Linux-Renesas

Hi Alexandre and Geert,


On Friday, March 17, 2017, Alexandre Belloni wrote:
> On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
> > >> it would still be good to have phandles to the external clock
> > >> sources as well, as that describes the hardware topology.
> > >
> > > I'm confused, you mean make new clocks node for RTC_X1 (fixed at
> > > 32.768kHZ) and
> > > RTC_X3 (fixed at 4MHz), but then not really do anything with then?
> > > (the driver
> >
> > You still do something with them, as they'll be linked from the rtc
> device node.
> >
> > > doesn't need them)
> >
> > The driver may use them in the future.
> > E.g. to select among X1, X3, or EXTAL, depending on availability.
> >
> 
> I'm on Geert's side here, I wouldn't rely on the bootloader to set
> everything up correctly.

Part of my hesitation to putting in the clock source selection was that
this RTC block is used in a lot of parts, and it's always the same,
except for the last 3 registers which are different from device to
device because different SoCs have different clock sources options
and ways to set them up. So, making a driver that just 'reads' the
time seemed safer/easier.
Anyway, I'll add the clock setup in if that's the general consensus.


But, before I send out an updated version, what were you thinking
my DT should look like?

Should I make a "count-source" property for user to select what clock
will be used for the actually counting?


	clocks {
		ranges;
		#address-cells = <1>;
		#size-cells = <1>;
            . . .

+		rtc_x1_clk: rtc_x1 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* If clk present, value must be set by board to 32678 */
+			clock-frequency = <0>;
+		};
+
+		rtc_x3_clk: rtc_x3 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* If clk present, value must be set by board to 4000000 */
+			clock-frequency = <0>;
+		};
+




+	rtc: rtc@fcff1000 {
+		compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
+		reg = <0xfcff1000 0x2e>;
+		interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 277 IRQ_TYPE_EDGE_RISING
+			      GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "alarm", "period", "carry";
+		clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
+			  <&extal_clk> , <&rtc_x3_clk>;
+		clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
+		power-domains = <&cpg_clocks>;
+		count-source = "rtc_x1";    <<<<<<< this would be in the board dts file
+		status = "disabled";
+	};


Thank you,
Chris

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 16:03                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-20 16:03 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alexandre Belloni, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Mon, Mar 20, 2017 at 4:05 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Alexandre Belloni wrote:
>> On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
>> > >> it would still be good to have phandles to the external clock
>> > >> sources as well, as that describes the hardware topology.
>> > > I'm confused, you mean make new clocks node for RTC_X1 (fixed at
>> > > 32.768kHZ) and
>> > > RTC_X3 (fixed at 4MHz), but then not really do anything with then?
>> > > (the driver
>> >
>> > You still do something with them, as they'll be linked from the rtc
>> device node.
>> >
>> > > doesn't need them)
>> >
>> > The driver may use them in the future.
>> > E.g. to select among X1, X3, or EXTAL, depending on availability.
>>
>> I'm on Geert's side here, I wouldn't rely on the bootloader to set
>> everything up correctly.
>
> Part of my hesitation to putting in the clock source selection was that
> this RTC block is used in a lot of parts, and it's always the same,
> except for the last 3 registers which are different from device to
> device because different SoCs have different clock sources options
> and ways to set them up. So, making a driver that just 'reads' the
> time seemed safer/easier.
> Anyway, I'll add the clock setup in if that's the general consensus.
>
> But, before I send out an updated version, what were you thinking
> my DT should look like?
>
> Should I make a "count-source" property for user to select what clock
> will be used for the actually counting?
>
>
>         clocks {
>                 ranges;
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>             . . .
>
> +               rtc_x1_clk: rtc_x1 {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       /* If clk present, value must be set by board to 32678 */
> +                       clock-frequency = <0>;
> +               };
> +
> +               rtc_x3_clk: rtc_x3 {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       /* If clk present, value must be set by board to 4000000 */
> +                       clock-frequency = <0>;
> +               };
> +
>
>
>
>
> +       rtc: rtc@fcff1000 {
> +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +               reg = <0xfcff1000 0x2e>;
> +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> +               interrupt-names = "alarm", "period", "carry";
> +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> +                         <&extal_clk> , <&rtc_x3_clk>;
> +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> +               power-domains = <&cpg_clocks>;
> +               count-source = "rtc_x1";    <<<<<<< this would be in the board dts file

IMHO that's software policy, not hardware description, so it doesn't
belong in DT.

However, by scanning the list of allowed clock names, and looking at clock
rates, the driver can find a suitable clock itself.

> +               status = "disabled";
> +       };

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 16:03                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-20 16:03 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alexandre Belloni, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Chris,

On Mon, Mar 20, 2017 at 4:05 PM, Chris Brandt <Chris.Brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org> wrote:
> On Friday, March 17, 2017, Alexandre Belloni wrote:
>> On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
>> > >> it would still be good to have phandles to the external clock
>> > >> sources as well, as that describes the hardware topology.
>> > > I'm confused, you mean make new clocks node for RTC_X1 (fixed at
>> > > 32.768kHZ) and
>> > > RTC_X3 (fixed at 4MHz), but then not really do anything with then?
>> > > (the driver
>> >
>> > You still do something with them, as they'll be linked from the rtc
>> device node.
>> >
>> > > doesn't need them)
>> >
>> > The driver may use them in the future.
>> > E.g. to select among X1, X3, or EXTAL, depending on availability.
>>
>> I'm on Geert's side here, I wouldn't rely on the bootloader to set
>> everything up correctly.
>
> Part of my hesitation to putting in the clock source selection was that
> this RTC block is used in a lot of parts, and it's always the same,
> except for the last 3 registers which are different from device to
> device because different SoCs have different clock sources options
> and ways to set them up. So, making a driver that just 'reads' the
> time seemed safer/easier.
> Anyway, I'll add the clock setup in if that's the general consensus.
>
> But, before I send out an updated version, what were you thinking
> my DT should look like?
>
> Should I make a "count-source" property for user to select what clock
> will be used for the actually counting?
>
>
>         clocks {
>                 ranges;
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>             . . .
>
> +               rtc_x1_clk: rtc_x1 {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       /* If clk present, value must be set by board to 32678 */
> +                       clock-frequency = <0>;
> +               };
> +
> +               rtc_x3_clk: rtc_x3 {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       /* If clk present, value must be set by board to 4000000 */
> +                       clock-frequency = <0>;
> +               };
> +
>
>
>
>
> +       rtc: rtc@fcff1000 {
> +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +               reg = <0xfcff1000 0x2e>;
> +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> +               interrupt-names = "alarm", "period", "carry";
> +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> +                         <&extal_clk> , <&rtc_x3_clk>;
> +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> +               power-domains = <&cpg_clocks>;
> +               count-source = "rtc_x1";    <<<<<<< this would be in the board dts file

IMHO that's software policy, not hardware description, so it doesn't
belong in DT.

However, by scanning the list of allowed clock names, and looking at clock
rates, the driver can find a suitable clock itself.

> +               status = "disabled";
> +       };

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 16:03                   ` Geert Uytterhoeven
  0 siblings, 0 replies; 74+ messages in thread
From: Geert Uytterhoeven @ 2017-03-20 16:03 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Alexandre Belloni, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Chris,

On Mon, Mar 20, 2017 at 4:05 PM, Chris Brandt <Chris.Brandt@renesas.com> wrote:
> On Friday, March 17, 2017, Alexandre Belloni wrote:
>> On 17/03/2017 at 14:55:48 +0100, Geert Uytterhoeven wrote:
>> > >> it would still be good to have phandles to the external clock
>> > >> sources as well, as that describes the hardware topology.
>> > > I'm confused, you mean make new clocks node for RTC_X1 (fixed at
>> > > 32.768kHZ) and
>> > > RTC_X3 (fixed at 4MHz), but then not really do anything with then?
>> > > (the driver
>> >
>> > You still do something with them, as they'll be linked from the rtc
>> device node.
>> >
>> > > doesn't need them)
>> >
>> > The driver may use them in the future.
>> > E.g. to select among X1, X3, or EXTAL, depending on availability.
>>
>> I'm on Geert's side here, I wouldn't rely on the bootloader to set
>> everything up correctly.
>
> Part of my hesitation to putting in the clock source selection was that
> this RTC block is used in a lot of parts, and it's always the same,
> except for the last 3 registers which are different from device to
> device because different SoCs have different clock sources options
> and ways to set them up. So, making a driver that just 'reads' the
> time seemed safer/easier.
> Anyway, I'll add the clock setup in if that's the general consensus.
>
> But, before I send out an updated version, what were you thinking
> my DT should look like?
>
> Should I make a "count-source" property for user to select what clock
> will be used for the actually counting?
>
>
>         clocks {
>                 ranges;
>                 #address-cells = <1>;
>                 #size-cells = <1>;
>             . . .
>
> +               rtc_x1_clk: rtc_x1 {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       /* If clk present, value must be set by board to 32678 */
> +                       clock-frequency = <0>;
> +               };
> +
> +               rtc_x3_clk: rtc_x3 {
> +                       #clock-cells = <0>;
> +                       compatible = "fixed-clock";
> +                       /* If clk present, value must be set by board to 4000000 */
> +                       clock-frequency = <0>;
> +               };
> +
>
>
>
>
> +       rtc: rtc@fcff1000 {
> +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> +               reg = <0xfcff1000 0x2e>;
> +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> +               interrupt-names = "alarm", "period", "carry";
> +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> +                         <&extal_clk> , <&rtc_x3_clk>;
> +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> +               power-domains = <&cpg_clocks>;
> +               count-source = "rtc_x1";    <<<<<<< this would be in the board dts file

IMHO that's software policy, not hardware description, so it doesn't
belong in DT.

However, by scanning the list of allowed clock names, and looking at clock
rates, the driver can find a suitable clock itself.

> +               status = "disabled";
> +       };

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 16:26                     ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-20 16:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alexandre Belloni, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > +       rtc: rtc@fcff1000 {
> > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > +               reg = <0xfcff1000 0x2e>;
> > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > +               interrupt-names = "alarm", "period", "carry";
> > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > +                         <&extal_clk> , <&rtc_x3_clk>;
> > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > +               power-domains = <&cpg_clocks>;
> > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> board dts file
> 
> IMHO that's software policy, not hardware description, so it doesn't
> belong in DT.

Really? I'm so confused about what is and isn't the responsibility of DT.


> However, by scanning the list of allowed clock names, and looking at clock
> rates, the driver can find a suitable clock itself.

Yes, I could make the selection automatic by looking that the clock names (and
I will do that for this driver), but what about the case where a user needs
to select something from a list of possible HW options? In other words, where
does 'software option' selection stuff go if not in the DT?


Thanks,
Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 16:26                     ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-20 16:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alexandre Belloni, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

Hi Geert,

On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > +       rtc: rtc@fcff1000 {
> > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > +               reg = <0xfcff1000 0x2e>;
> > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > +               interrupt-names = "alarm", "period", "carry";
> > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > +                         <&extal_clk> , <&rtc_x3_clk>;
> > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > +               power-domains = <&cpg_clocks>;
> > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> board dts file
> 
> IMHO that's software policy, not hardware description, so it doesn't
> belong in DT.

Really? I'm so confused about what is and isn't the responsibility of DT.


> However, by scanning the list of allowed clock names, and looking at clock
> rates, the driver can find a suitable clock itself.

Yes, I could make the selection automatic by looking that the clock names (and
I will do that for this driver), but what about the case where a user needs
to select something from a list of possible HW options? In other words, where
does 'software option' selection stuff go if not in the DT?


Thanks,
Chris

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* RE: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 16:26                     ` Chris Brandt
  0 siblings, 0 replies; 74+ messages in thread
From: Chris Brandt @ 2017-03-20 16:26 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alexandre Belloni, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

Hi Geert,

On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > +       rtc: rtc@fcff1000 {
> > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > +               reg = <0xfcff1000 0x2e>;
> > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > +               interrupt-names = "alarm", "period", "carry";
> > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > +                         <&extal_clk> , <&rtc_x3_clk>;
> > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > +               power-domains = <&cpg_clocks>;
> > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> board dts file
> 
> IMHO that's software policy, not hardware description, so it doesn't
> belong in DT.

Really? I'm so confused about what is and isn't the responsibility of DT.


> However, by scanning the list of allowed clock names, and looking at clock
> rates, the driver can find a suitable clock itself.

Yes, I could make the selection automatic by looking that the clock names (and
I will do that for this driver), but what about the case where a user needs
to select something from a list of possible HW options? In other words, where
does 'software option' selection stuff go if not in the DT?


Thanks,
Chris

^ permalink raw reply	[flat|nested] 74+ messages in thread

* [rtc-linux] Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 22:45                       ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-20 22:45 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Geert Uytterhoeven, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

On 20/03/2017 at 16:26:46 +0000, Chris Brandt wrote:
> Hi Geert,
> 
> On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > > +       rtc: rtc@fcff1000 {
> > > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > > +               reg = <0xfcff1000 0x2e>;
> > > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > > +               interrupt-names = "alarm", "period", "carry";
> > > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > > +                         <&extal_clk> , <&rtc_x3_clk>;
> > > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > > +               power-domains = <&cpg_clocks>;
> > > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> > board dts file
> > 
> > IMHO that's software policy, not hardware description, so it doesn't
> > belong in DT.
> 
> Really? I'm so confused about what is and isn't the responsibility of DT.
> 
> 
> > However, by scanning the list of allowed clock names, and looking at clock
> > rates, the driver can find a suitable clock itself.
> 
> Yes, I could make the selection automatic by looking that the clock names (and
> I will do that for this driver), but what about the case where a user needs
> to select something from a list of possible HW options? In other words, where
> does 'software option' selection stuff go if not in the DT?
> 

If you want you can leave the clock selection logic out of the driver as
long as the DT binding is complete. You dont have to use everything that
is described in the DT.

Regarding the selection, I'd say take the first that is present and not
0 however, if something has already been set, you may not want to
override it. (I know, this is not helping a lot ;) )

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 22:45                       ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-20 22:45 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Geert Uytterhoeven, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux-Renesas

On 20/03/2017 at 16:26:46 +0000, Chris Brandt wrote:
> Hi Geert,
> 
> On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > > +       rtc: rtc@fcff1000 {
> > > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > > +               reg = <0xfcff1000 0x2e>;
> > > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > > +               interrupt-names = "alarm", "period", "carry";
> > > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > > +                         <&extal_clk> , <&rtc_x3_clk>;
> > > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > > +               power-domains = <&cpg_clocks>;
> > > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> > board dts file
> > 
> > IMHO that's software policy, not hardware description, so it doesn't
> > belong in DT.
> 
> Really? I'm so confused about what is and isn't the responsibility of DT.
> 
> 
> > However, by scanning the list of allowed clock names, and looking at clock
> > rates, the driver can find a suitable clock itself.
> 
> Yes, I could make the selection automatic by looking that the clock names (and
> I will do that for this driver), but what about the case where a user needs
> to select something from a list of possible HW options? In other words, where
> does 'software option' selection stuff go if not in the DT?
> 

If you want you can leave the clock selection logic out of the driver as
long as the DT binding is complete. You dont have to use everything that
is described in the DT.

Regarding the selection, I'd say take the first that is present and not
0 however, if something has already been set, you may not want to
override it. (I know, this is not helping a lot ;) )

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 2/5] rtc: Add rtc-sh
@ 2017-03-20 22:45                       ` Alexandre Belloni
  0 siblings, 0 replies; 74+ messages in thread
From: Alexandre Belloni @ 2017-03-20 22:45 UTC (permalink / raw)
  To: Chris Brandt
  Cc: Geert Uytterhoeven, Alessandro Zummo, Rob Herring, Mark Rutland,
	Simon Horman, RTCLINUX, devicetree, Linux-Renesas

On 20/03/2017 at 16:26:46 +0000, Chris Brandt wrote:
> Hi Geert,
> 
> On Monday, March 20, 2017, Geert Uytterhoeven wrote:
> > > +       rtc: rtc@fcff1000 {
> > > +               compatible = "renesas,r7s72100-rtc", "renesas,sh-rtc";
> > > +               reg = <0xfcff1000 0x2e>;
> > > +               interrupts = <GIC_SPI 276 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 277 IRQ_TYPE_EDGE_RISING
> > > +                             GIC_SPI 278 IRQ_TYPE_EDGE_RISING>;
> > > +               interrupt-names = "alarm", "period", "carry";
> > > +               clocks = <&mstp6_clks R7S72100_CLK_RTC>, <&rtc_x1_clk>,
> > > +                         <&extal_clk> , <&rtc_x3_clk>;
> > > +               clock-names = "fck", "rtc_x1", "extal", "rtc_x3";
> > > +               power-domains = <&cpg_clocks>;
> > > +               count-source = "rtc_x1";    <<<<<<< this would be in the
> > board dts file
> > 
> > IMHO that's software policy, not hardware description, so it doesn't
> > belong in DT.
> 
> Really? I'm so confused about what is and isn't the responsibility of DT.
> 
> 
> > However, by scanning the list of allowed clock names, and looking at clock
> > rates, the driver can find a suitable clock itself.
> 
> Yes, I could make the selection automatic by looking that the clock names (and
> I will do that for this driver), but what about the case where a user needs
> to select something from a list of possible HW options? In other words, where
> does 'software option' selection stuff go if not in the DT?
> 

If you want you can leave the clock selection logic out of the driver as
long as the DT binding is complete. You dont have to use everything that
is described in the DT.

Regarding the selection, I'd say take the first that is present and not
0 however, if something has already been set, you may not want to
override it. (I know, this is not helping a lot ;) )

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 74+ messages in thread

* Re: [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1
       [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
@ 2017-03-28 13:38   ` bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w
  0 siblings, 0 replies; 74+ messages in thread
From: bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w @ 2017-03-28 13:38 UTC (permalink / raw)
  To: rtc-linux
  Cc: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ,
	alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ,
	geert-Td1EMuHUCqxL1ZNQvxDV9g, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-renesas-soc-u79uwXL29TY76Z2rM5mHXA,
	chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ


[-- Attachment #1.1: Type: text/plain, Size: 1072 bytes --]


>
>
> Thank you for contacting Mr PAMPHILE this gentleman who gave me a smile 
> again by offering me a loan of 32,000 Dollars and has two of my colleagues 
> who have also received loans at his level without problems instead of 
> getting you through Unwilling individuals, who take to work to defraud the 
> innocent. If you need funding; Lending money or any project to achieve this 
> man will help you achieve it and support you financially.
> Here is his mail: phamphileserge-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org
>

-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #1.2: Type: text/html, Size: 1644 bytes --]

[-- Attachment #2: 113791658.jpg --]
[-- Type: image/jpeg, Size: 37896 bytes --]

^ permalink raw reply	[flat|nested] 74+ messages in thread

end of thread, other threads:[~2017-03-28 13:38 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 17:51 [rtc-linux] [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 Chris Brandt
2017-03-16 17:51 ` Chris Brandt
2017-03-16 17:51 ` Chris Brandt
2017-03-16 17:51 ` [rtc-linux] [PATCH 1/5] rtc: rtc-sh: add support for rza series Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-17  8:22   ` [rtc-linux] " Geert Uytterhoeven
2017-03-17  8:22     ` Geert Uytterhoeven
2017-03-17  8:22     ` Geert Uytterhoeven
2017-03-17 13:17     ` [rtc-linux] " Chris Brandt
2017-03-17 13:17       ` Chris Brandt
2017-03-17 13:17       ` Chris Brandt
2017-03-17 15:11   ` [rtc-linux] " Alexandre Belloni
2017-03-17 15:11     ` Alexandre Belloni
2017-03-16 17:51 ` [rtc-linux] [PATCH 2/5] rtc: Add rtc-sh Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-17  8:17   ` [rtc-linux] " Geert Uytterhoeven
2017-03-17  8:17     ` Geert Uytterhoeven
2017-03-17  8:17     ` Geert Uytterhoeven
2017-03-17 13:16     ` [rtc-linux] " Chris Brandt
2017-03-17 13:16       ` Chris Brandt
2017-03-17 13:16       ` Chris Brandt
2017-03-17 13:21       ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:21         ` Geert Uytterhoeven
2017-03-17 13:21         ` Geert Uytterhoeven
2017-03-17 13:41         ` [rtc-linux] " Chris Brandt
2017-03-17 13:41           ` Chris Brandt
2017-03-17 13:41           ` Chris Brandt
2017-03-17 13:55           ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:55             ` Geert Uytterhoeven
2017-03-17 13:55             ` Geert Uytterhoeven
2017-03-17 15:05             ` [rtc-linux] " Alexandre Belloni
2017-03-17 15:05               ` Alexandre Belloni
2017-03-17 15:05               ` Alexandre Belloni
2017-03-20 15:05               ` [rtc-linux] " Chris Brandt
2017-03-20 15:05                 ` Chris Brandt
2017-03-20 15:05                 ` Chris Brandt
2017-03-20 16:03                 ` [rtc-linux] " Geert Uytterhoeven
2017-03-20 16:03                   ` Geert Uytterhoeven
2017-03-20 16:03                   ` Geert Uytterhoeven
2017-03-20 16:26                   ` [rtc-linux] " Chris Brandt
2017-03-20 16:26                     ` Chris Brandt
2017-03-20 16:26                     ` Chris Brandt
2017-03-20 22:45                     ` [rtc-linux] " Alexandre Belloni
2017-03-20 22:45                       ` Alexandre Belloni
2017-03-20 22:45                       ` Alexandre Belloni
2017-03-16 17:51 ` [rtc-linux] [PATCH 3/5] ARM: dts: r7s72100: add rtc clock to device tree Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-17  8:27   ` [rtc-linux] " Geert Uytterhoeven
2017-03-17  8:27     ` Geert Uytterhoeven
2017-03-17  8:27     ` Geert Uytterhoeven
2017-03-17 13:20     ` [rtc-linux] " Chris Brandt
2017-03-17 13:20       ` Chris Brandt
2017-03-17 13:20       ` Chris Brandt
2017-03-17 13:33       ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:33         ` Geert Uytterhoeven
2017-03-17 13:33         ` Geert Uytterhoeven
2017-03-17 13:48         ` [rtc-linux] " Chris Brandt
2017-03-17 13:48           ` Chris Brandt
2017-03-17 13:48           ` Chris Brandt
2017-03-17 13:57           ` [rtc-linux] " Geert Uytterhoeven
2017-03-17 13:57             ` Geert Uytterhoeven
2017-03-17 13:57             ` Geert Uytterhoeven
2017-03-17 15:16   ` [rtc-linux] " Alexandre Belloni
2017-03-17 15:16     ` Alexandre Belloni
2017-03-17 15:16     ` Alexandre Belloni
2017-03-16 17:51 ` [rtc-linux] [PATCH 4/5] ARM: dts: r7s72100: add rtc " Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51 ` [rtc-linux] [PATCH 5/5] ARM: dts: rskrza1: add rtc DT support Chris Brandt
2017-03-16 17:51   ` Chris Brandt
2017-03-16 17:51   ` Chris Brandt
     [not found] ` <20170316175112.27913-1-chris.brandt-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
2017-03-28 13:38   ` [PATCH 0/5] rtc: Reuse rtc-sh driver to support RZ/A1 bobethtarsi3-Re5JQEeQqe8AvxtiuMwx3w

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.