13 #include <linux/kernel.h>
16 #include <linux/time.h>
17 #include <linux/rtc.h>
39 printk (
"timebase_interrupt()\n");
44 static struct irqaction tbint_irqaction = {
45 .handler = timebase_interrupt,
51 init_internal_rtc(
void)
53 sit8xx_t
__iomem *sys_tmr = immr_map(im_sit);
56 clrbits16(&sys_tmr->sit_rtcsc, (RTCSC_SIE | RTCSC_ALE));
59 setbits16(&sys_tmr->sit_rtcsc, (RTCSC_RTF | RTCSC_RTE));
66 const unsigned int *
fp;
98 clk_r1 = immr_map(im_clkrstk);
101 out_be32(&clk_r1->cark_sccrk, ~KAPWR_KEY);
102 out_be32(&clk_r1->cark_sccrk, KAPWR_KEY);
106 clk_r2 = immr_map(im_clkrst);
107 setbits32(&clk_r2->car_sccr, 0x02000000);
135 sys_tmr1 = immr_map(im_sitk);
136 out_be32(&sys_tmr1->sitk_tbscrk, ~KAPWR_KEY);
137 out_be32(&sys_tmr1->sitk_rtcsck, ~KAPWR_KEY);
138 out_be32(&sys_tmr1->sitk_tbk, ~KAPWR_KEY);
139 out_be32(&sys_tmr1->sitk_tbscrk, KAPWR_KEY);
140 out_be32(&sys_tmr1->sitk_rtcsck, KAPWR_KEY);
141 out_be32(&sys_tmr1->sitk_tbk, KAPWR_KEY);
142 immr_unmap(sys_tmr1);
155 sys_tmr2 = immr_map(im_sit);
156 out_be16(&sys_tmr2->sit_tbscr, ((1 << (7 - (irq/2))) << 8) |
157 (TBSCR_TBF | TBSCR_TBE));
158 immr_unmap(sys_tmr2);
161 panic(
"Could not allocate timer IRQ!");
175 sys_tmr1 = immr_map(im_sitk);
176 sys_tmr2 = immr_map(im_sit);
180 out_be32(&sys_tmr1->sitk_rtck, KAPWR_KEY);
182 out_be32(&sys_tmr1->sitk_rtck, ~KAPWR_KEY);
184 immr_unmap(sys_tmr2);
185 immr_unmap(sys_tmr1);
192 sit8xx_t
__iomem *sys_tmr = immr_map(im_sit);
195 data =
in_be32(&sys_tmr->sit_rtc);
205 car8xx_t
__iomem *clk_r = immr_map(im_clkrst);
210 setbits32(&clk_r->car_plprcr, 0x00000080);
213 mtmsr(mfmsr() & ~0x1000);
215 in_8(&clk_r->res[0]);
216 panic(
"Restart failed\n");
219 static void cpm_cascade(
unsigned int irq,
struct irq_desc *
desc)
229 chip = irq_desc_get_chip(cdesc);
233 chip = irq_desc_get_chip(desc);
248 printk(
KERN_ERR "Failed interrupt 8xx controller initialization\n");
254 irq_set_chained_handler(irq, cpm_cascade);