Skip to contentSkip to conversation

clk: ingenic-tcu: Fix missing TCU clock for X1000 SoC

PATCH In review Aidan MacDonald 3 participants 3 messages Feb 9, 2022 – Feb 10, 2022

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

PATCH 1/1 clk: ingenic-tcu: Fix missing TCU clock for X1000 SoC

The X1000 does have a TCU clock gate, so pass it to the driver. Without this the TCU can be gated automatically, which prevents timers from running and stops register writes from taking effect.

---
 arch/mips/boot/dts/ingenic/x1000.dtsi | 5 +++--
 drivers/clk/ingenic/tcu.c             | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/mips/boot/dts/ingenic/x1000.dtsi +3 -2
index 8bd27edef216..c69df8eb158e 100644
@@ -111,8 +111,9 @@ tcu: timer@10002000 {
 
 		clocks = <&cgu X1000_CLK_RTCLK>,
 			 <&cgu X1000_CLK_EXCLK>,
-			 <&cgu X1000_CLK_PCLK>;
-		clock-names = "rtc", "ext", "pclk";
+			 <&cgu X1000_CLK_PCLK>,
+			 <&cgu X1000_CLK_TCU>;
+		clock-names = "rtc", "ext", "pclk", "tcu";
 
 		interrupt-controller;
 		#interrupt-cells = <1>;
drivers/clk/ingenic/tcu.c +1 -1
index 77acfbeb4830..9c86043f673a 100644
@@ -320,7 +320,7 @@ static const struct ingenic_soc_info jz4770_soc_info = {
 static const struct ingenic_soc_info x1000_soc_info = {
 	.num_channels = 8,
 	.has_ost = false, /* X1000 has OST, but it not belong TCU */
-	.has_tcu_clk = false,
+	.has_tcu_clk = true,
 };
 
 static const struct of_device_id __maybe_unused ingenic_tcu_of_match[] __initconst = {
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Aidan,

Quoted 9 lines · Aidan MacDonald

The X1000 does have a TCU clock gate, so pass it to the driver. Without this the TCU can be gated automatically, which prevents timers from running and stops register writes from taking effect.

---
  arch/mips/boot/dts/ingenic/x1000.dtsi | 5 +++--
  drivers/clk/ingenic/tcu.c             | 2 +-
  2 files changed, 4 insertions(+), 3 deletions(-)

Thank you for fixing the problem that I didn't realize at first.

Quoted 30 lines
arch/mips/boot/dts/ingenic/x1000.dtsi +3 -2
index 8bd27edef216..c69df8eb158e 100644
@@ -111,8 +111,9 @@ tcu: timer@10002000 {
 
  		clocks = <&cgu X1000_CLK_RTCLK>,
  			 <&cgu X1000_CLK_EXCLK>,
-			 <&cgu X1000_CLK_PCLK>;
-		clock-names = "rtc", "ext", "pclk";
+			 <&cgu X1000_CLK_PCLK>,
+			 <&cgu X1000_CLK_TCU>;
+		clock-names = "rtc", "ext", "pclk", "tcu";
 
  		interrupt-controller;
  		#interrupt-cells = <1>;
drivers/clk/ingenic/tcu.c +1 -1
index 77acfbeb4830..9c86043f673a 100644
@@ -320,7 +320,7 @@ static const struct ingenic_soc_info jz4770_soc_info = {
  static const struct ingenic_soc_info x1000_soc_info = {
  	.num_channels = 8,
  	.has_ost = false, /* X1000 has OST, but it not belong TCU */
-	.has_tcu_clk = false,
+	.has_tcu_clk = true,
  };
 
  static const struct of_device_id __maybe_unused ingenic_tcu_of_match[] __initconst = {
maintainer
#2 lore raw
In reply to Aidan MacDonald

Hi Aidan,

Quoted 8 lines · Aidan MacDonald

The X1000 does have a TCU clock gate, so pass it to the driver. Without this the TCU can be gated automatically, which prevents timers from running and stops register writes from taking effect.

---
 arch/mips/boot/dts/ingenic/x1000.dtsi | 5 +++--
 drivers/clk/ingenic/tcu.c             | 2 +-

The Device Tree changes should be split into their own patch.

Cheers,
-Paul

Quoted 36 lines
 2 files changed, 4 insertions(+), 3 deletions(-)
arch/mips/boot/dts/ingenic/x1000.dtsi +3 -2
index 8bd27edef216..c69df8eb158e 100644
@@ -111,8 +111,9 @@ tcu: timer@10002000 {
 
 		clocks = <&cgu X1000_CLK_RTCLK>,
 			 <&cgu X1000_CLK_EXCLK>,
-			 <&cgu X1000_CLK_PCLK>;
-		clock-names = "rtc", "ext", "pclk";
+			 <&cgu X1000_CLK_PCLK>,
+			 <&cgu X1000_CLK_TCU>;
+		clock-names = "rtc", "ext", "pclk", "tcu";
 
 		interrupt-controller;
 		#interrupt-cells = <1>;
drivers/clk/ingenic/tcu.c +1 -1
index 77acfbeb4830..9c86043f673a 100644
@@ -320,7 +320,7 @@ static const struct ingenic_soc_info 
 jz4770_soc_info = {
 static const struct ingenic_soc_info x1000_soc_info = {
 	.num_channels = 8,
 	.has_ost = false, /* X1000 has OST, but it not belong TCU */
-	.has_tcu_clk = false,
+	.has_tcu_clk = true,
 };
 

static const struct of_device_id __maybe_unused
ingenic_tcu_of_match[] __initconst = {
--
2.34.1