Skip to contentSkip to conversation

clk: hi6220: add acpu clock

PATCH Superseded Zhangfei Gao 5 participants 10 messages Apr 18, 2017 – Aug 16, 2017

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

PATCH 1/2 clk: hi6220: add acpu clock

Add acpu clock, including sft clock controlling hi6220 coresight module

---
 .../devicetree/bindings/clock/hi6220-clock.txt     |  1 +
 drivers/clk/hisilicon/clk-hi6220.c                 | 23 ++++++++++++++++++++++
 include/dt-bindings/clock/hi6220-clock.h           |  4 ++++
 3 files changed, 28 insertions(+)
Documentation/devicetree/bindings/clock/hi6220-clock.txt +1 -0
index e4d5fea..ef3deb7 100644
@@ -11,6 +11,7 @@ Required Properties:
 - compatible: the compatible should be one of the following strings to
 	indicate the clock controller functionality.
 
+	- "hisilicon,hi6220-acpu-sctrl"
 	- "hisilicon,hi6220-aoctrl"
 	- "hisilicon,hi6220-sysctrl"
 	- "hisilicon,hi6220-mediactrl"
drivers/clk/hisilicon/clk-hi6220.c +23 -0
index 2ae151c..fc8813f 100644
@@ -285,3 +285,26 @@ static void __init hi6220_clk_power_init(struct device_node *np)
 				ARRAY_SIZE(hi6220_div_clks_power), clk_data);
 }
 CLK_OF_DECLARE(hi6220_clk_power, "hisilicon,hi6220-pmctrl", hi6220_clk_power_init);
+
+
+/* clocks in acpu */
+static const struct hisi_gate_clock hi6220_acpu_sc_gate_sep_clks[] = {
+	{ HI6220_ACPU_SFT_AT_S, "sft_at_s", "cs_atb",
+	  CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, 0xc, 11, 0, },
+};
+
+static void __init hi6220_clk_acpu_init(struct device_node *np)
+{
+	struct hisi_clock_data *clk_data;
+	int nr = ARRAY_SIZE(hi6220_acpu_sc_gate_sep_clks);
+
+	clk_data = hisi_clk_init(np, nr);
+	if (!clk_data)
+		return;
+
+	hisi_clk_register_gate_sep(hi6220_acpu_sc_gate_sep_clks,
+				   ARRAY_SIZE(hi6220_acpu_sc_gate_sep_clks),
+				   clk_data);
+}
+
+CLK_OF_DECLARE(hi6220_clk_acpu, "hisilicon,hi6220-acpu-sctrl", hi6220_clk_acpu_init);
include/dt-bindings/clock/hi6220-clock.h +4 -0
index b8ba665..409cc02 100644
@@ -174,4 +174,8 @@
 #define HI6220_DDRC_AXI1	7
 
 #define HI6220_POWER_NR_CLKS	8
+
+/* clk in Hi6220 acpu sctrl */
+#define HI6220_ACPU_SFT_AT_S		0
+
 #endif
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 arm64: dts: hi6220: add acpu_sctrl

Add acpu_sctrl clock node

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +6 -0
index 470461d..710cc34 100644
@@ -262,6 +262,12 @@
 			#clock-cells = <1>;
 		};
 
+		acpu_sctrl: acpu_sctrl at f7032000 {
+			compatible = "hisilicon,hi6220-acpu-sctrl", "syscon";
+			reg = <0x0 0xf6504000 0x0 0x1000>;
+			#clock-cells = <1>;
+		};
+
 		medianoc_ade: medianoc_ade at f4520000 {
 			compatible = "syscon";
 			reg = <0x0 0xf4520000 0x0 0x4000>;
Signature · 1 line
2.7.4
maintainer
#2 lore raw

PATCH 2/2 arm64: dts: hi6220: add acpu_sctrl

Hi Zhangfei,

Quoted 4 lines · Zhangfei Gao

Add acpu_sctrl clock node

Fine to me. Thanks!

BR,
Wei

Quoted 22 lines
---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +6 -0
index 470461d..710cc34 100644
@@ -262,6 +262,12 @@
 			#clock-cells = <1>;
 		};
 
