Skip to contentSkip to conversation

clk: rockchip: fix cpuclk mux bit of big cpu-cluster

PATCH In review Heiko Stuebner 3 participants 10 messages Jan 20, 2016 – Jan 21, 2016

Subsystems (2)
lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

PATCH 1/4 clk: rockchip: fix cpuclk mux bit of big cpu-cluster

Both clusters have their mux bit in bit 7 of their respective register. For whatever reason the big cluster currently lists bit 15 which is definitly wrong.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")

---
I plan to include them into my clk-fixes branch, so posted for reference and possible objections ;-)

 drivers/clk/rockchip/clk-rk3368.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
index 21f3ea9..f6667b8 100644
@@ -165,7 +165,7 @@ static const struct rockchip_cpuclk_reg_data rk3368_cpuclkb_data = {
 	.core_reg = RK3368_CLKSEL_CON(0),
 	.div_core_shift = 0,
 	.div_core_mask = 0x1f,
-	.mux_core_shift = 15,
+	.mux_core_shift = 7,
 };
 
 static const struct rockchip_cpuclk_reg_data rk3368_cpuclkl_data = {
Signature · 1 line
2.6.4
author maintainer
#1 lore raw

PATCH 2/4 clk: rockchip: fix rk3368 cpuclk core dividers

Similar to commit 9880d4277f6a ("clk: rockchip: fix rk3288 cpuclk core dividers") it seems the cpuclk dividers are one to high on the rk3368 as well.

And again similar to the previous fix, we opt to make the divider list contain the values to be written to use the same paradigm for them on all supported socs.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
---
 drivers/clk/rockchip/clk-rk3368.c | 40 +++++++++++++++++++--------------------
 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +20 -20
index f6667b8..3c9733e 100644
@@ -218,29 +218,29 @@ static const struct rockchip_cpuclk_reg_data rk3368_cpuclkl_data = {
 	}
 
 static struct rockchip_cpuclk_rate_table rk3368_cpuclkb_rates[] __initdata = {
-	RK3368_CPUCLKB_RATE(1512000000, 2, 6, 6),
-	RK3368_CPUCLKB_RATE(1488000000, 2, 5, 5),
-	RK3368_CPUCLKB_RATE(1416000000, 2, 5, 5),
-	RK3368_CPUCLKB_RATE(1200000000, 2, 4, 4),
-	RK3368_CPUCLKB_RATE(1008000000, 2, 4, 4),
-	RK3368_CPUCLKB_RATE( 816000000, 2, 3, 3),
-	RK3368_CPUCLKB_RATE( 696000000, 2, 3, 3),
-	RK3368_CPUCLKB_RATE( 600000000, 2, 2, 2),
-	RK3368_CPUCLKB_RATE( 408000000, 2, 2, 2),
-	RK3368_CPUCLKB_RATE( 312000000, 2, 2, 2),
+	RK3368_CPUCLKB_RATE(1512000000, 1, 5, 5),
+	RK3368_CPUCLKB_RATE(1488000000, 1, 4, 4),
+	RK3368_CPUCLKB_RATE(1416000000, 1, 4, 4),
+	RK3368_CPUCLKB_RATE(1200000000, 1, 3, 3),
+	RK3368_CPUCLKB_RATE(1008000000, 1, 3, 3),
+	RK3368_CPUCLKB_RATE( 816000000, 1, 2, 2),
+	RK3368_CPUCLKB_RATE( 696000000, 1, 2, 2),
+	RK3368_CPUCLKB_RATE( 600000000, 1, 1, 1),
+	RK3368_CPUCLKB_RATE( 408000000, 1, 1, 1),
+	RK3368_CPUCLKB_RATE( 312000000, 1, 1, 1),
 };
 
 static struct rockchip_cpuclk_rate_table rk3368_cpuclkl_rates[] __initdata = {
-	RK3368_CPUCLKL_RATE(1512000000, 2, 7, 7),
-	RK3368_CPUCLKL_RATE(1488000000, 2, 6, 6),
-	RK3368_CPUCLKL_RATE(1416000000, 2, 6, 6),
-	RK3368_CPUCLKL_RATE(1200000000, 2, 5, 5),
-	RK3368_CPUCLKL_RATE(1008000000, 2, 5, 5),
-	RK3368_CPUCLKL_RATE( 816000000, 2, 4, 4),
-	RK3368_CPUCLKL_RATE( 696000000, 2, 3, 3),
-	RK3368_CPUCLKL_RATE( 600000000, 2, 3, 3),
-	RK3368_CPUCLKL_RATE( 408000000, 2, 2, 2),
-	RK3368_CPUCLKL_RATE( 312000000, 2, 2, 2),
+	RK3368_CPUCLKL_RATE(1512000000, 1, 6, 6),
+	RK3368_CPUCLKL_RATE(1488000000, 1, 5, 5),
+	RK3368_CPUCLKL_RATE(1416000000, 1, 5, 5),
+	RK3368_CPUCLKL_RATE(1200000000, 1, 4, 4),
+	RK3368_CPUCLKL_RATE(1008000000, 1, 4, 4),
+	RK3368_CPUCLKL_RATE( 816000000, 1, 3, 3),
+	RK3368_CPUCLKL_RATE( 696000000, 1, 2, 2),
+	RK3368_CPUCLKL_RATE( 600000000, 1, 2, 2),
+	RK3368_CPUCLKL_RATE( 408000000, 1, 1, 1),
+	RK3368_CPUCLKL_RATE( 312000000, 1, 1, 1),
 };
 
 static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
Signature · 1 line
2.6.4
author maintainer
#3 lore raw

PATCH 3/4 clk: rockchip: rk3368: fix parents of video encoder/decoder

In reply to Heiko Stuebner

The vdpu and vepu clocks can also be parented to the npll and current parent list also is wrong as it would use the npll as "usbphy" source, so adapt the parent to the correct one.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
---
 drivers/clk/rockchip/clk-rk3368.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +2 -2
index 3c9733e..6037beb 100644
@@ -384,10 +384,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
 	 * Clock-Architecture Diagram 3
 	 */
 
-	COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_usb_p, 0,
+	COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_npll_usb_p, 0,
 			RK3368_CLKSEL_CON(15), 6, 2, MFLAGS, 0, 5, DFLAGS,
 			RK3368_CLKGATE_CON(4), 6, GFLAGS),
