mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/3] clk: rockchip: Fixed some incorrect commits
@ 2025-01-24  6:46 Elaine Zhang
  2025-01-24  6:46 ` [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228" Elaine Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Elaine Zhang @ 2025-01-24  6:46 UTC (permalink / raw)
  To: mturquette, sboyd, kever.yang, zhangqing, heiko, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-rockchip, linux-kernel, huangtao, devicetree,
	linux-arm-kernel

Elaine Zhang (3):
  Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228"
  Revert "arm64: dts: rockchip: Increase VOP clk rate on RK3328"
  arm64: dts: rockchip: Increase VOP clk rate on RK3328

 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 10 ++++++----
 drivers/clk/rockchip/clk-rk3228.c        |  2 +-
 2 files changed, 7 insertions(+), 5 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228"
  2025-01-24  6:46 [PATCH v1 0/3] clk: rockchip: Fixed some incorrect commits Elaine Zhang
@ 2025-01-24  6:46 ` Elaine Zhang
  2025-01-24 14:40   ` Jonas Karlman
  2025-01-24  6:46 ` [PATCH v1 2/3] Revert "arm64: dts: rockchip: Increase VOP clk rate on RK3328" Elaine Zhang
  2025-01-24  6:46 ` [PATCH v1 3/3] arm64: dts: rockchip: Increase VOP clk rate on RK3328 Elaine Zhang
  2 siblings, 1 reply; 6+ messages in thread
From: Elaine Zhang @ 2025-01-24  6:46 UTC (permalink / raw)
  To: mturquette, sboyd, kever.yang, zhangqing, heiko, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-rockchip, linux-kernel, huangtao, devicetree,
	linux-arm-kernel

This reverts commit 1d34b9757523c1ad547bd6d040381f62d74a3189.

RK3228 Only GPLL and CPLL, GPLL is a common clock, does not allow
dclk_vop to change its frequency, CPLL is used by GMAC,
if dclk_vop use CLK_SET_RATE_PARENT and CLK_SET_RATE_NO_REPARENT flags will
affect the GMAC function.

If the client application does not use GMAC and CPLL is free, make this
change on the local branch.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
 drivers/clk/rockchip/clk-rk3228.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c
index ed602c27b624..9c0284607766 100644
--- a/drivers/clk/rockchip/clk-rk3228.c
+++ b/drivers/clk/rockchip/clk-rk3228.c
@@ -409,7 +409,7 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
 			RK2928_CLKSEL_CON(29), 0, 3, DFLAGS),
 	DIV(0, "sclk_vop_pre", "sclk_vop_src", 0,
 			RK2928_CLKSEL_CON(27), 8, 8, DFLAGS),
-	MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
+	MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, 0,
 			RK2928_CLKSEL_CON(27), 1, 1, MFLAGS),
 
 	FACTOR(0, "xin12m", "xin24m", 0, 1, 2),
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 2/3] Revert "arm64: dts: rockchip: Increase VOP clk rate on RK3328"
  2025-01-24  6:46 [PATCH v1 0/3] clk: rockchip: Fixed some incorrect commits Elaine Zhang
  2025-01-24  6:46 ` [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228" Elaine Zhang
@ 2025-01-24  6:46 ` Elaine Zhang
  2025-01-24  6:46 ` [PATCH v1 3/3] arm64: dts: rockchip: Increase VOP clk rate on RK3328 Elaine Zhang
  2 siblings, 0 replies; 6+ messages in thread
From: Elaine Zhang @ 2025-01-24  6:46 UTC (permalink / raw)
  To: mturquette, sboyd, kever.yang, zhangqing, heiko, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-rockchip, linux-kernel, huangtao, devicetree,
	linux-arm-kernel

This reverts commit 0f2ddb128fa20f8441d903285632f2c69e90fae1.

Before changing the PLL frequency, in order to avoid overclocking the
child clock, set the child clock to a large div first, and then set the
CLK as required after the PLL is set.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index 7d992c3c01ce..f3ef8cbfbdae 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -852,8 +852,8 @@
 			<0>, <24000000>,
 			<24000000>, <24000000>,
 			<15000000>, <15000000>,
-			<300000000>, <100000000>,
-			<400000000>, <100000000>,
+			<100000000>, <100000000>,
+			<100000000>, <100000000>,
 			<50000000>, <100000000>,
 			<100000000>, <100000000>,
 			<50000000>, <50000000>,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 3/3] arm64: dts: rockchip: Increase VOP clk rate on RK3328
  2025-01-24  6:46 [PATCH v1 0/3] clk: rockchip: Fixed some incorrect commits Elaine Zhang
  2025-01-24  6:46 ` [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228" Elaine Zhang
  2025-01-24  6:46 ` [PATCH v1 2/3] Revert "arm64: dts: rockchip: Increase VOP clk rate on RK3328" Elaine Zhang
