Ejemplo n.º 1
0
void __cpuinit jzcpu_timer_setup(void)
{
	int cpu = smp_processor_id();
	struct jz_timerevent *evt = &per_cpu(jzclockevent, cpu);
	evt->cpu = cpu;
	evt->state = INIT;
	switch(cpu) {
	case 0:
		evt->state = FINI;
		evt->ch = 5;
		evt->irq = IRQ_TCU1;
		evt->count_addr = TCU_IOBASE + CH_TCNT(evt->ch);
		evt->latch_addr = TCU_IOBASE + CH_TDFR(evt->ch);
		evt->ctrl_addr = TCU_IOBASE;
		evt->config_addr = TCU_IOBASE + CH_TCSR(evt->ch);
		tcu_writel(CH_TDHR(evt->ch), 0xffff);
		tcu_writel(TCU_TMSR, ((1 << evt->ch) | (1 << (evt->ch + 16))));

		break;
	case 1:
		evt->ch = 15;
		evt->irq = IRQ_TCU0;
		evt->count_addr = APB_OST_IOBASE + OSTCNTL;
		evt->latch_addr = APB_OST_IOBASE + OSTDR;
		evt->ctrl_addr = TCU_IOBASE;
		evt->config_addr = APB_OST_IOBASE + OSTCSR;
		apbost_writel(OSTCNTH, 0);
		break;
	}
#ifdef CONFIG_HOTPLUG_CPU
	jz_set_cpu_affinity(evt->irq,0);
#endif
	jz_clockevent_init(evt,cpu);
}
Ejemplo n.º 2
0
void __cpuinit jzcpu_timer_setup(void)
{
    struct jz_timerevent *evt = &jzclockevent;

    tcu_writel(TCU_TSCR,(1 << CLKEVENT_CH));
    tcu_writel(TCU_TMSR,(1 << CLKEVENT_CH)|(1 << (CLKEVENT_CH + 16)));
    tcu_writel(CH_TDHR(CLKEVENT_CH), 0xffff);
    jz_clockevent_init(evt);
}