Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
* Add Ingenic X1000 RTC support.
@ 2019-01-28 17:29 Zhou Yanjie
  2019-01-28 17:29 ` [PATCH 1/3] RTC: Ingenic: Add support for the X1000 Zhou Yanjie
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Zhou Yanjie @ 2019-01-28 17:29 UTC (permalink / raw)
  To: linux-mips
  Cc: linux-kernel, linux-rtc, devicetree, a.zummo, alexandre.belloni,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

Add Ingenic X1000 RTC support.



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

* [PATCH 1/3] RTC: Ingenic: Add support for the X1000.
  2019-01-28 17:29 Add Ingenic X1000 RTC support Zhou Yanjie
@ 2019-01-28 17:29 ` Zhou Yanjie
  2019-01-28 17:29 ` [PATCH 2/3] Dt-bindings: RTC: Add X1000 RTC bindings Zhou Yanjie
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Zhou Yanjie @ 2019-01-28 17:29 UTC (permalink / raw)
  To: linux-mips
  Cc: linux-kernel, linux-rtc, devicetree, a.zummo, alexandre.belloni,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

Add support for probing the rtc-jz4740 driver on the
X1000 Soc from Ingenic.

Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
---
 drivers/rtc/rtc-jz4740.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index d0a8917..0c7ae65 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -34,7 +34,7 @@
 #define JZ_REG_RTC_RESET_COUNTER	0x28
 #define JZ_REG_RTC_SCRATCHPAD	0x34
 
-/* The following are present on the jz4780 */
+/* The following are present on the jz4780 and x1000 */
 #define JZ_REG_RTC_WENR	0x3C
 #define JZ_RTC_WENR_WEN	BIT(31)
 
@@ -46,7 +46,7 @@
 #define JZ_RTC_CTRL_AE		BIT(2)
 #define JZ_RTC_CTRL_ENABLE	BIT(0)
 
-/* Magic value to enable writes on jz4780 */
+/* Magic value to enable writes on jz4780 and x1000 */
 #define JZ_RTC_WENR_MAGIC	0xA55A
 
 #define JZ_RTC_WAKEUP_FILTER_MASK	0x0000FFE0
@@ -55,6 +55,7 @@
 enum jz4740_rtc_type {
 	ID_JZ4740,
 	ID_JZ4780,
+	ID_X1000,
 };
 
 struct jz4740_rtc {
@@ -301,6 +302,7 @@ static void jz4740_rtc_power_off(void)
 static const struct of_device_id jz4740_rtc_of_match[] = {
 	{ .compatible = "ingenic,jz4740-rtc", .data = (void *)ID_JZ4740 },
 	{ .compatible = "ingenic,jz4780-rtc", .data = (void *)ID_JZ4780 },
+	{ .compatible = "ingenic,x1000-rtc", .data = (void *)ID_X1000 },
 	{},
 };
 MODULE_DEVICE_TABLE(of, jz4740_rtc_of_match);
@@ -429,6 +431,7 @@ static const struct dev_pm_ops jz4740_pm_ops = {
 static const struct platform_device_id jz4740_rtc_ids[] = {
 	{ "jz4740-rtc", ID_JZ4740 },
 	{ "jz4780-rtc", ID_JZ4780 },
+	{ "x1000-rtc", ID_X1000 },
 	{}
 };
 MODULE_DEVICE_TABLE(platform, jz4740_rtc_ids);
-- 
2.7.4



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

* [PATCH 2/3] Dt-bindings: RTC: Add X1000 RTC bindings.
  2019-01-28 17:29 Add Ingenic X1000 RTC support Zhou Yanjie
  2019-01-28 17:29 ` [PATCH 1/3] RTC: Ingenic: Add support for the X1000 Zhou Yanjie
@ 2019-01-28 17:29 ` Zhou Yanjie
  2019-01-28 20:11   ` Alexandre Belloni
  2019-01-28 17:29 ` [PATCH 3/3] RTC: Ingenic: Replace jz47xx with XBurst Zhou Yanjie
  2019-01-28 20:10 ` Add Ingenic X1000 RTC support Alexandre Belloni
  3 siblings, 1 reply; 9+ messages in thread
From: Zhou Yanjie @ 2019-01-28 17:29 UTC (permalink / raw)
  To: linux-mips
  Cc: linux-kernel, linux-rtc, devicetree, a.zummo, alexandre.belloni,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

