Skip to contentSkip to conversation

Add pl031 RTC support for Hi6220/HiKey

RFC PATCH In review John Stultz 2 participants 5 messages Jun 1, 2016 – Jun 2, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Add pl031 RTC support for Hi6220/HiKey

This patchset enables the pl031 RTC on the Hi6220 SoC.

I wanted to submit it out for an initial RFC, to see if there were any objections or feedback, and to try to figure out how these two patches should go upstream (independently via separate maintainers trees, or acked and through one?).

thanks
-john

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Wei Xu <[email protected]>
Cc Guodong Xu <[email protected]>
Cc Zhangfei Gao <[email protected]>

Zhangfei Gao (2):
clk: hi6220: Add RTC clock for pl031
arm64: dts: hi6220: Add pl031 RTC support

 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 8 ++++++++
 drivers/clk/hisilicon/clk-hi6220.c        | 2 ++
 include/dt-bindings/clock/hi6220-clock.h  | 5 +++--
 3 files changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
1.9.1
#2 lore raw

RFC PATCH 2/2 arm64: dts: hi6220: Add pl031 RTC support

From: Zhangfei Gao <[email protected]>

Add pl031 rtc0 support to hi6220 dtsi

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Wei Xu <[email protected]>
Cc Guodong Xu <[email protected]>
[jstultz: Forward ported and tweaked commit description]
---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +8 -0
index 189d215..1288995 100644
@@ -336,6 +336,14 @@
 			clock-names = "timer1", "timer2", "apb_pclk";
 		};
 
