9
0
Fork 0

clocksource: fix Marvell timer read-back value

Clocksource read callback expects incrementing timer values, while
internal timer on Marvell SoCs counts backwards. Fix value returned
by Marvell MVEBU and Orion clocksource drivers.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sebastian Hesselbarth 2013-06-27 19:39:20 +02:00 committed by Sascha Hauer
parent 80f51902a6
commit 26e15b6ec8
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ static __iomem void *timer_base;
uint64_t mvebu_clocksource_read(void)
{
return __raw_readl(timer_base + TIMER0_VAL_OFF);
return 0 - __raw_readl(timer_base + TIMER0_VAL_OFF);
}
static struct clocksource cs = {

View File

@ -34,7 +34,7 @@ static __iomem void *timer_base;
static uint64_t orion_clocksource_read(void)
{
return __raw_readl(timer_base + TIMER0_VAL);
return 0 - __raw_readl(timer_base + TIMER0_VAL);
}
static struct clocksource clksrc = {