Add the RTC bindings for the X1000 Soc from Ingenic.

Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
---
 Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt b/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
index 41c7ae1..7ce0018 100644
--- a/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
+++ b/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
@@ -5,6 +5,7 @@ Required properties:
 - compatible: One of:
   - "ingenic,jz4740-rtc" - for use with the JZ4740 SoC
   - "ingenic,jz4780-rtc" - for use with the JZ4780 SoC
+  - "ingenic,x1000-rtc" - for use with the X1000 SoC
 - reg: Address range of rtc register set
 - interrupts: IRQ number for the alarm interrupt
 - clocks: phandle to the "rtc" clock
-- 
2.7.4



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

* [PATCH 3/3] RTC: Ingenic: Replace jz47xx with XBurst.
  2019-01-28 17:29 Add Ingenic X1000 RTC support Zhou Yanjie
  2019-01-28 17:29 ` [PATCH 1/3] RTC: Ingenic: Add support for the X1000 Zhou Yanjie
  2019-01-28 17:29 ` [PATCH 2/3] Dt-bindings: RTC: Add X1000 RTC bindings Zhou Yanjie
@ 2019-01-28 17:29 ` Zhou Yanjie
  2019-01-28 20:13   ` Alexandre Belloni
  2019-01-28 20:10 ` Add Ingenic X1000 RTC support Alexandre Belloni
  3 siblings, 1 reply; 9+ messages in thread
From: Zhou Yanjie @ 2019-01-28 17:29 UTC (permalink / raw)
  To: linux-mips
  Cc: linux-kernel, linux-rtc, devicetree, a.zummo, alexandre.belloni,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

Ingenic had changed their product code name.
Latest SoCs had divided to several series such as
T30/M200/X1000 and no longer called JZ47xx.

Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
---
 drivers/rtc/Kconfig      |  4 ++--
 drivers/rtc/rtc-jz4740.c | 15 +++------------
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 225b0b8..8b41853 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1576,10 +1576,10 @@ config RTC_DRV_MPC5121
 	  will be called rtc-mpc5121.
 
 config RTC_DRV_JZ4740
-	tristate "Ingenic JZ4740 SoC"
+	tristate "Ingenic XBurst SoC"
 	depends on MIPS || COMPILE_TEST
 	help
-	  If you say yes here you get support for the Ingenic JZ47xx SoCs RTC
+	  If you say yes here you get support for the Ingenic XBurst SoCs RTC
 	  controllers.
 
 	  This driver can also be built as a module. If so, the module
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index 0c7ae65..a262632 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -1,17 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  *  Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
  *  Copyright (C) 2010, Paul Cercueil <paul@crapouillou.net>
- *	 JZ4740 SoC RTC driver
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under  the terms of  the GNU General Public License as published by the
- *  Free Software Foundation;  either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with this program; if not, write to the Free Software Foundation, Inc.,
- *  675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ *	Ingenic XBurst platform RTC support
  */
 
 #include <linux/clk.h>
@@ -450,5 +441,5 @@ module_platform_driver(jz4740_rtc_driver);
 
 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
 MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("RTC driver for the JZ4740 SoC\n");
+MODULE_DESCRIPTION("RTC driver for Ingenic XBurst platform\n");
 MODULE_ALIAS("platform:jz4740-rtc");
-- 
2.7.4



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

* Re: Add Ingenic X1000 RTC support.
  2019-01-28 17:29 Add Ingenic X1000 RTC support Zhou Yanjie
                   ` (2 preceding siblings ...)
  2019-01-28 17:29 ` [PATCH 3/3] RTC: Ingenic: Replace jz47xx with XBurst Zhou Yanjie
@ 2019-01-28 20:10 ` Alexandre Belloni
  2019-01-28 20:48   ` Paul Cercueil
  3 siblings, 1 reply; 9+ messages in thread
From: Alexandre Belloni @ 2019-01-28 20:10 UTC (permalink / raw)
  To: Zhou Yanjie, Paul Cercueil, Lars-Peter Clausen
  Cc: linux-mips, linux-kernel, linux-rtc, devicetree, a.zummo,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

Hello,

This seems like a useless renaming to me, can you elaborate a bit more?

I'd also like to have Paul and Lars-Peter comment.

On 29/01/2019 01:29:56+0800, Zhou Yanjie wrote:
> Add Ingenic X1000 RTC support.
> 
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 2/3] Dt-bindings: RTC: Add X1000 RTC bindings.
  2019-01-28 17:29 ` [PATCH 2/3] Dt-bindings: RTC: Add X1000 RTC bindings Zhou Yanjie
