From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/3] OMAP: use {read, write}l to access timer registers
Date: Wed, 25 Mar 2009 00:41:40 +0100 [thread overview]
Message-ID: <20090324234140.GA2360@localhost.localdomain> (raw)
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
cpu/arm925t/interrupts.c | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/cpu/arm925t/interrupts.c b/cpu/arm925t/interrupts.c
index 361047b..e5c77f7 100644
--- a/cpu/arm925t/interrupts.c
+++ b/cpu/arm925t/interrupts.c
@@ -35,24 +35,21 @@
#include <common.h>
#include <arm925t.h>
#include <configs/omap1510.h>
+#include <asm/io.h>
#define TIMER_LOAD_VAL 0xffffffff
-/* macro to read the 32 bit timer */
-#define READ_TIMER (*(volatile ulong *)(CONFIG_SYS_TIMERBASE+8))
-
-static ulong timestamp;
-static ulong lastdec;
+static uint32_t timestamp;
+static uint32_t lastdec;
/* nothing really to do with interrupts, just starts up a counter. */
int interrupt_init (void)
{
- int32_t val;
-
/* Start the decrementer ticking down from 0xffffffff */
- *((int32_t *) (CONFIG_SYS_TIMERBASE + LOAD_TIM)) = TIMER_LOAD_VAL;
- val = MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE | (CONFIG_SYS_PTV << MPUTIM_PTV_BIT);
- *((int32_t *) (CONFIG_SYS_TIMERBASE + CNTL_TIMER)) = val;
+ __raw_writel(TIMER_LOAD_VAL, CONFIG_SYS_TIMERBASE + LOAD_TIM);
+ __raw_writel(MPUTIM_ST | MPUTIM_AR | MPUTIM_CLOCK_ENABLE |
+ (CONFIG_SYS_PTV << MPUTIM_PTV_BIT),
+ CONFIG_SYS_TIMERBASE + CNTL_TIMER);
/* init the timestamp and lastdec value */
reset_timer_masked();
@@ -106,13 +103,13 @@ void udelay (unsigned long usec)
void reset_timer_masked (void)
{
/* reset time */
- lastdec = READ_TIMER; /* capure current decrementer value time */
+ lastdec = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM);
timestamp = 0; /* start "advancing" time stamp from 0 */
}
ulong get_timer_masked (void)
{
- ulong now = READ_TIMER; /* current tick value */
+ uint32_t now = __raw_readl(CONFIG_SYS_TIMERBASE + READ_TIM);
if (lastdec >= now) { /* normal mode (non roll) */
/* normal mode */
--
1.5.3.8
next reply other threads:[~2009-03-24 23:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-24 23:41 Ladislav Michl [this message]
2009-03-31 17:00 ` [U-Boot] [PATCH 3/3] OMAP: use {read, write}l to access timer registers Jean-Christophe PLAGNIOL-VILLARD
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=20090324234140.GA2360@localhost.localdomain \
--to=ladis@linux-mips.org \
--cc=u-boot@lists.denx.de \
/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