clk: rockchip: fix cpuclk mux bit of big cpu-cluster
Subsystems (2)
Heiko Stuebner
maintainerPATCH 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.
---
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
@@ -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
Heiko Stuebner
maintainerPATCH 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.
--- drivers/clk/rockchip/clk-rk3368.c | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +20 -20
@@ -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
Heiko Stuebner
maintainerPATCH 3/4 clk: rockchip: rk3368: fix parents of video encoder/decoder
In reply to Heiko StuebnerThe 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.
--- drivers/clk/rockchip/clk-rk3368.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3368.c +2 -2
@@ -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
Heiko Stuebner
maintainerPATCH 4/4 clk: rockchip: rk3368: fix hdmi_cec gate-register
In reply to Heiko StuebnerFix a typo making the sclk_hdmi_cec access a wrong register to handle its gate.
--- drivers/clk/rockchip/clk-rk3368.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
@@ -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
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")Reported-by Zhang Qing <[email protected]>Signed-off-by Heiko Stuebner <[email protected]>---
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
Heiko Stuebner
maintainerAm 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")Reported-by Zhang Qing <[email protected]>Signed-off-by Heiko Stuebner <[email protected]>---
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 :-)
Re: [PATCH 2/4] clk: rockchip: fix rk3368 cpuclk core dividers
In reply to Heiko Stuebnerhi:
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")Reported-by Zhang Qing <[email protected]>Signed-off-by Heiko Stuebner <[email protected]>
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@@ -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 = {
Re: [PATCH 3/4] clk: rockchip: rk3368: fix parents of video encoder/decoder
In reply to Heiko Stuebnerhi:
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")Signed-off-by Heiko Stuebner <[email protected]>
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@@ -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),
Re: [PATCH 4/4] clk: rockchip: rk3368: fix hdmi_cec gate-register
In reply to Heiko Stuebnerhi:
Quoted 5 lines · Heiko Stuebner
Fix a typo making the
sclk_hdmi_cecaccess a wrong register to handle its gate.Fixes 3536c97a52db ("clk: rockchip: add rk3368 clock controller")Signed-off-by Heiko Stuebner <[email protected]>
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@@ -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,
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")Reported-by Zhang Qing <[email protected]>Signed-off-by Heiko Stuebner <[email protected]>
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@@ -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 = {