@ 2019-01-28 20:11   ` Alexandre Belloni
  0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2019-01-28 20:11 UTC (permalink / raw)
  To: Zhou Yanjie
  Cc: linux-mips, linux-kernel, linux-rtc, devicetree, a.zummo,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

On 29/01/2019 01:29:58+0800, Zhou Yanjie wrote:
> Add the RTC bindings for the X1000 Soc from Ingenic.
> 

The subject is not properly capitalized and this patch should either
come first or be squashed in the previous one.

> Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
> ---
>  Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt b/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
> index 41c7ae1..7ce0018 100644
> --- a/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
> +++ b/Documentation/devicetree/bindings/rtc/ingenic,jz4740-rtc.txt
> @@ -5,6 +5,7 @@ Required properties:
>  - compatible: One of:
>    - "ingenic,jz4740-rtc" - for use with the JZ4740 SoC
>    - "ingenic,jz4780-rtc" - for use with the JZ4780 SoC
> +  - "ingenic,x1000-rtc" - for use with the X1000 SoC
>  - reg: Address range of rtc register set
>  - interrupts: IRQ number for the alarm interrupt
>  - clocks: phandle to the "rtc" clock
> -- 
> 2.7.4
> 
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 3/3] RTC: Ingenic: Replace jz47xx with XBurst.
  2019-01-28 17:29 ` [PATCH 3/3] RTC: Ingenic: Replace jz47xx with XBurst Zhou Yanjie
@ 2019-01-28 20:13   ` Alexandre Belloni
  0 siblings, 0 replies; 9+ messages in thread
From: Alexandre Belloni @ 2019-01-28 20:13 UTC (permalink / raw)
  To: Zhou Yanjie
  Cc: linux-mips, linux-kernel, linux-rtc, devicetree, a.zummo,
	robh+dt, paul.burton, mark.rutland, syq, jiaxun.yang, 772753199

On 29/01/2019 01:29:59+0800, Zhou Yanjie wrote:
> Ingenic had changed their product code name.
> Latest SoCs had divided to several series such as
> T30/M200/X1000 and no longer called JZ47xx.
> 
> Signed-off-by: Zhou Yanjie <zhouyanjie@zoho.com>
> ---
>  drivers/rtc/Kconfig      |  4 ++--
>  drivers/rtc/rtc-jz4740.c | 15 +++------------
>  2 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 225b0b8..8b41853 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1576,10 +1576,10 @@ config RTC_DRV_MPC5121
>  	  will be called rtc-mpc5121.
>  
>  config RTC_DRV_JZ4740
> -	tristate "Ingenic JZ4740 SoC"
> +	tristate "Ingenic XBurst SoC"
>  	depends on MIPS || COMPILE_TEST
>  	help
> -	  If you say yes here you get support for the Ingenic JZ47xx SoCs RTC
> +	  If you say yes here you get support for the Ingenic XBurst SoCs RTC
>  	  controllers.
>  
>  	  This driver can also be built as a module. If so, the module
> diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
> index 0c7ae65..a262632 100644
> --- a/drivers/rtc/rtc-jz4740.c
> +++ b/drivers/rtc/rtc-jz4740.c
> @@ -1,17 +1,8 @@
> +// SPDX-License-Identifier: GPL-2.0
>  /*
>   *  Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
>   *  Copyright (C) 2010, Paul Cercueil <paul@crapouillou.net>
> - *	 JZ4740 SoC RTC driver
> - *
> - *  This program is free software; you can redistribute it and/or modify it
> - *  under  the terms of  the GNU General Public License as published by the
> - *  Free Software Foundation;  either version 2 of the License, or (at your
> - *  option) any later version.
> - *
> - *  You should have received a copy of the GNU General Public License along
> - *  with this program; if not, write to the Free Software Foundation, Inc.,
> - *  675 Mass Ave, Cambridge, MA 02139, USA.
> - *

This change is unrelated.

> + *	Ingenic XBurst platform RTC support
>   */
>  
>  #include <linux/clk.h>
> @@ -450,5 +441,5 @@ module_platform_driver(jz4740_rtc_driver);
>  
>  MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
>  MODULE_LICENSE("GPL");
> -MODULE_DESCRIPTION("RTC driver for the JZ4740 SoC\n");
> +MODULE_DESCRIPTION("RTC driver for Ingenic XBurst platform\n");
>  MODULE_ALIAS("platform:jz4740-rtc");
> -- 
> 2.7.4
> 
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: Add Ingenic X1000 RTC support.
  2019-01-28 20:10 ` Add Ingenic X1000 RTC support Alexandre Belloni
