Skip to contentSkip to conversation

arm64: dts: rockchip: rk3399: Add xin32k clk

PATCH In review Derek Basehore 2 participants 3 messages Nov 16, 2018

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

PATCH 1/1 arm64: dts: rockchip: rk3399: Add xin32k clk

This adds the xin32k clock to the RK3399 CPU. Even though it's not directly used, muxes will end up traversing the entire clk tree on calls to determine_rate if it doesn't exist.

---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +7 -0
index 99e7f65c1779..6a32293982d0 100644
@@ -191,6 +191,13 @@
 		#clock-cells = <0>;
 	};
 
+	xin32k: xin32k {
+		compatible = "fixed-clock";
+		clock-frequency = <32000>;
+		clock-output-names = "xin32k";
+		#clock-cells = <0>;
+	};
+
 	amba {
 		compatible = "simple-bus";
 		#address-cells = <2>;
Signature · 1 line
2.19.1.1215.g8438c0b245-goog
#1 lore raw

Hi,

Quoted 15 lines · Derek Basehore

This adds the xin32k clock to the RK3399 CPU. Even though it's not directly used, muxes will end up traversing the entire clk tree on calls to determine_rate if it doesn't exist.

---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +0 -0
index 99e7f65c1779..6a32293982d0 100644

arch/arm64/boot/dts/rockchip/rk3399.dtsi line 194

Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3399.dtsi +1 -0
@@ -191,6 +191,13 @@
                #clock-cells = <0>;
        };
 
+       xin32k: xin32k {

nit: xin32k is the name of the clock that rk3399 consumes. It seems a little weird to name this node with that name. Can you call this:

ap_rtc_clk: ap-rtc-clk

...after the gru schematic? You wouldn't change the clock-output-names, just the node name / label.

arch/arm64/boot/dts/rockchip/rk3399.dtsi line 196

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3399.dtsi +2 -0
+               compatible = "fixed-clock";
+               clock-frequency = <32000>;

I checked the datasheet for the 32K clock and it shows that this is a 32768 Hz clock, not a 32000 Hz one. I also checked the rk808 clock driver (which is supposed to be compatible with rk3399) and it produces a 32768 clock.

#2 lore raw
Quoted 33 lines · Doug Anderson

Hi,

Quoted 15 lines · Derek Basehore

This adds the xin32k clock to the RK3399 CPU. Even though it's not directly used, muxes will end up traversing the entire clk tree on calls to determine_rate if it doesn't exist.

---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +0 -0
index 99e7f65c1779..6a32293982d0 100644

arch/arm64/boot/dts/rockchip/rk3399.dtsi line 194

Quoted 4 lines
arch/arm64/boot/dts/rockchip/rk3399.dtsi +1 -0
@@ -191,6 +191,13 @@
                #clock-cells = <0>;
        };
 
+       xin32k: xin32k {

nit: xin32k is the name of the clock that rk3399 consumes. It seems a little weird to name this node with that name. Can you call this:

ap_rtc_clk: ap-rtc-clk

...after the gru schematic? You wouldn't change the clock-output-names, just the node name / label.

Quoted 7 lines

arch/arm64/boot/dts/rockchip/rk3399.dtsi line 196

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3399.dtsi +2 -0
+               compatible = "fixed-clock";
+               clock-frequency = <32000>;

I checked the datasheet for the 32K clock and it shows that this is a 32768 Hz clock, not a 32000 Hz one. I also checked the rk808 clock driver (which is supposed to be compatible with rk3399) and it produces a 32768 clock.

Ok, sending out an updated patch that addresses these concerns.