int __init arch_cpu_clockevent_init(void) { int rc; virtual_addr_t sctl_base; /* Map control registers */ sctl_base = vmm_host_iomap(REALVIEW_SCTL_BASE, 0x1000); /* Map timer registers */ pba8_timer0_base = vmm_host_iomap(REALVIEW_PBA8_TIMER0_1_BASE, 0x1000); /* Initialize timers */ rc = realview_timer_init(sctl_base, pba8_timer0_base, REALVIEW_TIMER1_EnSel, IRQ_PBA8_TIMER0_1, pba8_timer0_handler); if (rc) { return rc; } /* Unmap control register */ rc = vmm_host_iounmap(sctl_base, 0x1000); if (rc) { return rc; } return VMM_OK; }
int vmm_cpu_clocksource_init(void) { int rc; virtual_addr_t sctl_base; /* Map control registers */ sctl_base = vmm_host_iomap(REALVIEW_SCTL_BASE, 0x1000); /* Map timer registers */ pba8_timer2_base = vmm_host_iomap(REALVIEW_PBA8_TIMER2_3_BASE, 0x1000); pba8_timer3_base = pba8_timer2_base + 0x20; /* Initialize timers */ rc = realview_timer_init(sctl_base, pba8_timer2_base, REALVIEW_TIMER3_EnSel, IRQ_PBA8_TIMER2_3, NULL); if (rc) { return rc; } rc = realview_timer_init(sctl_base, pba8_timer3_base, REALVIEW_TIMER4_EnSel, IRQ_PBA8_TIMER2_3, NULL); if (rc) { return rc; } /* Unmap control register */ rc = vmm_host_iounmap(sctl_base, 0x1000); if (rc) { return rc; } /* Configure timer3 as free running source */ rc = realview_timer_counter_setup(pba8_timer3_base); if (rc) { return rc; } realview_timer_enable(pba8_timer3_base); return VMM_OK; }
static void __init realview_pba8_timer_init(void) { timer0_va_base = __io_address(REALVIEW_PBA8_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_PBA8_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PBA8_TIMER2_3_BASE) + 0x20; realview_timer_init(IRQ_PBA8_TIMER0_1); }
static void __init realview_pb1176_timer_init(void) { timer0_va_base = __io_address(REALVIEW_PB1176_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_PB1176_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20; realview_clk_init(__io_address(REALVIEW_SYS_BASE), true); realview_timer_init(IRQ_DC1176_TIMER0); }
static void __init realview_pb11mp_timer_init(void) { timer0_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; realview_clk_init(__io_address(REALVIEW_SYS_BASE), false); realview_timer_init(IRQ_TC11MP_TIMER0_1); realview_pb11mp_twd_init(); }
static void __init realview_pb11mp_timer_init(void) { timer0_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20; #ifdef CONFIG_LOCAL_TIMERS twd_base = __io_address(REALVIEW_TC11MP_TWD_BASE); #endif realview_timer_init(IRQ_TC11MP_TIMER0_1); }
static void __init realview_pbx_timer_init(void) { timer0_va_base = __io_address(REALVIEW_PBX_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_PBX_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_PBX_TIMER2_3_BASE) + 0x20; #ifdef CONFIG_LOCAL_TIMERS if (core_tile_pbx11mp() || core_tile_pbxa9mp()) twd_base = __io_address(REALVIEW_PBX_TILE_TWD_BASE); #endif realview_timer_init(IRQ_PBX_TIMER0_1); }
static void __init realview_eb_timer_init(void) { unsigned int timer_irq; timer0_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE) + 0x20; if (core_tile_eb11mp() || core_tile_a9mp()) timer_irq = IRQ_EB11MP_TIMER0_1; else timer_irq = IRQ_EB_TIMER0_1; realview_timer_init(timer_irq); realview_eb_twd_init(); }
static void __init realview_eb_timer_init(void) { unsigned int timer_irq; timer0_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE); timer1_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE) + 0x20; timer2_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE); timer3_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE) + 0x20; if (core_tile_eb11mp() || core_tile_a9mp()) { #ifdef CONFIG_LOCAL_TIMERS twd_base = __io_address(REALVIEW_EB11MP_TWD_BASE); #endif timer_irq = IRQ_EB11MP_TIMER0_1; } else timer_irq = IRQ_EB_TIMER0_1; realview_timer_init(timer_irq); }