+		acpu_sctrl: acpu_sctrl at f7032000 {
+			compatible = "hisilicon,hi6220-acpu-sctrl", "syscon";
+			reg = <0x0 0xf6504000 0x0 0x1000>;
+			#clock-cells = <1>;
+		};
+
 		medianoc_ade: medianoc_ade at f4520000 {
 			compatible = "syscon";
 			reg = <0x0 0xf4520000 0x0 0x4000>;
maintainer
#3 lore raw

PATCH 2/2 arm64: dts: hi6220: add acpu_sctrl

In reply to Zhangfei Gao

Hi Zhangfei,

Quoted 16 lines · Zhangfei Gao

Add acpu_sctrl clock node

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 470461d..710cc34 100644
@@ -262,6 +262,12 @@
 			#clock-cells = <1>;
 		};

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

Quoted 10 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +6 -0
 
+		acpu_sctrl: acpu_sctrl at f7032000 {
+			compatible = "hisilicon,hi6220-acpu-sctrl", "syscon";
+			reg = <0x0 0xf6504000 0x0 0x1000>;
+			#clock-cells = <1>;
+		};
+
 		medianoc_ade: medianoc_ade at f4520000 {
 			compatible = "syscon";
 			reg = <0x0 0xf4520000 0x0 0x4000>;

Thanks!
Applied to the hisilicon dt tree since the driver part is in the mainline now.

Best Regards,
Wei

#4 lore raw

PATCH 2/2 arm64: dts: hi6220: add acpu_sctrl

Quoted 19 lines · Wei Xu

Hi Zhangfei,

Quoted 16 lines · Zhangfei Gao

Add acpu_sctrl clock node

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 470461d..710cc34 100644
@@ -262,6 +262,12 @@
 			#clock-cells = <1>;
 		};
 
Quoted 1 line

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

Quoted 1 line
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +1 -0
+		acpu_sctrl: acpu_sctrl at f7032000 {

I think the unit address is incorrect here (this value has been copied from the pm controller while it should match the 1st one the reg).

Quoted 9 lines

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

Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +5 -0
+			compatible = "hisilicon,hi6220-acpu-sctrl", "syscon";
+			reg = <0x0 0xf6504000 0x0 0x1000>;
+			#clock-cells = <1>;
+		};
+
 		medianoc_ade: medianoc_ade at f4520000 {
 			compatible = "syscon";
 			reg = <0x0 0xf4520000 0x0 0x4000>;

Also I'm sorry I'm going to ask stupid questions:

- why 's' in "sctrl" while all the other node controllers declared around seems to use "ctrl"?

- is it possible to have access to the specs where those addresses can be found? The only public doc I could find is the "Hi6220V100 Multi-Mode Application Processor" one where this information doesn't seem present.

- is there any work pending adding the pmu counters node (interrupt GCI_SPI 99) ? AFAIK the ACPU controller added here can be used to enable the counters.

Quoted 4 lines

Thanks!
Applied to the hisilicon dt tree since the driver part is in the mainline now.

Is this refering to https://github.com/hisilicon/linux-hisi/commits/next/dt64 ?

[...]

Signature · 8 lines
Cl?ment B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170815/a60c3354/attachment.sig>
#5 lore raw

PATCH 2/2 arm64: dts: hi6220: add acpu_sctrl

Quoted 35 lines · Cl?ment B?sch
Quoted 19 lines · Wei Xu

Hi Zhangfei,

Quoted 16 lines · Zhangfei Gao

Add acpu_sctrl clock node

---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 470461d..710cc34 100644
@@ -262,6 +262,12 @@
                    #clock-cells = <1>;
            };
 
Quoted 1 line

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

