/* This function will init timer0 for system ticks  */
void rt_hw_timer_init()
/* This function will init timer0 for system ticks  */
void rt_hw_timer_init()
{
    volatile timer_regs_t *regs =
        (volatile timer_regs_t*)DAVINCI_TIMER1_BASE;
    psc_change_state(DAVINCI_DM365_LPSC_TIMER0, 3);
    psc_change_state(DAVINCI_DM365_LPSC_TIMER1, 3);
    regs->tcr &= ~(0x3UL << 6);
    regs->tgcr |=(0x1UL << 2);
    regs->tgcr |= (0x1UL << 0);
    regs->prd12 = 24000000/RT_TICK_PER_SECOND;
    regs->tim12 = 0;
    regs->tcr |= (0x2UL << 6);
    rt_hw_interrupt_install(IRQ_DM365_TINT2, rt_timer_handler,
                            RT_NULL, "timer1_12");
    rt_hw_interrupt_umask(IRQ_DM365_TINT2);
 }