+		rtc0: rtc@170000 {
+			compatible = "arm,pl031", "arm,primecell";
+			reg = <0x0 0xf8003000 0x0 0x1000>;
+			interrupts = <0 12 4>;
+			clocks = <&ao_ctrl HI6220_RTC0_PCLK>;
+			clock-names = "apb_pclk";
+		};
+
 		pmx0: pinmux@f7010000 {
 			compatible = "pinctrl-single";
 			reg = <0x0 0xf7010000  0x0 0x27c>;
Signature · 1 line
1.9.1
#1 lore raw

RFC PATCH 1/2 clk: hi6220: Add RTC clock for pl031

In reply to John Stultz

From: Zhangfei Gao <[email protected]>

Adds clk support for the pl031 RTC on hi6220

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Wei Xu <[email protected]>
Cc Guodong Xu <[email protected]>
[jstultz: Forward ported, tweaked commit description]
---
 drivers/clk/hisilicon/clk-hi6220.c       | 2 ++
 include/dt-bindings/clock/hi6220-clock.h | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/clk/hisilicon/clk-hi6220.c +2 -0
index f02cb41..76de9a7 100644
@@ -68,6 +68,8 @@ static struct hisi_gate_clock hi6220_separated_gate_clks_ao[] __initdata = {
 	{ HI6220_TIMER7_PCLK, "timer7_pclk", "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 22, 0, },
 	{ HI6220_TIMER8_PCLK, "timer8_pclk", "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 23, 0, },
 	{ HI6220_UART0_PCLK,  "uart0_pclk",  "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 24, 0, },
+	{ HI6220_RTC0_PCLK,   "rtc0_pclk",   "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 25, 0, },
+	{ HI6220_RTC1_PCLK,   "rtc1_pclk",   "clk_tcxo", CLK_SET_RATE_PARENT|CLK_IGNORE_UNUSED, 0x630, 26, 0, },
 };
 
 static void __init hi6220_clk_ao_init(struct device_node *np)
include/dt-bindings/clock/hi6220-clock.h +3 -2
index 70ee383..6b03c84 100644
@@ -55,8 +55,9 @@
 #define HI6220_TIMER7_PCLK	34
 #define HI6220_TIMER8_PCLK	35
 #define HI6220_UART0_PCLK	36
-
-#define HI6220_AO_NR_CLKS	37
+#define HI6220_RTC0_PCLK	37
+#define HI6220_RTC1_PCLK	38
+#define HI6220_AO_NR_CLKS	39
 
 /* clk in Hi6220 systrl */
 /* gate clock */
Signature · 1 line
1.9.1
#3 lore raw

Re: [RFC][PATCH 2/2] arm64: dts: hi6220: Add pl031 RTC support

In reply to John Stultz
Quoted 23 lines · John Stultz

From: Zhangfei Gao <[email protected]>

Add pl031 rtc0 support to hi6220 dtsi

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Wei Xu <[email protected]>
Cc Guodong Xu <[email protected]>
[jstultz: Forward ported and tweaked commit description]
---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 189d215..1288995 100644
@@ -336,6 +336,14 @@
                        clock-names = "timer1", "timer2", "apb_pclk";

arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 346

Quoted 10 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +8 -0
                };
 
+               rtc0: rtc@170000 {
+                       compatible = "arm,pl031", "arm,primecell";
+                       reg = <0x0 0xf8003000 0x0 0x1000>;
+                       interrupts = <0 12 4>;
+                       clocks = <&ao_ctrl HI6220_RTC0_PCLK>;
+                       clock-names = "apb_pclk";
+               };
+

Hi, John

Checked from Hi6220 spec, and verified on HiKey:

+ rtc1: rtc@f8004000 {

+                       compatible = "arm,pl031", "arm,primecell";
+                       reg = <0x0 0xf8004000 0x0 0x1000>;
+                       interrupts = <0 8 4>;
+                       clocks = <&ao_ctrl HI6220_RTC1_PCLK>;
+                       clock-names = "apb_pclk";

+ };
+

Would you please append that into the patch?

-Guodong

Quoted 6 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -1
                pmx0: pinmux@f7010000 {
                        compatible = "pinctrl-single";
                        reg = <0x0 0xf7010000  0x0 0x27c>;
--

1.9.1

#4 lore raw

Re: [RFC][PATCH 2/2] arm64: dts: hi6220: Add pl031 RTC support

Quoted 48 lines · Guodong Xu
Quoted 23 lines · John Stultz

From: Zhangfei Gao <[email protected]>

Add pl031 rtc0 support to hi6220 dtsi

Cc Michael Turquette <[email protected]>
Cc Stephen Boyd <[email protected]>
Cc Rob Herring <[email protected]>
Cc Pawel Moll <[email protected]>
Cc Wei Xu <[email protected]>
Cc Guodong Xu <[email protected]>
[jstultz: Forward ported and tweaked commit description]
---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 189d215..1288995 100644
@@ -336,6 +336,14 @@
                        clock-names = "timer1", "timer2", "apb_pclk";

arch/arm64/boot/dts/hisilicon/hi6220.dtsi line 346

Quoted 10 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +8 -0
                };
 
+               rtc0: rtc@170000 {
+                       compatible = "arm,pl031", "arm,primecell";
+                       reg = <0x0 0xf8003000 0x0 0x1000>;
+                       interrupts = <0 12 4>;
+                       clocks = <&ao_ctrl HI6220_RTC0_PCLK>;
+                       clock-names = "apb_pclk";
+               };
+

Hi, John

Checked from Hi6220 spec, and verified on HiKey:

arch/arm64/boot/dts/hisilicon/hi6220.dtsi +8 -0
+               rtc1: rtc@f8004000 {
+                       compatible = "arm,pl031", "arm,primecell";
+                       reg = <0x0 0xf8004000 0x0 0x1000>;
+                       interrupts = <0 8 4>;
+                       clocks = <&ao_ctrl HI6220_RTC1_PCLK>;
+                       clock-names = "apb_pclk";
+               };
+
Quoted 1 line

Would you please append that into the patch?

Sure. I also noticed the node offset for rtc0 doesn't match the register, so I corrected it as well.

thanks
-john