Quoted 1 line
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +1 -0
+           acpu_sctrl: acpu_sctrl at f7032000 {

I think the unit address is incorrect here (this value has been copied from the pm controller while it should match the 1st one the reg).

Quoted 9 lines

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

Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +5 -0
+                   compatible = "hisilicon,hi6220-acpu-sctrl", "syscon";
+                   reg = <0x0 0xf6504000 0x0 0x1000>;
+                   #clock-cells = <1>;
+           };
+
            medianoc_ade: medianoc_ade at f4520000 {
                    compatible = "syscon";
                    reg = <0x0 0xf4520000 0x0 0x4000>;
Quoted 9 lines

Also I'm sorry I'm going to ask stupid questions:

- why 's' in "sctrl" while all the other node controllers declared around seems to use "ctrl"?

- is it possible to have access to the specs where those addresses can be found? The only public doc I could find is the "Hi6220V100 Multi-Mode Application Processor" one where this information doesn't seem present.

That's the only public doc. But if you need, welcome to discuss with me off-line about referencing kernels for hikey.

Quoted 4 lines

- is there any work pending adding the pmu counters node (interrupt GCI_SPI 99) ? AFAIK the ACPU controller added here can be used to enable the counters.

For hikey PMU, please have a look of this patchset:
- https://github.com/96boards/linux/pull/86/commits
Discussion is here:
- https://discuss.96boards.org/t/performance-monitoring-unit-pmu/293/4

Due to its implementation is not compatible with upstream, this patchset was not upstreamed. If you are interested, welcome to adding them LKML.

Appreciate your effort.

-Guodong

Quoted 11 lines
Quoted 4 lines

Thanks!
Applied to the hisilicon dt tree since the driver part is in the mainline now.

Is this refering to https://github.com/hisilicon/linux-hisi/commits/next/dt64 ?

[...]

--
Cl?ment B.

author
#6 lore raw

PATCH 2/2 arm64: dts: hi6220: add acpu_sctrl

In reply to Clément Bœsch
Quoted 20 lines · Cl?ment B?sch
Quoted 19 lines · Wei Xu

Hi Zhangfei,

Quoted 16 lines · Zhangfei Gao

Add acpu_sctrl clock node

---
  arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 6 ++++++
  1 file changed, 6 insertions(+)
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +0 -0
index 470461d..710cc34 100644
@@ -262,6 +262,12 @@
  			#clock-cells = <1>;
  		};
 
Quoted 3 lines
Quoted 1 line

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

Quoted 1 line
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +1 -0
+		acpu_sctrl: acpu_sctrl at f7032000 {

I think the unit address is incorrect here (this value has been copied from the pm controller while it should match the 1st one the reg).

oops,
Yes, you are right, will update.

Quoted 11 lines
Quoted 9 lines

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

Quoted 9 lines
arch/arm64/boot/dts/hisilicon/hi6220.dtsi +5 -0
+			compatible = "hisilicon,hi6220-acpu-sctrl", "syscon";
+			reg = <0x0 0xf6504000 0x0 0x1000>;
+			#clock-cells = <1>;
+		};
+
  		medianoc_ade: medianoc_ade at f4520000 {
  			compatible = "syscon";
  			reg = <0x0 0xf4520000 0x0 0x4000>;

Also I'm sorry I'm going to ask stupid questions:

Quoted 2 lines

- why 's' in "sctrl" while all the other node controllers declared around seems to use "ctrl"?

Just from hisilicon convention, sctrl means system control. acpu_ctrl seems better, more match spec.
However clk part using this name already been merged, so will keep use this.

Quoted 4 lines

- is it possible to have access to the specs where those addresses can be found? The only public doc I could find is the "Hi6220V100 Multi-Mode Application Processor" one where this information doesn't seem present.

https://github.com/96boards/documentation/tree/master/ConsumerEdition/HiKey/HardwareDocs
Looks only this part.

Quoted 4 lines

- is there any work pending adding the pmu counters node (interrupt GCI_SPI 99) ? AFAIK the ACPU controller added here can be used to enable the counters.

This patch is part of enabling core-sight, not touching pmu.

Quoted 4 lines
Quoted 3 lines

Thanks!
Applied to the hisilicon dt tree since the driver part is in the mainline now.

Is this refering to https://github.com/hisilicon/linux-hisi/commits/next/dt64 ?

Yes.

Quoted 3 lines

[...]

maintainer
#7 lore raw

PATCH 1/2 clk: hi6220: add acpu clock

In reply to Zhangfei Gao
Quoted 6 lines · Zhangfei Gao

Add acpu clock, including sft clock controlling hi6220 coresight module

---
 .../devicetree/bindings/clock/hi6220-clock.txt     |  1 +
Quoted 3 lines
 drivers/clk/hisilicon/clk-hi6220.c                 | 23 ++++++++++++++++++++++
 include/dt-bindings/clock/hi6220-clock.h           |  4 ++++
 3 files changed, 28 insertions(+)
author
#9 lore raw

PATCH 1/2 clk: hi6220: add acpu clock

Hi, Stephen

Would you mind taking this patch, it's better go through 4.12.

Quoted 10 lines · zhangfei
Quoted 7 lines · Rob Herring
Quoted 6 lines · Zhangfei Gao

Add acpu clock, including sft clock controlling hi6220 coresight module

---
  .../devicetree/bindings/clock/hi6220-clock.txt     |  1 +
Quoted 5 lines
Quoted 1 line

Thanks Rob

Btw, have tested on 4.12-rc1, the patches can be applied directly.

Thanks