-	COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_usb_p, 0,
+	COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_npll_usb_p, 0,
 			RK3368_CLKSEL_CON(15), 14, 2, MFLAGS, 8, 5, DFLAGS,
 			RK3368_CLKGATE_CON(4), 7, GFLAGS),
 
Signature · 1 line
2.6.4
author maintainer
#5 lore raw

PATCH 4/4 clk: rockchip: rk3368: fix hdmi_cec gate-register

In reply to Heiko Stuebner

Fix a typo making the sclk_hdmi_cec access a wrong register to handle its gate.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
---
 drivers/clk/rockchip/clk-rk3368.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
index 6037beb..57acb62 100644
@@ -442,7 +442,7 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
 	GATE(SCLK_HDMI_HDCP, "sclk_hdmi_hdcp", "xin24m", 0,
 			RK3368_CLKGATE_CON(4), 13, GFLAGS),
 	GATE(SCLK_HDMI_CEC, "sclk_hdmi_cec", "xin32k", 0,
-			RK3368_CLKGATE_CON(5), 12, GFLAGS),
+			RK3368_CLKGATE_CON(4), 12, GFLAGS),
 
 	COMPOSITE_NODIV(0, "vip_src", mux_pll_src_cpll_gpll_p, 0,
 			RK3368_CLKSEL_CON(21), 15, 1, MFLAGS,
Signature · 1 line
2.6.4
#7 lore raw
In reply to Heiko Stuebner
Quoted 10 lines · Heiko Stuebner

Both clusters have their mux bit in bit 7 of their respective register. For whatever reason the big cluster currently lists bit 15 which is definitly wrong.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")

---
I plan to include them into my clk-fixes branch, so posted for reference and possible objections ;-)

None of these patches are fixes to regressions introduced in the merge window for v4.5, so we wouldn't be considering them for clk-fixes. We can certainly queue them up in clk-next for v4.6 and let stable process funnel them to the right stable trees though.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
author maintainer
#8 lore raw

Am Mittwoch, 20. Januar 2016, 14:06:27 schrieb Stephen Boyd:

Quoted 12 lines · Heiko Stuebner
Quoted 10 lines

