* [PATCH] cevt-txx9: Reset timer counter on initialize
@ 2008-06-24 14:26 Atsushi Nemoto
2008-06-28 18:39 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Atsushi Nemoto @ 2008-06-24 14:26 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
The txx9_tmr_init() will not clear a timer counter register on certain
case. The counter register is cleared on 1->0 transition of TCE bit
if CRE=1. So just clearing TCE bit is not enough.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index 795cb8f..b5fc4eb 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -161,6 +161,9 @@ void __init txx9_tmr_init(unsigned long baseaddr)
struct txx9_tmr_reg __iomem *tmrptr;
tmrptr = ioremap(baseaddr, sizeof(struct txx9_tmr_reg));
+ /* Start once to make CounterResetEnable effective */
+ __raw_writel(TXx9_TMTCR_CRE | TXx9_TMTCR_TCE, &tmrptr->tcr);
+ /* Stop and reset the counter */
__raw_writel(TXx9_TMTCR_CRE, &tmrptr->tcr);
__raw_writel(0, &tmrptr->tisr);
__raw_writel(0xffffffff, &tmrptr->cpra);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-28 18:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 14:26 [PATCH] cevt-txx9: Reset timer counter on initialize Atsushi Nemoto
2008-06-28 18:39 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox