Skip to contentSkip to conversation

rk3328: clk: Configure CPU clock during initialization

PATCH New Simon South 2 participants 4 messages Oct 10, 2019 – Oct 14, 2019

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

cover rk3328: clk: Configure CPU clock during initialization

This patch changes the RK3328 CRU driver so it explicitly configures the CPU clock during initialization, through a call to rk3328_configure_cpu().

Previously rk3328_configure_cpu() was implemented but not called from anywhere, which I'm assuming was unintentional.

This change matches the RK3399's CRU driver
(drivers/clk/rockchip/clk_rk3399.c) by

- Invoking the function at the start of rkclk_init() and
- Setting the CPU clock to the lowest defined frequency, 600 MHz.

It yields no real functional change (the CPU clock is already set to 600 MHz at power-on) but it does make it straightforward to set a higher clock rate at compile time for systems like the ROCK64 that run reliably at higher frequencies.

Tested on my ROCK64.

Simon South (1):
clk: rockchip: rk3328: Configure CPU clock

 arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 3 +++
 drivers/clk/rockchip/clk_rk3328.c               | 2 ++
 2 files changed, 5 insertions(+)
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/1 clk: rockchip: rk3328: Configure CPU clock

Add a call to rk3328_configure_cpu() during initialization to set the CPU-clock frequency.

---
 arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 3 +++
 drivers/clk/rockchip/clk_rk3328.c               | 2 ++
 2 files changed, 5 insertions(+)
arch/arm/include/asm/arch-rockchip/cru_rk3328.h +3 -0
index 15b9788d9c..4bf69dbe08 100644
@@ -66,4 +66,7 @@ enum apll_frequencies {
 	APLL_600_MHZ,
 };
 
+void rk3328_configure_cpu(struct rk3328_cru *cru,
+			  enum apll_frequencies apll_freq);
+
 #endif	/* __ASM_ARCH_CRU_RK3328_H_ */
drivers/clk/rockchip/clk_rk3328.c +2 -0
index a89e2ecc4a..4331048a87 100644
@@ -282,6 +282,8 @@ static void rkclk_init(struct rk3328_cru *cru)
 	u32 hclk_div;
 	u32 pclk_div;
 
+	rk3328_configure_cpu(cru, APLL_600_MHZ);
+
 	/* configure gpll cpll */
 	rkclk_set_pll(cru, CLK_GENERAL, &gpll_init_cfg);
 	rkclk_set_pll(cru, CLK_CODEC, &cpll_init_cfg);
Signature · 1 line
2.23.0
#2 lore raw

PATCH 1/1 clk: rockchip: rk3328: Configure CPU clock

Quoted 4 lines · Simon South

Add a call to rk3328_configure_cpu() during initialization to set the CPU-clock frequency.

Thanks,
- Kever

Quoted 30 lines
---
  arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 3 +++
  drivers/clk/rockchip/clk_rk3328.c               | 2 ++
  2 files changed, 5 insertions(+)
arch/arm/include/asm/arch-rockchip/cru_rk3328.h +3 -0
index 15b9788d9c..4bf69dbe08 100644
@@ -66,4 +66,7 @@ enum apll_frequencies {
  	APLL_600_MHZ,
  };
 
+void rk3328_configure_cpu(struct rk3328_cru *cru,
+			  enum apll_frequencies apll_freq);
+
  #endif	/* __ASM_ARCH_CRU_RK3328_H_ */
drivers/clk/rockchip/clk_rk3328.c +2 -0
index a89e2ecc4a..4331048a87 100644
@@ -282,6 +282,8 @@ static void rkclk_init(struct rk3328_cru *cru)
  	u32 hclk_div;
  	u32 pclk_div;
 
+	rk3328_configure_cpu(cru, APLL_600_MHZ);
+
  	/* configure gpll cpll */
  	rkclk_set_pll(cru, CLK_GENERAL, &gpll_init_cfg);
  	rkclk_set_pll(cru, CLK_CODEC, &cpll_init_cfg);
#3 lore raw

PATCH 1/1 clk: rockchip: rk3328: Configure CPU clock【请注意,邮件由[email protected]代发】

Quoted 8 lines · Kever Yang
Quoted 4 lines · Simon South

Add a call to rk3328_configure_cpu() during initialization to set the CPU-clock frequency.

Applied to u-boot-rockchip master.

Quoted 40 lines

Thanks,
- Kever

Quoted 23 lines

---
  arch/arm/include/asm/arch-rockchip/cru_rk3328.h | 3 +++ drivers/clk/rockchip/clk_rk3328.c               | 2 ++

  2 files changed, 5 insertions(+)
arch/arm/include/asm/arch-rockchip/cru_rk3328.h +2 -0
index 15b9788d9c..4bf69dbe08 100644
@@ -66,4 +66,7 @@ enum apll_frequencies {
       APLL_600_MHZ,
   };
   +void rk3328_configure_cpu(struct rk3328_cru *cru,
+              enum apll_frequencies apll_freq);
+
   #endif    /* __ASM_ARCH_CRU_RK3328_H_ */
drivers/clk/rockchip/clk_rk3328.c +0 -0
index a89e2ecc4a..4331048a87 100644

drivers/clk/rockchip/clk_rk3328.c static void rkclk_init(struct rk3328_cru *cru) · line 288

Quoted 7 lines
drivers/clk/rockchip/clk_rk3328.c +1 -0
@@ -282,6 +282,8 @@ static void rkclk_init(struct rk3328_cru *cru)
       u32 hclk_div;
       u32 pclk_div;
   +    rk3328_configure_cpu(cru, APLL_600_MHZ);
+
       /* configure gpll cpll */
       rkclk_set_pll(cru, CLK_GENERAL, &gpll_init_cfg);
       rkclk_set_pll(cru, CLK_CODEC, &cpll_init_cfg);

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot