summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-06-27 19:39:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-29 10:43:02 +0200
commit26e15b6ec89c75697f797534fd45a7d03f0b341f (patch)
tree45c3b6d3b41f14da7b75d18708a00492ac8bd04d /drivers/clocksource
parent80f51902a6ae1762ee353c24d02863e76d63fca4 (diff)
downloadbarebox-26e15b6ec89c75697f797534fd45a7d03f0b341f.tar.gz
barebox-26e15b6ec89c75697f797534fd45a7d03f0b341f.tar.xz
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>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/mvebu.c2
-rw-r--r--drivers/clocksource/orion.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clocksource/mvebu.c b/drivers/clocksource/mvebu.c
index 2b48a5c91b..8bedd99222 100644
--- a/drivers/clocksource/mvebu.c
+++ b/drivers/clocksource/mvebu.c
@@ -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 = {
diff --git a/drivers/clocksource/orion.c b/drivers/clocksource/orion.c
index 604b414742..e3db845de6 100644
--- a/drivers/clocksource/orion.c
+++ b/drivers/clocksource/orion.c
@@ -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 = {