mirror of
https://github.com/linux-msm/debugcc.git
synced 2026-02-25 13:12:32 -08:00
debugcc: supports custom xo rate
Some device have a different rate for the xo debug oscillator. Add support for defining custom xo rate in the primary debug mux. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
@@ -116,11 +116,15 @@ void mux_disable(struct debug_mux *mux)
|
||||
unsigned long measure_gcc(const struct measure_clk *clk,
|
||||
const struct debug_mux *mux)
|
||||
{
|
||||
unsigned int xo_rate = 4800000;
|
||||
uint64_t raw_count_short;
|
||||
uint64_t raw_count_full;
|
||||
struct gcc_mux *gcc = container_of(mux, struct gcc_mux, mux);
|
||||
unsigned long xo_div4;
|
||||
|
||||
if (gcc->xo_rate)
|
||||
xo_rate = gcc->xo_rate;
|
||||
|
||||
xo_div4 = readl(mux->base + gcc->xo_div4_reg);
|
||||
if (gcc->xo_div4_val)
|
||||
writel(xo_div4 | gcc->xo_div4_val, mux->base + gcc->xo_div4_reg);
|
||||
@@ -136,7 +140,7 @@ unsigned long measure_gcc(const struct measure_clk *clk,
|
||||
return 0;
|
||||
}
|
||||
|
||||
raw_count_full = ((raw_count_full * 10) + 15) * 4800000;
|
||||
raw_count_full = ((raw_count_full * 10) + 15) * xo_rate;
|
||||
raw_count_full = raw_count_full / ((0x10000 * 10) + 35);
|
||||
|
||||
if (mux->div_val)
|
||||
|
||||
Reference in New Issue
Block a user