diff --git a/debugcc.c b/debugcc.c index b12d62a..80aa48c 100644 --- a/debugcc.c +++ b/debugcc.c @@ -195,7 +195,10 @@ static void measure(const struct measure_clk *clk) mux_prepare_enable(clk->primary, clk->mux); - clk_rate = measure_default(clk); + if (clk->leaf && clk->leaf->measure) + clk_rate = clk->leaf->measure(clk); + else + clk_rate = measure_default(clk); mux_disable(clk->primary); diff --git a/debugcc.h b/debugcc.h index 61b11cc..e9f27f4 100644 --- a/debugcc.h +++ b/debugcc.h @@ -35,6 +35,8 @@ #define CORE_CC_BLOCK "core" +struct measure_clk; + struct debug_mux { unsigned long phys; void *base; @@ -61,6 +63,7 @@ struct debug_mux { unsigned int ahb_mask; void (*premeasure)(struct debug_mux *mux); + unsigned long (*measure)(const struct measure_clk *clk); void (*postmeasure)(struct debug_mux *mux); };