All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] RTC: omap-rtc: enable for SOC_AM33XX
@ 2012-10-18 15:53 ` Daniel Mack
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 15:53 UTC (permalink / raw)
  To: rtc-linux
  Cc: a.zummo, david-b, linux-omap, linux-arm-kernel, koen, Daniel Mack

The same IP is found on AM33xx as well, so let users select it.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/rtc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 19c03ab..5cb5be7 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -777,7 +777,7 @@ config RTC_DRV_IMXDI
 
 config RTC_DRV_OMAP
 	tristate "TI OMAP1"
-	depends on ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_DAVINCI_DA8XX
+	depends on ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_DAVINCI_DA8XX || SOC_AM33XX
 	help
 	  Say "yes" here to support the real time clock on TI OMAP1 and
 	  DA8xx/OMAP-L13x chips.  This driver can also be built as a
-- 
1.7.11.7


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

* [PATCH 1/3] RTC: omap-rtc: enable for SOC_AM33XX
@ 2012-10-18 15:53 ` Daniel Mack
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 15:53 UTC (permalink / raw)
  To: linux-arm-kernel

The same IP is found on AM33xx as well, so let users select it.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/rtc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 19c03ab..5cb5be7 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -777,7 +777,7 @@ config RTC_DRV_IMXDI
 
 config RTC_DRV_OMAP
 	tristate "TI OMAP1"
-	depends on ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_DAVINCI_DA8XX
+	depends on ARCH_OMAP15XX || ARCH_OMAP16XX || ARCH_OMAP730 || ARCH_DAVINCI_DA8XX || SOC_AM33XX
 	help
 	  Say "yes" here to support the real time clock on TI OMAP1 and
 	  DA8xx/OMAP-L13x chips.  This driver can also be built as a
-- 
1.7.11.7

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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-18 15:53 ` Daniel Mack
@ 2012-10-18 15:53   ` Daniel Mack
  -1 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 15:53 UTC (permalink / raw)
  To: rtc-linux
  Cc: a.zummo, david-b, linux-omap, linux-arm-kernel, koen, Daniel Mack

This is needed as preparation for platforms where using pm runtime usage
is mandatory.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/rtc/rtc-omap.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 0b614e3..baa876e 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
+#include <linux/pm_runtime.h>
 #include <linux/rtc.h>
 #include <linux/bcd.h>
 #include <linux/platform_device.h>