@ 2025-01-24  6:46 ` Elaine Zhang
  2025-01-24 14:47   ` Jonas Karlman
  2 siblings, 1 reply; 6+ messages in thread
From: Elaine Zhang @ 2025-01-24  6:46 UTC (permalink / raw)
  To: mturquette, sboyd, kever.yang, zhangqing, heiko, robh, krzk+dt, conor+dt
  Cc: linux-clk, linux-rockchip, linux-kernel, huangtao, devicetree,
	linux-arm-kernel

The VOP on RK3328 needs to run at a higher rate in order to produce
a proper 3840x2160 signal.
Change to use 300MHz for VIO clk and 400MHz for VOP clk.

Fixes: 4b6764f200f2 ("Revert "arm64: dts: rockchip: Increase VOP clk
rate on RK3328"")

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
index f3ef8cbfbdae..0c905f411e92 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
@@ -842,7 +842,8 @@
 			<&cru ACLK_BUS_PRE>, <&cru HCLK_BUS_PRE>,
 			<&cru PCLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
 			<&cru HCLK_PERI>, <&cru PCLK_PERI>,
-			<&cru SCLK_RTC32K>;
+			<&cru SCLK_RTC32K>, <&cru ACLK_VIO_PRE>,
+			<&cru ACLK_VOP_PRE>;
 		assigned-clock-parents =
 			<&cru HDMIPHY>, <&cru PLL_APLL>,
 			<&cru PLL_GPLL>, <&xin24m>,
@@ -863,7 +864,8 @@
 			<150000000>, <75000000>,
 			<75000000>, <150000000>,
 			<75000000>, <75000000>,
-			<32768>;
+			<32768>, <300000000>,
+			<400000000>;
 	};
 
 	usb2phy_grf: syscon@ff450000 {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228"
  2025-01-24  6:46 ` [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228" Elaine Zhang
@ 2025-01-24 14:40   ` Jonas Karlman
  0 siblings, 0 replies; 6+ messages in thread
From: Jonas Karlman @ 2025-01-24 14:40 UTC (permalink / raw)
  To: Elaine Zhang
  Cc: mturquette, sboyd, kever.yang, heiko, robh, krzk+dt, conor+dt,
	linux-clk, linux-rockchip, linux-kernel, huangtao, devicetree,
	linux-arm-kernel

Hi Elaine,

On 2025-01-24 07:46, Elaine Zhang wrote:
> This reverts commit 1d34b9757523c1ad547bd6d040381f62d74a3189.
> 
> RK3228 Only GPLL and CPLL, GPLL is a common clock, does not allow
> dclk_vop to change its frequency, CPLL is used by GMAC,
> if dclk_vop use CLK_SET_RATE_PARENT and CLK_SET_RATE_NO_REPARENT flags will
> affect the GMAC function.

Please explain how CPLL and GPLL is affected by this? According to TRM
the hdmiphy is default parent (reset value), this is also how similar
clock is defined for RK3328.

  vop_pll_sel  
  Control vop clock PLL source selection.  
  1'b0: select hdmiphy pll clock (reset value)
  1'b1: select vop dclk

Maybe the dclk_vop name is causing confusion, or am I missing something?

Regards,
Jonas

> 
> If the client application does not use GMAC and CPLL is free, make this
> change on the local branch.
> 
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
> ---
>  drivers/clk/rockchip/clk-rk3228.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/rockchip/clk-rk3228.c b/drivers/clk/rockchip/clk-rk3228.c
> index ed602c27b624..9c0284607766 100644
> --- a/drivers/clk/rockchip/clk-rk3228.c
> +++ b/drivers/clk/rockchip/clk-rk3228.c
> @@ -409,7 +409,7 @@ static struct rockchip_clk_branch rk3228_clk_branches[] __initdata = {
>  			RK2928_CLKSEL_CON(29), 0, 3, DFLAGS),
>  	DIV(0, "sclk_vop_pre", "sclk_vop_src", 0,
>  			RK2928_CLKSEL_CON(27), 8, 8, DFLAGS),
> -	MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
> +	MUX(DCLK_VOP, "dclk_vop", mux_dclk_vop_p, 0,
>  			RK2928_CLKSEL_CON(27), 1, 1, MFLAGS),
>  
>  	FACTOR(0, "xin12m", "xin24m", 0, 1, 2),


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 3/3] arm64: dts: rockchip: Increase VOP clk rate on RK3328
  2025-01-24  6:46 ` [PATCH v1 3/3] arm64: dts: rockchip: Increase VOP clk rate on RK3328 Elaine Zhang
@ 2025-01-24 14:47   ` Jonas Karlman
  0 siblings, 0 replies; 6+ messages in thread