@ 2019-01-28 20:48   ` Paul Cercueil
  2019-01-29  3:53     ` Zhou Yanjie
  0 siblings, 1 reply; 9+ messages in thread
From: Paul Cercueil @ 2019-01-28 20:48 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Zhou Yanjie, Lars-Peter Clausen, linux-mips, linux-kernel,
	linux-rtc, devicetree, a.zummo, robh+dt, paul.burton,
	mark.rutland, syq, jiaxun.yang, 772753199

Hi,

> Hello,
> 
> This seems like a useless renaming to me, can you elaborate a bit 
> more?
> 
> I'd also like to have Paul and Lars-Peter comment.

According to the patchset, the RTC in the X1000 does not behave any 
different
than the one in the JZ4780 SoC. Therefore patches 1/2 should be dropped.
In your devicetree bindings, just use the "ingenic,jz4780-rtc" 
compatible
string instead. The same goes for all the drivers (e.g. the uart one).

I don't really mind the renaming, maybe replace "Ingenic JZ47xx SoCs" 
with
just "Ingenic SoCs" since XBurst is just the name of the CPU inside 
these
SoCs.

Regards,
-Paul


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

* Re: Add Ingenic X1000 RTC support.
  2019-01-28 20:48   ` Paul Cercueil
@ 2019-01-29  3:53     ` Zhou Yanjie
  0 siblings, 0 replies; 9+ messages in thread
From: Zhou Yanjie @ 2019-01-29  3:53 UTC (permalink / raw)
  To: Paul Cercueil, Alexandre Belloni
  Cc: Lars-Peter Clausen, linux-mips, linux-kernel, linux-rtc,
	devicetree, a.zummo, robh+dt, paul.burton, mark.rutland, syq,
	jiaxun.yang, 772753199

OK, thanks for your suggestions. I'll drop this patch.

On 2019年01月29日 04:48, Paul Cercueil wrote:
> Hi,
>
>> Hello,
>>
>> This seems like a useless renaming to me, can you elaborate a bit more?
>>
>> I'd also like to have Paul and Lars-Peter comment.
>
> According to the patchset, the RTC in the X1000 does not behave any 
> different
> than the one in the JZ4780 SoC. Therefore patches 1/2 should be dropped.
> In your devicetree bindings, just use the "ingenic,jz4780-rtc" compatible
> string instead. The same goes for all the drivers (e.g. the uart one).
>
> I don't really mind the renaming, maybe replace "Ingenic JZ47xx SoCs" 
> with
> just "Ingenic SoCs" since XBurst is just the name of the CPU inside these
> SoCs.
>
> Regards,
> -Paul
>




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

end of thread, back to index

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28 17:29 Add Ingenic X1000 RTC support Zhou Yanjie
2019-01-28 17:29 ` [PATCH 1/3] RTC: Ingenic: Add support for the X1000 Zhou Yanjie
2019-01-28 17:29 ` [PATCH 2/3] Dt-bindings: RTC: Add X1000 RTC bindings Zhou Yanjie
2019-01-28 20:11   ` Alexandre Belloni
2019-01-28 17:29 ` [PATCH 3/3] RTC: Ingenic: Replace jz47xx with XBurst Zhou Yanjie
2019-01-28 20:13   ` Alexandre Belloni
2019-01-28 20:10 ` Add Ingenic X1000 RTC support Alexandre Belloni
2019-01-28 20:48   ` Paul Cercueil
2019-01-29  3:53     ` Zhou Yanjie

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org linux-rtc@archiver.kernel.org
	public-inbox-index linux-rtc


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/ public-inbox