@@ -322,6 +323,9 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
 		goto fail;
 	}
 
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
 	rtc = rtc_device_register(pdev->name, &pdev->dev,
 			&omap_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
@@ -420,6 +424,8 @@ static int __exit omap_rtc_remove(struct platform_device *pdev)
 		free_irq(omap_rtc_alarm, rtc);
 
 	rtc_device_unregister(rtc);
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
 	iounmap(rtc_base);
 	release_mem_region(mem->start, resource_size(mem));
 	return 0;
@@ -442,11 +448,15 @@ static int omap_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 	else
 		rtc_write(0, OMAP_RTC_INTERRUPTS_REG);
 
+	pm_runtime_put_sync(&pdev->dev);
+
 	return 0;
 }
 
 static int omap_rtc_resume(struct platform_device *pdev)
 {
+	pm_runtime_get_sync(&pdev->dev);
+
 	if (device_may_wakeup(&pdev->dev))
 		disable_irq_wake(omap_rtc_alarm);
 	else
-- 
1.7.11.7


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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-18 15:53   ` Daniel Mack
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 15:53 UTC (permalink / raw)
  To: linux-arm-kernel

This is needed as preparation for platforms where using pm runtime usage
is mandatory.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 drivers/rtc/rtc-omap.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 0b614e3..baa876e 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/ioport.h>
 #include <linux/delay.h>
+#include <linux/pm_runtime.h>
 #include <linux/rtc.h>
 #include <linux/bcd.h>
 #include <linux/platform_device.h>
@@ -322,6 +323,9 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
 		goto fail;
 	}
 
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
+
 	rtc = rtc_device_register(pdev->name, &pdev->dev,
 			&omap_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
@@ -420,6 +424,8 @@ static int __exit omap_rtc_remove(struct platform_device *pdev)
 		free_irq(omap_rtc_alarm, rtc);
 
 	rtc_device_unregister(rtc);
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
 	iounmap(rtc_base);
 	release_mem_region(mem->start, resource_size(mem));
 	return 0;
@@ -442,11 +448,15 @@ static int omap_rtc_suspend(struct platform_device *pdev, pm_message_t state)
 	else
 		rtc_write(0, OMAP_RTC_INTERRUPTS_REG);
 
+	pm_runtime_put_sync(&pdev->dev);
+
 	return 0;
 }
 
 static int omap_rtc_resume(struct platform_device *pdev)
 {
+	pm_runtime_get_sync(&pdev->dev);
+
 	if (device_may_wakeup(&pdev->dev))
 		disable_irq_wake(omap_rtc_alarm);
 	else
-- 
1.7.11.7

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

* [PATCH 3/3] RTC: omap-rtc: add DT bindings
  2012-10-18 15:53 ` Daniel Mack
@ 2012-10-18 15:53   ` Daniel Mack
  -1 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 15:53 UTC (permalink / raw)
  To: rtc-linux
  Cc: a.zummo, david-b, linux-omap, linux-arm-kernel, koen, Daniel Mack

This adds bindings for the OMAP RTC driver.

There are currently two compatible string it matches, "ti,omap-rtc" and
"ti,am33xx-rtc". This is done because the AM33xx needs extra registers
to be written in order to unlock the register set.

Also, the OMAP_RTC_OSC_REG can be set up via DT, in particular two bits:

	32KCLK_EN  - Selects external clock source, namely
		     rtc_32k_clk_rtc_32k_clk that is from the
		     32-kHz oscillator

	32KCLK_SEL - 32-kHz clock enable post clock mux of
		     rtc_32k_clk_rtc_32k_aux_clk and
		     rtc_32k_clk_rtc_32k_clk

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 Documentation/devicetree/bindings/rtc/omap-rtc.txt | 25 +++++++
 drivers/rtc/rtc-omap.c                             | 78 ++++++++++++++++++++++
 2 files changed, 103 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/omap-rtc.txt

diff --git a/Documentation/devicetree/bindings/rtc/omap-rtc.txt b/Documentation/devicetree/bindings/rtc/omap-rtc.txt
new file mode 100644
index 0000000..a2abc9c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/omap-rtc.txt
@@ -0,0 +1,25 @@
+* OMAP RTC
+
+Required properties:
+- compatible : Should be "ti,omap-rtc" or "ti,am33xx-rtc"
+
+
+Optional properties for AM33xx
+- ti,rtc-external-osc - Selects external clock source, namely
+			rtc_32k_clk_rtc_32k_clk that is from the
+			32-kHz oscillator
+
+- ti,rtc-32clk-enable - 32-kHz clock enable post clock mux of
+			rtc_32k_clk_rtc_32k_aux_clk and
+			rtc_32k_clk_rtc_32k_clk
+
+Example for AM33xx:
+
+rtc@44e3e000 {
+	compatible = "marvell,am33xx-rtc";
+	reg = <0x44e3e000 0x1000>;
+	interrupts = <75 76>;
+	ti,hwmods = "rtc";
+	ti,rtc-32clk-enable;
+	ti,rtc-external-osc;
+};
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index baa876e..5529719 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -21,6 +21,8 @@
 #include <linux/rtc.h>
 #include <linux/bcd.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <asm/io.h>
 
@@ -65,6 +67,9 @@
 #define OMAP_RTC_COMP_MSB_REG		0x50
 #define OMAP_RTC_OSC_REG		0x54
 
+#define AM33XX_RTC_KICK0R_REG		0x6c
+#define AM33XX_RTC_KICK1R_REG		0x70
+
 /* OMAP_RTC_CTRL_REG bit fields: */
 #define OMAP_RTC_CTRL_SPLIT		(1<<7)
 #define OMAP_RTC_CTRL_DISABLE		(1<<6)
@@ -286,6 +291,76 @@ static struct rtc_class_ops omap_rtc_ops = {
 static int omap_rtc_alarm;
 static int omap_rtc_timer;
 
+enum {
+	OMAP_RTC_HW_OMAP = 0,
+	OMAP_RTC_HW_AM33XX,
+};
+
+#ifdef CONFIG_OF
+static const struct of_device_id of_omap_rtc_match[] = {
+	{
+		.compatible	= "ti,omap-rtc",
+		.data		= (void *) OMAP_RTC_HW_OMAP,
+	},
+	{
+		.compatible	= "ti,am33xx-rtc",
+		.data		= (void *) OMAP_RTC_HW_AM33XX,
+	},
+	{ }
+};
+
+static int omap_rtc_probe_dt(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	const struct of_device_id *match;
+	int hw_type;
+	u32 val;
+
+	match = of_match_device(of_omap_rtc_match, &pdev->dev);
+
+	if (!match)
+		return 0;
+
+	hw_type = (int) match->data;
+
+	if (hw_type == OMAP_RTC_HW_AM33XX) {
+		/*
+		 * From the datasheet:
+		 *
+		 * The kick registers (KICKnR) are used to enable and disable
+		 * write protection on the RTC registers. Out of reset, the RTC
+		 * registers are write-protected. To disable write protection,
+		 * correct keys must be written to the KICKnR registers. The
+		 * Kick0 register allows writing to unlock the kick0 data.
+		 */
+		__raw_writel(0x83e70b13, rtc_base + AM33XX_RTC_KICK0R_REG);
+		__raw_writel(0x95a4f1e0, rtc_base + AM33XX_RTC_KICK1R_REG);
+
+		/* Set RTC_OSC_REG */
+		val = __raw_readl(rtc_base + OMAP_RTC_OSC_REG);
+		if (of_get_property(np, "ti,rtc-32clk-enable", NULL))
+			val |= (1 << 6);
+		else
+			val &= ~(1 << 6);
+
+		if (of_get_property(np, "ti,rtc-external-osc", NULL))
+			val |= (1 << 3);
+		else
+			val &= ~(1 << 3);
+
+		__raw_writel(val, rtc_base + OMAP_RTC_OSC_REG);
+	}
+
+	return 0;
+}
+
+#else
+static int omap_rtc_probe_dt(struct platform_device *pdev)
+{
+	return 0;
+}
+#endif
+
 static int __init omap_rtc_probe(struct platform_device *pdev)
 {
 	struct resource		*res, *mem;
@@ -326,6 +401,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 
+	omap_rtc_probe_dt(pdev);
+
 	rtc = rtc_device_register(pdev->name, &pdev->dev,
 			&omap_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
@@ -483,6 +560,7 @@ static struct platform_driver omap_rtc_driver = {
 	.driver		= {
 		.name	= "omap_rtc",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(of_omap_rtc_match),
 	},
 };
 
-- 
1.7.11.7


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

* [PATCH 3/3] RTC: omap-rtc: add DT bindings
@ 2012-10-18 15:53   ` Daniel Mack
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 15:53 UTC (permalink / raw)
  To: linux-arm-kernel

This adds bindings for the OMAP RTC driver.

There are currently two compatible string it matches, "ti,omap-rtc" and
"ti,am33xx-rtc". This is done because the AM33xx needs extra registers
to be written in order to unlock the register set.

Also, the OMAP_RTC_OSC_REG can be set up via DT, in particular two bits:

	32KCLK_EN  - Selects external clock source, namely
		     rtc_32k_clk_rtc_32k_clk that is from the
		     32-kHz oscillator

	32KCLK_SEL - 32-kHz clock enable post clock mux of
		     rtc_32k_clk_rtc_32k_aux_clk and
		     rtc_32k_clk_rtc_32k_clk

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 Documentation/devicetree/bindings/rtc/omap-rtc.txt | 25 +++++++
 drivers/rtc/rtc-omap.c                             | 78 ++++++++++++++++++++++
 2 files changed, 103 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/omap-rtc.txt

diff --git a/Documentation/devicetree/bindings/rtc/omap-rtc.txt b/Documentation/devicetree/bindings/rtc/omap-rtc.txt
new file mode 100644
index 0000000..a2abc9c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/omap-rtc.txt
@@ -0,0 +1,25 @@
+* OMAP RTC
+
+Required properties:
+- compatible : Should be "ti,omap-rtc" or "ti,am33xx-rtc"
+
+
+Optional properties for AM33xx
+- ti,rtc-external-osc - Selects external clock source, namely
+			rtc_32k_clk_rtc_32k_clk that is from the
+			32-kHz oscillator
+
+- ti,rtc-32clk-enable - 32-kHz clock enable post clock mux of
+			rtc_32k_clk_rtc_32k_aux_clk and
+			rtc_32k_clk_rtc_32k_clk
+
+Example for AM33xx:
+
+rtc at 44e3e000 {
+	compatible = "marvell,am33xx-rtc";
+	reg = <0x44e3e000 0x1000>;
+	interrupts = <75 76>;
+	ti,hwmods = "rtc";
+	ti,rtc-32clk-enable;
+	ti,rtc-external-osc;
+};
diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index baa876e..5529719 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -21,6 +21,8 @@
 #include <linux/rtc.h>
 #include <linux/bcd.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <asm/io.h>
 
@@ -65,6 +67,9 @@
 #define OMAP_RTC_COMP_MSB_REG		0x50
 #define OMAP_RTC_OSC_REG		0x54
 
+#define AM33XX_RTC_KICK0R_REG		0x6c
+#define AM33XX_RTC_KICK1R_REG		0x70
+
 /* OMAP_RTC_CTRL_REG bit fields: */
 #define OMAP_RTC_CTRL_SPLIT		(1<<7)
 #define OMAP_RTC_CTRL_DISABLE		(1<<6)
@@ -286,6 +291,76 @@ static struct rtc_class_ops omap_rtc_ops = {
 static int omap_rtc_alarm;
 static int omap_rtc_timer;
 
+enum {
+	OMAP_RTC_HW_OMAP = 0,
+	OMAP_RTC_HW_AM33XX,
+};
+
+#ifdef CONFIG_OF
+static const struct of_device_id of_omap_rtc_match[] = {
+	{
+		.compatible	= "ti,omap-rtc",
+		.data		= (void *) OMAP_RTC_HW_OMAP,
+	},
+	{
+		.compatible	= "ti,am33xx-rtc",
+		.data		= (void *) OMAP_RTC_HW_AM33XX,
+	},
+	{ }
+};
+
+static int omap_rtc_probe_dt(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	const struct of_device_id *match;
+	int hw_type;
+	u32 val;
+
+	match = of_match_device(of_omap_rtc_match, &pdev->dev);
+
+	if (!match)
+		return 0;
+
+	hw_type = (int) match->data;
+
+	if (hw_type == OMAP_RTC_HW_AM33XX) {
+		/*
+		 * From the datasheet:
+		 *
+		 * The kick registers (KICKnR) are used to enable and disable
+		 * write protection on the RTC registers. Out of reset, the RTC
+		 * registers are write-protected. To disable write protection,
+		 * correct keys must be written to the KICKnR registers. The
+		 * Kick0 register allows writing to unlock the kick0 data.
+		 */
+		__raw_writel(0x83e70b13, rtc_base + AM33XX_RTC_KICK0R_REG);
+		__raw_writel(0x95a4f1e0, rtc_base + AM33XX_RTC_KICK1R_REG);
+
+		/* Set RTC_OSC_REG */
+		val = __raw_readl(rtc_base + OMAP_RTC_OSC_REG);
+		if (of_get_property(np, "ti,rtc-32clk-enable", NULL))
+			val |= (1 << 6);
+		else
+			val &= ~(1 << 6);
+
+		if (of_get_property(np, "ti,rtc-external-osc", NULL))
+			val |= (1 << 3);
+		else
+			val &= ~(1 << 3);
+
+		__raw_writel(val, rtc_base + OMAP_RTC_OSC_REG);
+	}
+
+	return 0;
+}
+
+#else
+static int omap_rtc_probe_dt(struct platform_device *pdev)
+{
+	return 0;
+}
+#endif
+
 static int __init omap_rtc_probe(struct platform_device *pdev)
 {
 	struct resource		*res, *mem;
@@ -326,6 +401,8 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_get_sync(&pdev->dev);
 
+	omap_rtc_probe_dt(pdev);
+
 	rtc = rtc_device_register(pdev->name, &pdev->dev,
 			&omap_rtc_ops, THIS_MODULE);
 	if (IS_ERR(rtc)) {
@@ -483,6 +560,7 @@ static struct platform_driver omap_rtc_driver = {
 	.driver		= {
 		.name	= "omap_rtc",
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(of_omap_rtc_match),
 	},
 };
 
-- 
1.7.11.7

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

* Re: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-18 15:53   ` Daniel Mack
@ 2012-10-18 16:12     ` Vaibhav Hiremath
  -1 siblings, 0 replies; 18+ messages in thread
From: Vaibhav Hiremath @ 2012-10-18 16:12 UTC (permalink / raw)
  To: Daniel Mack
  Cc: rtc-linux, a.zummo, koen, david-b, linux-omap, linux-arm-kernel



On 10/18/2012 9:23 PM, Daniel Mack wrote:
> This is needed as preparation for platforms where using pm runtime usage
> is mandatory.
> 
> Signed-off-by: Daniel Mack <zonque@gmail.com>

It looks like, you just duplicated effort here.
RTC patches have been already submitted quite some time back for AM33xx,
probably you missed to do google before spending time on this.

Patch Series -
http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg23253.html


Denial,
It would be really helpful if you could test these patches and ack them.

Just FYI, we have bunch of parallel activities going inside team to
upstream all the patches/module/drivers/features, so to avoid such
duplication of effort, I suggest you to google for the patches or ping
on mailing list.

Thanks,
Vaibhav

> ---
>  drivers/rtc/rtc-omap.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index 0b614e3..baa876e 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -17,6 +17,7 @@
>  #include <linux/module.h>
>  #include <linux/ioport.h>
>  #include <linux/delay.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/rtc.h>
>  #include <linux/bcd.h>
>  #include <linux/platform_device.h>
> @@ -322,6 +323,9 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>  		goto fail;
>  	}
>  
> +	pm_runtime_enable(&pdev->dev);
> +	pm_runtime_get_sync(&pdev->dev);
> +
>  	rtc = rtc_device_register(pdev->name, &pdev->dev,
>  			&omap_rtc_ops, THIS_MODULE);
>  	if (IS_ERR(rtc)) {
> @@ -420,6 +424,8 @@ static int __exit omap_rtc_remove(struct platform_device *pdev)
>  		free_irq(omap_rtc_alarm, rtc);
>  
>  	rtc_device_unregister(rtc);
> +	pm_runtime_put_sync(&pdev->dev);
> +	pm_runtime_disable(&pdev->dev);
>  	iounmap(rtc_base);
>  	release_mem_region(mem->start, resource_size(mem));
>  	return 0;
> @@ -442,11 +448,15 @@ static int omap_rtc_suspend(struct platform_device *pdev, pm_message_t state)
>  	else
>  		rtc_write(0, OMAP_RTC_INTERRUPTS_REG);
>  
> +	pm_runtime_put_sync(&pdev->dev);
> +
>  	return 0;
>  }
>  
>  static int omap_rtc_resume(struct platform_device *pdev)
>  {
> +	pm_runtime_get_sync(&pdev->dev);
> +
>  	if (device_may_wakeup(&pdev->dev))
>  		disable_irq_wake(omap_rtc_alarm);
>  	else
> 

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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-18 16:12     ` Vaibhav Hiremath
  0 siblings, 0 replies; 18+ messages in thread
From: Vaibhav Hiremath @ 2012-10-18 16:12 UTC (permalink / raw)
  To: linux-arm-kernel



On 10/18/2012 9:23 PM, Daniel Mack wrote:
> This is needed as preparation for platforms where using pm runtime usage
> is mandatory.
> 
> Signed-off-by: Daniel Mack <zonque@gmail.com>

It looks like, you just duplicated effort here.
RTC patches have been already submitted quite some time back for AM33xx,
probably you missed to do google before spending time on this.

Patch Series -
http://www.mail-archive.com/davinci-linux-open-source at linux.davincidsp.com/msg23253.html


Denial,
It would be really helpful if you could test these patches and ack them.

Just FYI, we have bunch of parallel activities going inside team to
upstream all the patches/module/drivers/features, so to avoid such
duplication of effort, I suggest you to google for the patches or ping
on mailing list.

Thanks,
Vaibhav

> ---
>  drivers/rtc/rtc-omap.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index 0b614e3..baa876e 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -17,6 +17,7 @@
>  #include <linux/module.h>
>  #include <linux/ioport.h>
>  #include <linux/delay.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/rtc.h>
>  #include <linux/bcd.h>
>  #include <linux/platform_device.h>
> @@ -322,6 +323,9 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>  		goto fail;
>  	}
>  
> +	pm_runtime_enable(&pdev->dev);
> +	pm_runtime_get_sync(&pdev->dev);
> +
>  	rtc = rtc_device_register(pdev->name, &pdev->dev,
>  			&omap_rtc_ops, THIS_MODULE);
>  	if (IS_ERR(rtc)) {
> @@ -420,6 +424,8 @@ static int __exit omap_rtc_remove(struct platform_device *pdev)
>  		free_irq(omap_rtc_alarm, rtc);
>  
>  	rtc_device_unregister(rtc);
> +	pm_runtime_put_sync(&pdev->dev);
> +	pm_runtime_disable(&pdev->dev);
>  	iounmap(rtc_base);
>  	release_mem_region(mem->start, resource_size(mem));
>  	return 0;
> @@ -442,11 +448,15 @@ static int omap_rtc_suspend(struct platform_device *pdev, pm_message_t state)
>  	else
>  		rtc_write(0, OMAP_RTC_INTERRUPTS_REG);
>  
> +	pm_runtime_put_sync(&pdev->dev);
> +
>  	return 0;
>  }
>  
>  static int omap_rtc_resume(struct platform_device *pdev)
>  {
> +	pm_runtime_get_sync(&pdev->dev);
> +
>  	if (device_may_wakeup(&pdev->dev))
>  		disable_irq_wake(omap_rtc_alarm);
>  	else
> 

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

* Re: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-18 16:12     ` Vaibhav Hiremath
@ 2012-10-18 16:19       ` Daniel Mack
  -1 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 16:19 UTC (permalink / raw)
  To: Vaibhav Hiremath
  Cc: rtc-linux, a.zummo, koen, david-b, linux-omap, linux-arm-kernel

On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> 
> 
> On 10/18/2012 9:23 PM, Daniel Mack wrote:
>> This is needed as preparation for platforms where using pm runtime usage
>> is mandatory.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
> 
> It looks like, you just duplicated effort here.
> RTC patches have been already submitted quite some time back for AM33xx,
> probably you missed to do google before spending time on this.
> 
> Patch Series -
> http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg23253.html

Heh, damn :) I would have thought that so shortly after the merge
window, that code either went in already or is yet missing. Oh well.

> Denial,
> It would be really helpful if you could test these patches and ack them.

Ok, will do tomorrow. What's missing there is support for writing to the
OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
functionality? I need thatkind of setup for my board ...


> Just FYI, we have bunch of parallel activities going inside team to
> upstream all the patches/module/drivers/features, so to avoid such
> duplication of effort, I suggest you to google for the patches or ping
> on mailing list.

Yes, it's more difficult to participate in the AM33xx code than in other
platforms. I'm not complaining about other doing all the hard work
though, it's just a little different.

Anyway - thanks for the heads-up!


Daniel


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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-18 16:19       ` Daniel Mack
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-18 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> 
> 
> On 10/18/2012 9:23 PM, Daniel Mack wrote:
>> This is needed as preparation for platforms where using pm runtime usage
>> is mandatory.
>>
>> Signed-off-by: Daniel Mack <zonque@gmail.com>
> 
> It looks like, you just duplicated effort here.
> RTC patches have been already submitted quite some time back for AM33xx,
> probably you missed to do google before spending time on this.
> 
> Patch Series -
> http://www.mail-archive.com/davinci-linux-open-source at linux.davincidsp.com/msg23253.html

Heh, damn :) I would have thought that so shortly after the merge
window, that code either went in already or is yet missing. Oh well.

> Denial,
> It would be really helpful if you could test these patches and ack them.

Ok, will do tomorrow. What's missing there is support for writing to the
OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
functionality? I need thatkind of setup for my board ...


> Just FYI, we have bunch of parallel activities going inside team to
> upstream all the patches/module/drivers/features, so to avoid such
> duplication of effort, I suggest you to google for the patches or ping
> on mailing list.

Yes, it's more difficult to participate in the AM33xx code than in other
platforms. I'm not complaining about other doing all the hard work
though, it's just a little different.

Anyway - thanks for the heads-up!


Daniel

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

* RE: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-18 16:19       ` Daniel Mack
@ 2012-10-18 16:33         ` Hiremath, Vaibhav
  -1 siblings, 0 replies; 18+ messages in thread
From: Hiremath, Vaibhav @ 2012-10-18 16:33 UTC (permalink / raw)
  To: Daniel Mack
  Cc: a.zummo, rtc-linux, koen, david-b, linux-omap, linux-arm-kernel

On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> > 
> > 
> > On 10/18/2012 9:23 PM, Daniel Mack wrote:
> >> This is needed as preparation for platforms where using pm runtime usage
> >> is mandatory.
> >>
> >> Signed-off-by: Daniel Mack <zonque@gmail.com>
> > 
> > It looks like, you just duplicated effort here.
> > RTC patches have been already submitted quite some time back for AM33xx,
> > probably you missed to do google before spending time on this.
> > 
> > Patch Series -
> > http://www.mail-archive.com/davinci-linux-open-source@linux.davincidsp.com/msg23253.html
> 
> Heh, damn :) I would have thought that so shortly after the merge
> window, that code either went in already or is yet missing. Oh well.
> 
> > Denial,
> > It would be really helpful if you could test these patches and ack them.
> 
> Ok, will do tomorrow. What's missing there is support for writing to the
> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> functionality? I need thatkind of setup for my board ...
> 
> 

This is bit tricky and required more discussion before merging it, 
let me reopen the old discussion which I had started some time back -


RTC OSC clock is required to configure clocksource systemtimer for the 
kernel, and it is important when you get into PM related features.

Please refer the below commit for more reference,

http://marc.info/?l=u-boot&m=135057734713796&w=2


> > Just FYI, we have bunch of parallel activities going inside team to
> > upstream all the patches/module/drivers/features, so to avoid such
> > duplication of effort, I suggest you to google for the patches or ping
> > on mailing list.
> 
> Yes, it's more difficult to participate in the AM33xx code than in other
> platforms. I'm not complaining about other doing all the hard work
> though, it's just a little different.
> 

No its not. Its good that we have so many developers contributing, so now 
its just working together. Recommend you to ping once before spending time, 
so that we can collaboratively work together, even I wouldn't mind you to 
pick/own on-going development and submit it.


Thanks,
Vaibhav
> Anyway - thanks for the heads-up!
> 
> 
> Daniel
> 
> 

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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-18 16:33         ` Hiremath, Vaibhav
  0 siblings, 0 replies; 18+ messages in thread
From: Hiremath, Vaibhav @ 2012-10-18 16:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> > 
> > 
> > On 10/18/2012 9:23 PM, Daniel Mack wrote:
> >> This is needed as preparation for platforms where using pm runtime usage
> >> is mandatory.
> >>
> >> Signed-off-by: Daniel Mack <zonque@gmail.com>
> > 
> > It looks like, you just duplicated effort here.
> > RTC patches have been already submitted quite some time back for AM33xx,
> > probably you missed to do google before spending time on this.
> > 
> > Patch Series -
> > http://www.mail-archive.com/davinci-linux-open-source at linux.davincidsp.com/msg23253.html
> 
> Heh, damn :) I would have thought that so shortly after the merge
> window, that code either went in already or is yet missing. Oh well.
> 
> > Denial,
> > It would be really helpful if you could test these patches and ack them.
> 
> Ok, will do tomorrow. What's missing there is support for writing to the
> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> functionality? I need thatkind of setup for my board ...
> 
> 

This is bit tricky and required more discussion before merging it, 
let me reopen the old discussion which I had started some time back -


RTC OSC clock is required to configure clocksource systemtimer for the 
kernel, and it is important when you get into PM related features.

Please refer the below commit for more reference,

http://marc.info/?l=u-boot&m=135057734713796&w=2


> > Just FYI, we have bunch of parallel activities going inside team to
> > upstream all the patches/module/drivers/features, so to avoid such
> > duplication of effort, I suggest you to google for the patches or ping
> > on mailing list.
> 
> Yes, it's more difficult to participate in the AM33xx code than in other
> platforms. I'm not complaining about other doing all the hard work
> though, it's just a little different.
> 

No its not. Its good that we have so many developers contributing, so now 
its just working together. Recommend you to ping once before spending time, 
so that we can collaboratively work together, even I wouldn't mind you to 
pick/own on-going development and submit it.


Thanks,
Vaibhav
> Anyway - thanks for the heads-up!
> 
> 
> Daniel
> 
> 

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

* RE: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-18 16:33         ` Hiremath, Vaibhav
@ 2012-10-19 10:58           ` Mohammed, Afzal
  -1 siblings, 0 replies; 18+ messages in thread
From: Mohammed, Afzal @ 2012-10-19 10:58 UTC (permalink / raw)
  To: Daniel Mack
  Cc: a.zummo, rtc-linux, koen, david-b, linux-omap, linux-arm-kernel,
	Hiremath, Vaibhav

Hi Daniel,

On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> > On 18.10.2012 18:12, Vaibhav Hiremath wrote:

> > > It would be really helpful if you could test these patches and ack them.

> > Ok, will do tomorrow. What's missing there is support for writing to the
> > OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> > functionality? I need thatkind of setup for my board ...

> This is bit tricky and required more discussion before merging it, 
> let me reopen the old discussion which I had started some time back -
> 
> 
> RTC OSC clock is required to configure clocksource systemtimer for the 
> kernel, and it is important when you get into PM related features.
> 
> Please refer the below commit for more reference,
> 
> http://marc.info/?l=u-boot&m=135057734713796&w=2

Newer version (v4) of omap rtc patches for am335x has been
posted, "rtc: omap dt support (for am33xx)".
In case you can test, please do it over the new series.

You would need also need DT patch that adds DT node to
test (it has been separated from the series as it is
felt that it should not be part of same series),
"arm/dts: am33xx rtc node"

If you are using mainline uboot, you would need the fix as
mentioned by Vaibhav H (as in the link he provided above),
expecting it to reach uboot mainline soon.

If the above is being attempted to achieve in Kernel it
would cause 2-3 seconds delay in boot time (else it had
to be made a module), please refer link provided by
Vaibhav H for more details.

else you can do in current mainline uboot,

mw.l 0x44e3e06c 0x83e70b13
mw.l 0x44e3e070 0x95a4f1e0
mw.b 0x44e3e054 0x48

and then boot kernel.

Regards
Afzal

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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-19 10:58           ` Mohammed, Afzal
  0 siblings, 0 replies; 18+ messages in thread
From: Mohammed, Afzal @ 2012-10-19 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Daniel,

On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> > On 18.10.2012 18:12, Vaibhav Hiremath wrote:

> > > It would be really helpful if you could test these patches and ack them.

> > Ok, will do tomorrow. What's missing there is support for writing to the
> > OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> > functionality? I need thatkind of setup for my board ...

> This is bit tricky and required more discussion before merging it, 
> let me reopen the old discussion which I had started some time back -
> 
> 
> RTC OSC clock is required to configure clocksource systemtimer for the 
> kernel, and it is important when you get into PM related features.
> 
> Please refer the below commit for more reference,
> 
> http://marc.info/?l=u-boot&m=135057734713796&w=2

Newer version (v4) of omap rtc patches for am335x has been
posted, "rtc: omap dt support (for am33xx)".
In case you can test, please do it over the new series.

You would need also need DT patch that adds DT node to
test (it has been separated from the series as it is
felt that it should not be part of same series),
"arm/dts: am33xx rtc node"

If you are using mainline uboot, you would need the fix as
mentioned by Vaibhav H (as in the link he provided above),
expecting it to reach uboot mainline soon.

If the above is being attempted to achieve in Kernel it
would cause 2-3 seconds delay in boot time (else it had
to be made a module), please refer link provided by
Vaibhav H for more details.

else you can do in current mainline uboot,

mw.l 0x44e3e06c 0x83e70b13
mw.l 0x44e3e070 0x95a4f1e0
mw.b 0x44e3e054 0x48

and then boot kernel.

Regards
Afzal

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

* Re: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-19 10:58           ` Mohammed, Afzal
@ 2012-10-21 19:51             ` Daniel Mack
  -1 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-21 19:51 UTC (permalink / raw)
  To: Mohammed, Afzal
  Cc: a.zummo, rtc-linux, koen, david-b, linux-omap, linux-arm-kernel,
	Hiremath, Vaibhav

On 19.10.2012 12:58, Mohammed, Afzal wrote:
> Hi Daniel,
> 
> On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
>> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
>>> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> 
>>>> It would be really helpful if you could test these patches and ack them.
> 
>>> Ok, will do tomorrow. What's missing there is support for writing to the
>>> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
>>> functionality? I need thatkind of setup for my board ...
> 
>> This is bit tricky and required more discussion before merging it, 
>> let me reopen the old discussion which I had started some time back -
>>
>>
>> RTC OSC clock is required to configure clocksource systemtimer for the 
>> kernel, and it is important when you get into PM related features.
>>
>> Please refer the below commit for more reference,
>>
>> http://marc.info/?l=u-boot&m=135057734713796&w=2
> 
> Newer version (v4) of omap rtc patches for am335x has been
> posted, "rtc: omap dt support (for am33xx)".
> In case you can test, please do it over the new series.
> 
> You would need also need DT patch that adds DT node to
> test (it has been separated from the series as it is
> felt that it should not be part of same series),
> "arm/dts: am33xx rtc node"

Agreed. I tested your patches and they do basically the same thing than
mine. You can take my

  Tested-by: Daniel Mack <zonque@gmail.com>

on all patches in this series except for 2/5 which I didn't test as I
don't have any Davinci platform.

> If you are using mainline uboot, you would need the fix as
> mentioned by Vaibhav H (as in the link he provided above),
> expecting it to reach uboot mainline soon.
> 
> If the above is being attempted to achieve in Kernel it
> would cause 2-3 seconds delay in boot time (else it had
> to be made a module), please refer link provided by
> Vaibhav H for more details.
> 
> else you can do in current mainline uboot,
> 
> mw.l 0x44e3e06c 0x83e70b13
> mw.l 0x44e3e070 0x95a4f1e0
> mw.b 0x44e3e054 0x48
>
> and then boot kernel.

I'm surprised that survives the kernel boot, but I'll give it a try. In
case you want to add that logic to the kernel as well, please copy me in
the discussion :)


Thanks,
Daniel


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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-21 19:51             ` Daniel Mack
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Mack @ 2012-10-21 19:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 19.10.2012 12:58, Mohammed, Afzal wrote:
> Hi Daniel,
> 
> On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
>> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
>>> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> 
>>>> It would be really helpful if you could test these patches and ack them.
> 
>>> Ok, will do tomorrow. What's missing there is support for writing to the
>>> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
>>> functionality? I need thatkind of setup for my board ...
> 
>> This is bit tricky and required more discussion before merging it, 
>> let me reopen the old discussion which I had started some time back -
>>
>>
>> RTC OSC clock is required to configure clocksource systemtimer for the 
>> kernel, and it is important when you get into PM related features.
>>
>> Please refer the below commit for more reference,
>>
>> http://marc.info/?l=u-boot&m=135057734713796&w=2
> 
> Newer version (v4) of omap rtc patches for am335x has been
> posted, "rtc: omap dt support (for am33xx)".
> In case you can test, please do it over the new series.
> 
> You would need also need DT patch that adds DT node to
> test (it has been separated from the series as it is
> felt that it should not be part of same series),
> "arm/dts: am33xx rtc node"

Agreed. I tested your patches and they do basically the same thing than
mine. You can take my

  Tested-by: Daniel Mack <zonque@gmail.com>

on all patches in this series except for 2/5 which I didn't test as I
don't have any Davinci platform.

> If you are using mainline uboot, you would need the fix as
> mentioned by Vaibhav H (as in the link he provided above),
> expecting it to reach uboot mainline soon.
> 
> If the above is being attempted to achieve in Kernel it
> would cause 2-3 seconds delay in boot time (else it had
> to be made a module), please refer link provided by
> Vaibhav H for more details.
> 
> else you can do in current mainline uboot,
> 
> mw.l 0x44e3e06c 0x83e70b13
> mw.l 0x44e3e070 0x95a4f1e0
> mw.b 0x44e3e054 0x48
>
> and then boot kernel.

I'm surprised that survives the kernel boot, but I'll give it a try. In
case you want to add that logic to the kernel as well, please copy me in
the discussion :)


Thanks,
Daniel

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

* RE: [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
  2012-10-21 19:51             ` Daniel Mack
@ 2012-10-22  5:59               ` Hiremath, Vaibhav
  -1 siblings, 0 replies; 18+ messages in thread
From: Hiremath, Vaibhav @ 2012-10-22  5:59 UTC (permalink / raw)
  To: Daniel Mack, Mohammed, Afzal
  Cc: a.zummo, rtc-linux, koen, david-b, linux-omap, linux-arm-kernel

On Mon, Oct 22, 2012 at 01:21:37, Daniel Mack wrote:
> On 19.10.2012 12:58, Mohammed, Afzal wrote:
> > Hi Daniel,
> > 
> > On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
> >> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> >>> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> > 
> >>>> It would be really helpful if you could test these patches and ack them.
> > 
> >>> Ok, will do tomorrow. What's missing there is support for writing to the
> >>> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> >>> functionality? I need thatkind of setup for my board ...
> > 
> >> This is bit tricky and required more discussion before merging it, 
> >> let me reopen the old discussion which I had started some time back -
> >>
> >>
> >> RTC OSC clock is required to configure clocksource systemtimer for the 
> >> kernel, and it is important when you get into PM related features.
> >>
> >> Please refer the below commit for more reference,
> >>
> >> http://marc.info/?l=u-boot&m=135057734713796&w=2
> > 
> > Newer version (v4) of omap rtc patches for am335x has been
> > posted, "rtc: omap dt support (for am33xx)".
> > In case you can test, please do it over the new series.
> > 
> > You would need also need DT patch that adds DT node to
> > test (it has been separated from the series as it is
> > felt that it should not be part of same series),
> > "arm/dts: am33xx rtc node"
> 
> Agreed. I tested your patches and they do basically the same thing than
> mine. You can take my
> 
>   Tested-by: Daniel Mack <zonque@gmail.com>
> 

Thanks Daniel for testing these patches.

> on all patches in this series except for 2/5 which I didn't test as I
> don't have any Davinci platform.
> 
> > If you are using mainline uboot, you would need the fix as
> > mentioned by Vaibhav H (as in the link he provided above),
> > expecting it to reach uboot mainline soon.
> > 
> > If the above is being attempted to achieve in Kernel it
> > would cause 2-3 seconds delay in boot time (else it had
> > to be made a module), please refer link provided by
> > Vaibhav H for more details.
> > 
> > else you can do in current mainline uboot,
> > 
> > mw.l 0x44e3e06c 0x83e70b13
> > mw.l 0x44e3e070 0x95a4f1e0
> > mw.b 0x44e3e054 0x48
> >
> > and then boot kernel.
> 
> I'm surprised that survives the kernel boot, but I'll give it a try. In
> case you want to add that logic to the kernel as well, please copy me in
> the discussion :)
> 
> 

Certainly...

Some background information for your reference,
We had some discussion in the past on this, and we decided to make this as a 
fallback mechanism considering following scenarios - 

 - System built with 32k crystal OSC, connected to RTC module

 - System without 32k crystal OSC, as RTC is not used.

 - Boot-Loader dependency for RTC clock enable (required for system-timer)

So the fallback mechanism would be something similar -

http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=58abec6ac010f4f8818caa4a52d16c4802e14acc


Thanks,
Vaibhav

> Thanks,
> Daniel
> 
> 


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

* [PATCH 2/3] RTC: omap-rtc: enable pm_runtime
@ 2012-10-22  5:59               ` Hiremath, Vaibhav
  0 siblings, 0 replies; 18+ messages in thread
From: Hiremath, Vaibhav @ 2012-10-22  5:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Oct 22, 2012 at 01:21:37, Daniel Mack wrote:
> On 19.10.2012 12:58, Mohammed, Afzal wrote:
> > Hi Daniel,
> > 
> > On Thu, Oct 18, 2012 at 22:03:13, Hiremath, Vaibhav wrote:
> >> On Thu, Oct 18, 2012 at 21:49:44, Daniel Mack wrote:
> >>> On 18.10.2012 18:12, Vaibhav Hiremath wrote:
> > 
> >>>> It would be really helpful if you could test these patches and ack them.
> > 
> >>> Ok, will do tomorrow. What's missing there is support for writing to the
> >>> OMAP_RTC_OSC_REG (path 3/3 in my series). Would like me to rebase the
> >>> functionality? I need thatkind of setup for my board ...
> > 
> >> This is bit tricky and required more discussion before merging it, 
> >> let me reopen the old discussion which I had started some time back -
> >>
> >>
> >> RTC OSC clock is required to configure clocksource systemtimer for the 
> >> kernel, and it is important when you get into PM related features.
> >>
> >> Please refer the below commit for more reference,
> >>
> >> http://marc.info/?l=u-boot&m=135057734713796&w=2
> > 
> > Newer version (v4) of omap rtc patches for am335x has been
> > posted, "rtc: omap dt support (for am33xx)".
> > In case you can test, please do it over the new series.
> > 
> > You would need also need DT patch that adds DT node to
> > test (it has been separated from the series as it is
> > felt that it should not be part of same series),
> > "arm/dts: am33xx rtc node"
> 
> Agreed. I tested your patches and they do basically the same thing than
> mine. You can take my
> 
>   Tested-by: Daniel Mack <zonque@gmail.com>
> 

Thanks Daniel for testing these patches.

> on all patches in this series except for 2/5 which I didn't test as I
> don't have any Davinci platform.
> 
> > If you are using mainline uboot, you would need the fix as
> > mentioned by Vaibhav H (as in the link he provided above),
> > expecting it to reach uboot mainline soon.
> > 
> > If the above is being attempted to achieve in Kernel it
> > would cause 2-3 seconds delay in boot time (else it had
> > to be made a module), please refer link provided by
> > Vaibhav H for more details.
> > 
> > else you can do in current mainline uboot,
> > 
> > mw.l 0x44e3e06c 0x83e70b13
> > mw.l 0x44e3e070 0x95a4f1e0
> > mw.b 0x44e3e054 0x48
> >
> > and then boot kernel.
> 
> I'm surprised that survives the kernel boot, but I'll give it a try. In
> case you want to add that logic to the kernel as well, please copy me in
> the discussion :)
> 
> 