From: Jonas Karlman @ 2025-01-24 14:47 UTC (permalink / raw)
  To: Elaine Zhang
  Cc: mturquette, sboyd, kever.yang, heiko, robh, krzk+dt, conor+dt,
	linux-clk, linux-rockchip, linux-kernel, huangtao, devicetree,
	linux-arm-kernel

Hi Elaine,

On 2025-01-24 07:46, Elaine Zhang wrote:
> The VOP on RK3328 needs to run at a higher rate in order to produce
> a proper 3840x2160 signal.
> Change to use 300MHz for VIO clk and 400MHz for VOP clk.

It is probably better to merge this change and the prior revert into a
single patch with a Fixes-tag for the commit 0f2ddb128fa2 ("arm64: dts:
rockchip: Increase VOP clk rate on RK3328") to ensure this change get
backported correctly.

Regards,
Jonas

> 
> Fixes: 4b6764f200f2 ("Revert "arm64: dts: rockchip: Increase VOP clk
> rate on RK3328"")
> 
> Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
> ---
>  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> index f3ef8cbfbdae..0c905f411e92 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
> @@ -842,7 +842,8 @@
>  			<&cru ACLK_BUS_PRE>, <&cru HCLK_BUS_PRE>,
>  			<&cru PCLK_BUS_PRE>, <&cru ACLK_PERI_PRE>,
>  			<&cru HCLK_PERI>, <&cru PCLK_PERI>,
> -			<&cru SCLK_RTC32K>;
> +			<&cru SCLK_RTC32K>, <&cru ACLK_VIO_PRE>,
> +			<&cru ACLK_VOP_PRE>;
>  		assigned-clock-parents =
>  			<&cru HDMIPHY>, <&cru PLL_APLL>,
>  			<&cru PLL_GPLL>, <&xin24m>,
> @@ -863,7 +864,8 @@
>  			<150000000>, <75000000>,
>  			<75000000>, <150000000>,
>  			<75000000>, <75000000>,
> -			<32768>;
> +			<32768>, <300000000>,
> +			<400000000>;
>  	};
>  
>  	usb2phy_grf: syscon@ff450000 {


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-01-24 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-24  6:46 [PATCH v1 0/3] clk: rockchip: Fixed some incorrect commits Elaine Zhang
2025-01-24  6:46 ` [PATCH v1 1/3] Revert "clk: rockchip: Set parent rate for DCLK_VOP clock on RK3228" Elaine Zhang
2025-01-24 14:40   ` Jonas Karlman
2025-01-24  6:46 ` [PATCH v1 2/3] Revert "arm64: dts: rockchip: Increase VOP clk rate on RK3328" Elaine Zhang
2025-01-24  6:46 ` [PATCH v1 3/3] arm64: dts: rockchip: Increase VOP clk rate on RK3328 Elaine Zhang
2025-01-24 14:47   ` Jonas Karlman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®