From: Kumar Gala Date: Wed, 26 Oct 2005 04:02:59 +0000 (-0500) Subject: [PATCH] powerpc: Add support for Book-E timer config to generic_calibrate_decr X-Git-Tag: v2.6.15-rc1~59^2~102 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0fd6f717948083d480f38e97f62cc116faf0e534;p=linux-2.6-omap-h63xx.git [PATCH] powerpc: Add support for Book-E timer config to generic_calibrate_decr We need to initialize some control SPRS for timers on Book-E before we start taking decrementer interrupts. Signed-off-by: Kumar K. Gala Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 82f2cabb4f4..9f264c2f02c 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -610,6 +610,17 @@ void __init generic_calibrate_decr(void) ppc_proc_freq = *fp; } } +#ifdef CONFIG_BOOKE + /* Set the time base to zero */ + mtspr(SPRN_TBWL, 0); + mtspr(SPRN_TBWU, 0); + + /* Clear any pending timer interrupts */ + mtspr(SPRN_TSR, TSR_ENW | TSR_WIS | TSR_DIS | TSR_FIS); + + /* Enable decrementer interrupt */ + mtspr(SPRN_TCR, TCR_DIE); +#endif if (!node_found) printk(KERN_ERR "WARNING: Estimating processor frequency " "(not found)\n");