Skip to contentSkip to conversation

clk: rockchip: add rk3288 vip_out clock ids

PATCH In review Jacob Chen 3 participants 6 messages Jan 18, 2017 – Jan 23, 2017

Subsystems (3)
lore
Share & tools
lore

Jacob Chen

author
#0 lore raw

PATCH v2 1/3 clk: rockchip: add rk3288 vip_out clock ids

Add clock-ids for the vip block of the rk3288

---
 include/dt-bindings/clock/rk3288-cru.h | 1 +
 1 file changed, 1 insertion(+)
include/dt-bindings/clock/rk3288-cru.h +1 -0
index 9a586e2..11183bf 100644
@@ -88,6 +88,7 @@
 #define SCLK_PVTM_GPU		124
 #define SCLK_CRYPTO		125
 #define SCLK_MIPIDSI_24M	126
+#define SCLK_VIP_OUT	127
 
 #define SCLK_MAC		151
 #define SCLK_MACREF_OUT		152
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 2/3 clk: rockchip: use rk3288 vip_out clock ids

Reference the newly added vip clock-ids in the clock-tree.

---
 drivers/clk/rockchip/clk-rk3288.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3288.c +1 -1
index 39af05a..3d02aa2 100644
@@ -469,7 +469,7 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
 	COMPOSITE_NODIV(0, "vip_src", mux_pll_src_cpll_gpll_p, 0,
 			RK3288_CLKSEL_CON(26), 8, 1, MFLAGS,
 			RK3288_CLKGATE_CON(3), 7, GFLAGS),
-	COMPOSITE_NOGATE(0, "sclk_vip_out", mux_vip_out_p, 0,
+	COMPOSITE_NOGATE(SCLK_VIP_OUT, "sclk_vip_out", mux_vip_out_p, 0,
 			RK3288_CLKSEL_CON(26), 15, 1, MFLAGS, 9, 5, DFLAGS),
 
 	DIV(0, "pclk_pd_alive", "gpll", 0,
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH v2 3/3 clk: rockchip: rk3288: make all niu clocks critical

In reply to Jacob Chen

NIU clocks are related to the interconnect and it's important to other blocks. Since we don't have a driver to handle it, we should always enable it to avoid casually close.

Make all of them critical,so that we don't have to each clock on its own once things break.

---
 drivers/clk/rockchip/clk-rk3288.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/rockchip/clk-rk3288.c +7 -0
index 3d02aa2..c50386c 100644
@@ -808,8 +808,15 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
 static const char *const rk3288_critical_clocks[] __initconst = {
 	"aclk_cpu",
 	"aclk_peri",
+	"aclk_peri_niu",
+	"aclk_vio0_niu",
+	"aclk_vio1_niu",
+	"aclk_rga_niu",
 	"hclk_peri",
+	"hclk_vio_niu",
+	"pclk_alive_niu",
 	"pclk_pd_pmu",
+	"pclk_pmu_niu",
 };
 
 static void __iomem *rk3288_cru_base;
Signature · 1 line
2.7.4
#3 lore raw

Re: [PATCH v2 3/3] clk: rockchip: rk3288: make all niu clocks critical

2017-01-18 13:42 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 33 lines

NIU clocks are related to the interconnect and it's important to other blocks. Since we don't have a driver to handle it, we should always enable it to avoid casually close.

Make all of them critical,so that we don't have to each clock on its own once things break.

---
 drivers/clk/rockchip/clk-rk3288.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/rockchip/clk-rk3288.c +7 -1
index 3d02aa2..c50386c 100644
@@ -808,8 +808,15 @@ static struct rockchip_clk_branch rk3288_clk_branches[] __initdata = {
 static const char *const rk3288_critical_clocks[] __initconst = {
        "aclk_cpu",
        "aclk_peri",
+       "aclk_peri_niu",
+       "aclk_vio0_niu",
+       "aclk_vio1_niu",
+       "aclk_rga_niu",
        "hclk_peri",
+       "hclk_vio_niu",
+       "pclk_alive_niu",
        "pclk_pd_pmu",
+       "pclk_pmu_niu",
 };
 
 static void __iomem *rk3288_cru_base;
--
Quoted 2 lines

2.7.4

I just got an another bug that caused by closed niu clock. Making niu clock always enabled is really useful, it could save me a lot of time.....

I just wonder why we don't do that before. Would it have great impact on power consumption?

maintainer
#4 lore raw

Re: [PATCH v2 3/3] clk: rockchip: rk3288: make all niu clocks critical

Am Sonntag, 22. Januar 2017, 17:02:17 CET schrieb Jacob Chen:

Quoted 50 lines

2017-01-18 13:42 GMT+08:00 Jacob Chen <[email protected]>:

Quoted 43 lines

NIU clocks are related to the interconnect and it's important to other blocks. Since we don't have a driver to handle it, we should always enable it to avoid casually close.

Make all of them critical,so that we don't have to each clock on its own once things break.

---

 drivers/clk/rockchip/clk-rk3288.c | 7 +++++++
 1 file changed, 7 insertions(+)
(quoted diff) +0 -0

b/drivers/clk/rockchip/clk-rk3288.c index 3d02aa2..c50386c 100644

drivers/clk/rockchip/clk-rk3288.c +0 -0
@@ -808,8 +808,15 @@ static struct rockchip_clk_branch

rk3288_clk_branches[] __initdata = {>
static const char *const rk3288_critical_clocks[] __initconst = {

        "aclk_cpu",
        "aclk_peri",
drivers/clk/rockchip/clk-rk3288.c +7 -1
+       "aclk_peri_niu",
+       "aclk_vio0_niu",
+       "aclk_vio1_niu",
+       "aclk_rga_niu",
 
        "hclk_peri",
 
+       "hclk_vio_niu",
+       "pclk_alive_niu",
 
        "pclk_pd_pmu",
 
+       "pclk_pmu_niu",
 
 };
 
 static void __iomem *rk3288_cru_base;
 
--
Quoted 1 line

2.7.4

I just got an another bug that caused by closed niu clock. Making niu clock always enabled is really useful, it could save me a lot of time.....

Quoted 2 lines

I just wonder why we don't do that before. Would it have great impact on power consumption?

The niu clocks so far seemed to rely on the CLK_IGNORE_UNUSED flag. So all was well as long as nothing changed in the clock tree above those and I guess with more supported peripherals, some now make changes to the more common clocks and thus disable the nui clocks by accident.

maintainer
#5 lore raw
In reply to Jacob Chen

Am Mittwoch, 18. Januar 2017, 13:42:38 CET schrieb Jacob Chen:

Quoted 3 lines

Add clock-ids for the vip block of the rk3288

applied all 3 for 4.11 .

I've fixed the indentation below (missing one additional tab)
and adapted patch3 to also remove the CLK_IGNORE_UNUSED flags for the clocks we now moved to the critical clocks.

Heiko