Ejemplo n.º 1
0
void dump_timer_regs(void)
{
#if 0
    unsigned int cntfrq = 0xFFFFFFFF;
    unsigned int cntkctl = 0xFFFFFFFF;
#endif
    unsigned int cntpct_lo = 0xFFFFFFFF;
    unsigned int cntpct_hi = 0xFFFFFFFF;
#if 0
    unsigned int cntvct_lo = 0xFFFFFFFF;
    unsigned int cntvct_hi = 0xFFFFFFFF;
#endif
    unsigned int cntp_ctl = 0xFFFFFFFF;
    unsigned int cntp_cval_lo = 0xFFFFFFFF;
    unsigned int cntp_cval_hi = 0xFFFFFFFF;
    unsigned int cntp_tval = 0xFFFFFFFF;
#if 0
    unsigned int cntv_ctl = 0xFFFFFFFF;
    unsigned int cntv_cval_lo = 0xFFFFFFFF;
    unsigned int cntv_cval_hi = 0xFFFFFFFF;
    unsigned int cntv_tval = 0xFFFFFFFF;
#endif

#if 0
    read_cntfrq(cntfrq);
    read_cntkctl(cntkctl);
#endif
    read_cntpct(cntpct_lo, cntpct_hi);
#if 0
    read_cntvct(cntvct_lo, cntvct_hi);
#endif
    read_cntp_ctl(cntp_ctl);
    read_cntp_cval(cntp_cval_lo, cntp_cval_hi);
    read_cntp_tval(cntp_tval);
#if 0
    read_cntv_ctl(cntv_ctl);
    read_cntv_cval(cntv_cval_lo, cntv_cval_hi);
    read_cntv_tval(cntv_tval);
#endif

#if 0
    printk("[ca7_timer]0. cntfrq = 0x%x\n", cntfrq);
    printk("[ca7_timer]1. cntkctl = 0x%x\n", cntkctl);
#endif
    printk("[ca7_timer]2. cntpct_lo = 0x%08x, cntpct_hi = 0x%08x\n", cntpct_lo, cntpct_hi);
#if 0
    printk("[ca7_timer]3. cntvct_lo = 0x%08x, cntvct_hi = 0x%08x\n", cntvct_lo, cntvct_hi);
#endif
    printk("[ca7_timer]4. cntp_ctl = 0x%x\n", cntp_ctl);
    printk("[ca7_timer]5. cntp_cval_lo = 0x%08x, cntp_cval_hi = 0x%08x\n", cntp_cval_lo, cntp_cval_hi);
    printk("[ca7_timer]6. cntp_tval = 0x%08x\n", cntp_tval);
#if 0
    printk("[ca7_timer]7. cntv_ctl = 0x%x\n", cntv_ctl);
    printk("[ca7_timer]8. cntv_cval_lo = 0x%08x, cntv_cval_hi = 0x%08x\n", cntv_cval_lo, cntv_cval_hi);
    printk("[ca7_timer]9. cntv_tval = 0x%08x\n", cntv_tval);
#endif
}
Ejemplo n.º 2
0
u64 generic_timer_timestamp(void)
{
	return (read_cntvct() * timer_mult) >> timer_shift;
}