Both clusters have their mux bit in bit 7 of their respective register. For whatever reason the big cluster currently lists bit 15 which is definitly wrong.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")

---
I plan to include them into my clk-fixes branch, so posted for reference and possible objections ;-)

Quoted 4 lines

None of these patches are fixes to regressions introduced in the merge window for v4.5, so we wouldn't be considering them for clk-fixes. We can certainly queue them up in clk-next for v4.6 and let stable process funnel them to the right stable trees though.

ok, I'll move them over to that part then :-)

Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] clk: rockchip: fix rk3368 cpuclk core dividers

In reply to Heiko Stuebner

hi:

Quoted 11 lines · Heiko Stuebner

Similar to commit 9880d4277f6a ("clk: rockchip: fix rk3288 cpuclk core dividers") it seems the cpuclk dividers are one to high on the rk3368 as well.

And again similar to the previous fix, we opt to make the divider list contain the values to be written to use the same paradigm for them on all supported socs.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
Quoted 59 lines
---
  drivers/clk/rockchip/clk-rk3368.c | 40 +++++++++++++++++++--------------------
  1 file changed, 20 insertions(+), 20 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +20 -20
index f6667b8..3c9733e 100644
@@ -218,29 +218,29 @@ static const struct rockchip_cpuclk_reg_data rk3368_cpuclkl_data = {
  	}
 
  static struct rockchip_cpuclk_rate_table rk3368_cpuclkb_rates[] __initdata = {
-	RK3368_CPUCLKB_RATE(1512000000, 2, 6, 6),
-	RK3368_CPUCLKB_RATE(1488000000, 2, 5, 5),
-	RK3368_CPUCLKB_RATE(1416000000, 2, 5, 5),
-	RK3368_CPUCLKB_RATE(1200000000, 2, 4, 4),
-	RK3368_CPUCLKB_RATE(1008000000, 2, 4, 4),
-	RK3368_CPUCLKB_RATE( 816000000, 2, 3, 3),
-	RK3368_CPUCLKB_RATE( 696000000, 2, 3, 3),
-	RK3368_CPUCLKB_RATE( 600000000, 2, 2, 2),
-	RK3368_CPUCLKB_RATE( 408000000, 2, 2, 2),
-	RK3368_CPUCLKB_RATE( 312000000, 2, 2, 2),
+	RK3368_CPUCLKB_RATE(1512000000, 1, 5, 5),
+	RK3368_CPUCLKB_RATE(1488000000, 1, 4, 4),
+	RK3368_CPUCLKB_RATE(1416000000, 1, 4, 4),
+	RK3368_CPUCLKB_RATE(1200000000, 1, 3, 3),
+	RK3368_CPUCLKB_RATE(1008000000, 1, 3, 3),
+	RK3368_CPUCLKB_RATE( 816000000, 1, 2, 2),
+	RK3368_CPUCLKB_RATE( 696000000, 1, 2, 2),
+	RK3368_CPUCLKB_RATE( 600000000, 1, 1, 1),
+	RK3368_CPUCLKB_RATE( 408000000, 1, 1, 1),
+	RK3368_CPUCLKB_RATE( 312000000, 1, 1, 1),
  };
 
  static struct rockchip_cpuclk_rate_table rk3368_cpuclkl_rates[] __initdata = {
-	RK3368_CPUCLKL_RATE(1512000000, 2, 7, 7),
-	RK3368_CPUCLKL_RATE(1488000000, 2, 6, 6),
-	RK3368_CPUCLKL_RATE(1416000000, 2, 6, 6),
-	RK3368_CPUCLKL_RATE(1200000000, 2, 5, 5),
-	RK3368_CPUCLKL_RATE(1008000000, 2, 5, 5),
-	RK3368_CPUCLKL_RATE( 816000000, 2, 4, 4),
-	RK3368_CPUCLKL_RATE( 696000000, 2, 3, 3),
-	RK3368_CPUCLKL_RATE( 600000000, 2, 3, 3),
-	RK3368_CPUCLKL_RATE( 408000000, 2, 2, 2),
-	RK3368_CPUCLKL_RATE( 312000000, 2, 2, 2),
+	RK3368_CPUCLKL_RATE(1512000000, 1, 6, 6),
+	RK3368_CPUCLKL_RATE(1488000000, 1, 5, 5),
+	RK3368_CPUCLKL_RATE(1416000000, 1, 5, 5),
+	RK3368_CPUCLKL_RATE(1200000000, 1, 4, 4),
+	RK3368_CPUCLKL_RATE(1008000000, 1, 4, 4),
+	RK3368_CPUCLKL_RATE( 816000000, 1, 3, 3),
+	RK3368_CPUCLKL_RATE( 696000000, 1, 2, 2),
+	RK3368_CPUCLKL_RATE( 600000000, 1, 2, 2),
+	RK3368_CPUCLKL_RATE( 408000000, 1, 1, 1),
+	RK3368_CPUCLKL_RATE( 312000000, 1, 1, 1),
  };
 
  static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
