30 #include <asm/sizes.h>
33 #include <asm/system_misc.h>
35 #include <mach/hardware.h>
37 static struct clk *
clk_pll, *clk_bus, *clk_uart, *clk_timerl, *clk_timerh,
39 static unsigned long latch;
63 intmr1 &= ~(1 << d->
irq);
79 static void int1_unmask(
struct irq_data *d)
84 intmr1 |= 1 << d->
irq;
90 .irq_mask = int1_mask,
91 .irq_unmask = int1_unmask,
94 static void int2_mask(
struct irq_data *d)
99 intmr2 &= ~(1 << (d->
irq - 16));
103 static void int2_ack(
struct irq_data *d)
110 static void int2_unmask(
struct irq_data *d)
115 intmr2 |= 1 << (d->
irq - 16);
119 static struct irq_chip int2_chip = {
121 .irq_mask = int2_mask,
122 .irq_unmask = int2_unmask,
129 for (i = 0; i <
NR_IRQS; i++) {
131 irq_set_chip_and_handler(i, &int1_chip,
136 irq_set_chip_and_handler(i, &int2_chip,
167 static unsigned long clps711x_gettimeoffset(
void)
169 unsigned long hwticks;
171 return (hwticks * (
tick_nsec / 1000)) / latch;
183 static struct irqaction clps711x_timer_irq = {
184 .name =
"CLPS711x Timer Tick",
186 .handler = p720t_timer_interrupt,
189 static void add_fixed_clk(
struct clk *
clk,
const char *
name,
int rate)
195 static void __init clps711x_timer_init(
void)
205 pll = (osc *
tmp) / 2;
225 if (tmp & SYSFLG2_CKMODE) {
237 add_fixed_clk(clk_pll,
"pll", pll);
238 add_fixed_clk(clk_bus,
"bus", bus);
239 add_fixed_clk(clk_uart,
"uart", uart);
240 add_fixed_clk(clk_timerl,
"timer_lf", timl);
241 add_fixed_clk(clk_timerh,
"timer_hf", timh);
242 add_fixed_clk(clk_tint,
"tint", 64);
243 add_fixed_clk(clk_spi,
"spi", spi);
245 pr_info(
"CPU frequency set at %i Hz.\n", cpu);
247 latch = (timh +
HZ / 2) /
HZ;
259 .init = clps711x_timer_init,
260 .offset = clps711x_gettimeoffset,
268 static void clps711x_idle(
void)
276 static int __init clps711x_idle_init(
void)