Example #1
0
void __init plat_time_init(void)
{
	unsigned int prid = read_c0_prid() & (PRID_COMP_MASK | PRID_IMP_MASK);
	unsigned int freq;

	init_rtc();
	estimate_frequencies();

	freq = mips_hpt_frequency;
	if ((prid != (PRID_COMP_MIPS | PRID_IMP_20KC)) &&
	    (prid != (PRID_COMP_MIPS | PRID_IMP_25KF)))
		freq *= 2;
	freq = freqround(freq, 5000);
	printk("CPU frequency %d.%02d MHz\n", freq/1000000,
	       (freq%1000000)*100/1000000);

	mips_scroll_message();

#ifdef CONFIG_I8253
	/* Only Malta has a PIT. */
	setup_pit_timer();
#endif

#ifdef CONFIG_MIPS_GIC
	if (gic_present) {
		freq = freqround(gic_frequency, 5000);
		printk("GIC frequency %d.%02d MHz\n", freq/1000000,
		       (freq%1000000)*100/1000000);
#ifdef CONFIG_CLKSRC_MIPS_GIC
		gic_clocksource_init(gic_frequency);
#endif
	}
#endif
}
Example #2
0
void __init plat_time_init(void)
{
    unsigned int est_freq;

    /* Set Data mode - binary. */
    CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);

    est_freq = estimate_cpu_frequency();

    printk("CPU frequency %d.%02d MHz\n", est_freq/1000000,
           (est_freq%1000000)*100/1000000);

    cpu_khz = est_freq / 1000;

    mips_scroll_message();

#ifdef CONFIG_I8253		    /* Only Malta has a PIT */
    setup_pit_timer();
#endif

#ifdef CONFIG_CSRC_GIC
    gic_clocksource_init();
#endif

    plat_perf_setup();
}
Example #3
0
void __init plat_time_init(void)
{
#if defined (CONFIG_CSRC_GIC)
	if (gic_present) {
		gic_clocksource_init(mips_cpu_feq);
		gic_start_count();
	} else
#endif
		mips_hpt_frequency = mips_cpu_feq / 2;

#if defined (CONFIG_RALINK_SYSTICK_COUNTER)
	ra_systick_clockevent_init();
	ra_systick_clocksource_init();
#endif
}