Reviewed-by on v1 3/4
#4 lore raw

Re: [PATCH 3/4] clk: rockchip: rk3368: fix parents of video encoder/decoder

In reply to Heiko Stuebner

hi:

Quoted 6 lines · Heiko Stuebner

The vdpu and vepu clocks can also be parented to the npll and current parent list also is wrong as it would use the npll as "usbphy" source, so adapt the parent to the correct one.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
Quoted 22 lines
---
  drivers/clk/rockchip/clk-rk3368.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +2 -2
index 3c9733e..6037beb 100644
@@ -384,10 +384,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
  	 * Clock-Architecture Diagram 3
  	 */
 
-	COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_usb_p, 0,
+	COMPOSITE(0, "aclk_vepu", mux_pll_src_cpll_gpll_npll_usb_p, 0,
  			RK3368_CLKSEL_CON(15), 6, 2, MFLAGS, 0, 5, DFLAGS,
  			RK3368_CLKGATE_CON(4), 6, GFLAGS),
-	COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_usb_p, 0,
+	COMPOSITE(0, "aclk_vdpu", mux_pll_src_cpll_gpll_npll_usb_p, 0,
  			RK3368_CLKSEL_CON(15), 14, 2, MFLAGS, 8, 5, DFLAGS,
  			RK3368_CLKGATE_CON(4), 7, GFLAGS),
 
Reviewed-by on v1 4/4
#6 lore raw

Re: [PATCH 4/4] clk: rockchip: rk3368: fix hdmi_cec gate-register

In reply to Heiko Stuebner

hi:

Quoted 5 lines · Heiko Stuebner

Fix a typo making the sclk_hdmi_cec access a wrong register to handle its gate.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
Quoted 18 lines
---
  drivers/clk/rockchip/clk-rk3368.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
index 6037beb..57acb62 100644
@@ -442,7 +442,7 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {
  	GATE(SCLK_HDMI_HDCP, "sclk_hdmi_hdcp", "xin24m", 0,
  			RK3368_CLKGATE_CON(4), 13, GFLAGS),
  	GATE(SCLK_HDMI_CEC, "sclk_hdmi_cec", "xin32k", 0,
-			RK3368_CLKGATE_CON(5), 12, GFLAGS),
+			RK3368_CLKGATE_CON(4), 12, GFLAGS),
 
  	COMPOSITE_NODIV(0, "vip_src", mux_pll_src_cpll_gpll_p, 0,
  			RK3368_CLKSEL_CON(21), 15, 1, MFLAGS,
Reviewed-by on v1 1/4
#9 lore raw
In reply to Heiko Stuebner

hi:

Quoted 7 lines · Heiko Stuebner

Both clusters have their mux bit in bit 7 of their respective register. For whatever reason the big cluster currently lists bit 15 which is definitly wrong.

Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")
Quoted 21 lines

---
I plan to include them into my clk-fixes branch, so posted for reference and possible objections ;-)

  drivers/clk/rockchip/clk-rk3368.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
index 21f3ea9..f6667b8 100644
@@ -165,7 +165,7 @@ static const struct rockchip_cpuclk_reg_data rk3368_cpuclkb_data = {
  	.core_reg = RK3368_CLKSEL_CON(0),
  	.div_core_shift = 0,
  	.div_core_mask = 0x1f,
-	.mux_core_shift = 15,
+	.mux_core_shift = 7,
  };
 
  static const struct rockchip_cpuclk_reg_data rk3368_cpuclkl_data = {