Certainly...

Some background information for your reference,
We had some discussion in the past on this, and we decided to make this as a 
fallback mechanism considering following scenarios - 

 - System built with 32k crystal OSC, connected to RTC module

 - System without 32k crystal OSC, as RTC is not used.

 - Boot-Loader dependency for RTC clock enable (required for system-timer)

So the fallback mechanism would be something similar -

http://arago-project.org/git/projects/?p=linux-am33x.git;a=commit;h=58abec6ac010f4f8818caa4a52d16c4802e14acc


Thanks,
Vaibhav

> Thanks,
> Daniel
> 
> 

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

end of thread, other threads:[~2012-10-22  6:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-18 15:53 [PATCH 1/3] RTC: omap-rtc: enable for SOC_AM33XX Daniel Mack
2012-10-18 15:53 ` Daniel Mack
2012-10-18 15:53 ` [PATCH 2/3] RTC: omap-rtc: enable pm_runtime Daniel Mack
2012-10-18 15:53   ` Daniel Mack
2012-10-18 16:12   ` Vaibhav Hiremath
2012-10-18 16:12     ` Vaibhav Hiremath
2012-10-18 16:19     ` Daniel Mack
2012-10-18 16:19       ` Daniel Mack
2012-10-18 16:33       ` Hiremath, Vaibhav
2012-10-18 16:33         ` Hiremath, Vaibhav
2012-10-19 10:58         ` Mohammed, Afzal
2012-10-19 10:58           ` Mohammed, Afzal
2012-10-21 19:51           ` Daniel Mack
2012-10-21 19:51             ` Daniel Mack
2012-10-22  5:59             ` Hiremath, Vaibhav
2012-10-22  5:59               ` Hiremath, Vaibhav
2012-10-18 15:53 ` [PATCH 3/3] RTC: omap-rtc: add DT bindings Daniel Mack
2012-10-18 15:53   ` Daniel Mack

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.