[MIPS] VSMP: Synchronize cp0 counters on bootup.

Signed-off-by: Ralf Baechle <[email protected]>
This commit is contained in:
Ralf Baechle 2006-10-31 18:33:09 +00:00
commit 70e46f48cb
3 changed files with 7 additions and 2 deletions

View file

@ -153,6 +153,8 @@ static void __init smp_copy_vpe_config(void)
/* Propagate Config7 */
write_vpe_c0_config7(read_c0_config7());
write_vpe_c0_count(read_c0_count());
}
static unsigned int __init smp_vpe_init(unsigned int tc, unsigned int mvpconf0,

View file

@ -209,6 +209,7 @@ static unsigned int __init estimate_cpu_frequency(void)
#endif
#if defined(CONFIG_MIPS_ATLAS) || defined(CONFIG_MIPS_MALTA)
unsigned long flags;
unsigned int start;
local_irq_save(flags);
@ -217,13 +218,13 @@ static unsigned int __init estimate_cpu_frequency(void)
while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
/* Start r4k counter. */
write_c0_count(0);
start = read_c0_count();
/* Read counter exactly on falling edge of update flag */
while (CMOS_READ(RTC_REG_A) & RTC_UIP);
while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
count = read_c0_count();
count = read_c0_count() - start;
/* restore interrupts */
local_irq_restore(flags);