Skip to content

Commit bde23d9

Browse files
committed
debugcc: support setting xo_div4 custom value
Some xo require special value to set it to /4 divisor. Introduce xo_div4_val to handle this special implementation. Signed-off-by: Christian Marangi <[email protected]>
1 parent 5dd1208 commit bde23d9

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

debugcc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ unsigned long measure_gcc(const struct measure_clk *clk,
122122
unsigned long xo_div4;
123123

124124
xo_div4 = readl(mux->base + gcc->xo_div4_reg);
125-
writel(xo_div4 | 1, mux->base + gcc->xo_div4_reg);
125+
if (gcc->xo_div4_val)
126+
writel(xo_div4 | gcc->xo_div4_val, mux->base + gcc->xo_div4_reg);
127+
else
128+
writel(xo_div4 | 1, mux->base + gcc->xo_div4_reg);
126129

127130
raw_count_short = measure_ticks(gcc, 0x1000);
128131
raw_count_full = measure_ticks(gcc, 0x10000);

debugcc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ struct gcc_mux {
6666
struct debug_mux mux;
6767

6868
unsigned int xo_div4_reg;
69+
unsigned int xo_div4_val;
70+
6971
unsigned int debug_ctl_reg;
7072
unsigned int debug_status_reg;
7173
};

0 commit comments

Comments
 (0)