27 #include "powertv-clock.h"
30 #define PLL_GET_M(x) (((x) >> 8) & 0x000000FF)
31 #define PLL_GET_N(x) (((x) >> 16) & 0x000000FF)
32 #define PLL_GET_P(x) (((x) >> 24) & 0x00000007)
39 unsigned int pll_reg,
m,
n,
p;
40 unsigned int fin = 54000;
48 pr_info(
"MIPS PLL Register:0x%x M=%d N=%d P=%d\n", pll_reg, m, n, p);
51 fout = ((2 * n * fin) / (m * (0x01 << p)));
53 pr_info(
"MIPS Clock Freq=%d kHz\n", fout);
64 .name =
"powertv-counter",
70 static void __init powertv_c0_hpt_clocksource_init(
void)
74 pr_info(
"CPU frequency %d.%02d MHz\n", pll_freq / 1000,
75 (pll_freq % 1000) * 100 / 1000);
115 pr_crit(
"%s: read %llx\n", __func__, ((
u64) hi << 32) | lo);
116 return ((
u64) hi << 32) |
lo;
119 #define TIM_C_SIZE 48
122 .name =
"powertv-tim_c",
134 static void __init powertv_tim_c_clocksource_init(
void)
136 const unsigned long counts_per_second = 27000000 / 8;
138 clocksource_tim_c.
rating = 200;
140 clocksource_register_hz(&clocksource_tim_c, counts_per_second);
149 powertv_c0_hpt_clocksource_init();
150 powertv_tim_c_clocksource_init();