* [U-Boot] [PATCH] arm: lpc32xx: Fix timer initialization
@ 2019-04-17 9:48 Gregory CLEMENT
2019-04-27 14:47 ` [U-Boot] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Gregory CLEMENT @ 2019-04-17 9:48 UTC (permalink / raw)
To: u-boot
The match controller register is not cleared during
initialization. However, some bits of this register may reset the TC if
tnMRx match it.
As we can't make any assumption about how U-Boot is launched by the first
stage bootloader (such as S1L) clearing this register ensure that the
timers work as expected.
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
arch/arm/cpu/arm926ejs/lpc32xx/timer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/timer.c b/arch/arm/cpu/arm926ejs/lpc32xx/timer.c
index 404ccbb716..b3ca686040 100644
--- a/arch/arm/cpu/arm926ejs/lpc32xx/timer.c
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/timer.c
@@ -33,6 +33,9 @@ static void lpc32xx_timer_reset(struct timer_regs *timer, u32 freq)
/* Set prescale counter value */
writel((get_periph_clk_rate() / freq) - 1, &timer->pr);
+
+ /* Ensure that the counter is not reset when matching TC */
+ writel(0, &timer->mcr);
}
static void lpc32xx_timer_count(struct timer_regs *timer, int enable)
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] arm: lpc32xx: Fix timer initialization
2019-04-17 9:48 [U-Boot] [PATCH] arm: lpc32xx: Fix timer initialization Gregory CLEMENT
@ 2019-04-27 14:47 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2019-04-27 14:47 UTC (permalink / raw)
To: u-boot
On Wed, Apr 17, 2019 at 11:48:45AM +0200, Gregory CLEMENT wrote:
> The match controller register is not cleared during
> initialization. However, some bits of this register may reset the TC if
> tnMRx match it.
>
> As we can't make any assumption about how U-Boot is launched by the first
> stage bootloader (such as S1L) clearing this register ensure that the
> timers work as expected.
>
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190427/447ff3c3/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-27 14:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 9:48 [U-Boot] [PATCH] arm: lpc32xx: Fix timer initialization Gregory CLEMENT
2019-04-27 14:47 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.