From 492604995a94dd9e2b5ca99c49f4cf115f427eec Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 1 May 2023 16:14:34 +0300 Subject: [PATCH 1/3] debugcc: inline unused local variable Signed-off-by: Dmitry Baryshkov --- debugcc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debugcc.c b/debugcc.c index e3771e6..59a9a06 100644 --- a/debugcc.c +++ b/debugcc.c @@ -201,9 +201,8 @@ unsigned long measure_mccc(const struct measure_clk *clk) static void measure(const struct measure_clk *clk) { unsigned long clk_rate; - struct debug_mux *gcc = clk->primary; - if (!leaf_enabled(gcc, clk->leaf)) { + if (!leaf_enabled(clk->primary, clk->leaf)) { printf("%50s: skipping\n", clk->name); return; } From 1c7cb13553f05dcca4d0c0f8a5464890024a8095 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 1 May 2023 16:14:40 +0300 Subject: [PATCH 2/3] debugcc: allow NULL primary mux For sc8280xp/mc_cc we do not have a correct primary mux value. Currently the value is not used at all, since the GCC debug mux is not used for mccc measurement. Instead of programming the dummy value, skip programming it at all. TODO: consider reverting this commit if we find a necessity to use debug mux for mccc or other DDR clocks. Signed-off-by: Dmitry Baryshkov --- debugcc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debugcc.c b/debugcc.c index 59a9a06..88b947f 100644 --- a/debugcc.c +++ b/debugcc.c @@ -210,14 +210,16 @@ static void measure(const struct measure_clk *clk) if (clk->leaf) mux_prepare_enable(clk->leaf, clk->leaf_mux); - mux_prepare_enable(clk->primary, clk->mux); + if (clk->primary) + mux_prepare_enable(clk->primary, clk->mux); if (clk->leaf && clk->leaf->measure) clk_rate = clk->leaf->measure(clk); else clk_rate = measure_default(clk); - mux_disable(clk->primary); + if (clk->primary) + mux_disable(clk->primary); if (clk->leaf) mux_disable(clk->leaf); From cebea7bd6a1e9a258b6a0643f4d2dc958dd6bc33 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 1 May 2023 16:16:53 +0300 Subject: [PATCH 3/3] sc8280xp: skip gcc debug mux programming for mccc Signed-off-by: Dmitry Baryshkov --- sc8280xp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc8280xp.c b/sc8280xp.c index 482d6e4..eabf328 100644 --- a/sc8280xp.c +++ b/sc8280xp.c @@ -426,7 +426,7 @@ static struct measure_clk sc8280xp_clocks[] = { { "disp1_cc_mdss_vsync_clk", &gcc, 0x82, &disp1_cc, 0x17 }, { "disp1_cc_sleep_clk", &gcc, 0x82, &disp1_cc, 0x46 }, { "disp1_cc_xo_clk", &gcc, 0x82, &disp1_cc, 0x45 }, - { "measure_only_mccc_clk", &gcc, 0xfeedbeef, &mc_cc, 0x50 }, + { "measure_only_mccc_clk", NULL, 0, &mc_cc, 0x50 }, {} };