mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org
Subject: [PATCH] clocksource: fix Marvell timer read-back value
Date: Thu, 27 Jun 2013 19:39:20 +0200	[thread overview]
Message-ID: <1372354760-31955-1-git-send-email-sebastian.hesselbarth@gmail.com> (raw)

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>
---
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: barebox@lists.infradead.org
---
 drivers/clocksource/mvebu.c |    2 +-
 drivers/clocksource/orion.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clocksource/mvebu.c b/drivers/clocksource/mvebu.c
index 1a9d573..6e5ceba 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 d27477a..6902c72 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 = {
-- 
1.7.2.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2013-06-27 17:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 17:39 Sebastian Hesselbarth [this message]
2013-06-29  8:43 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372354760-31955-1-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox