summaryrefslogtreecommitdiff
path: root/cpu/nios2/interrupts.c
diff options
context:
space:
mode:
authorScott McNutt <smcnutt@psyent.com>2006-06-08 11:59:57 -0400
committerScott McNutt <smcnutt@psyent.com>2006-06-08 11:59:57 -0400
commitc2ced000f4f18361feb36ea257fabbb46913e1d4 (patch)
tree6ba42fa4c9b37b96491846e8e807f351bc5202e1 /cpu/nios2/interrupts.c
parente461a24113c66747510b07930a83b0d84171a559 (diff)
downloadu-boot-imx-c2ced000f4f18361feb36ea257fabbb46913e1d4.zip
u-boot-imx-c2ced000f4f18361feb36ea257fabbb46913e1d4.tar.gz
u-boot-imx-c2ced000f4f18361feb36ea257fabbb46913e1d4.tar.bz2
Nios II - Fix I/O Macros and mini-app stubs
-Fix asm/io.h macros -Eliminate use of CACHE_BYPASS in cpu code -Eliminate assembler warnings -Fix mini-app stubs and force no small data Patch by Scott McNutt, 08 Jun 2006
Diffstat (limited to 'cpu/nios2/interrupts.c')
-rw-r--r--cpu/nios2/interrupts.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/cpu/nios2/interrupts.c b/cpu/nios2/interrupts.c
index 4a6da58..4685161 100644
--- a/cpu/nios2/interrupts.c
+++ b/cpu/nios2/interrupts.c
@@ -27,6 +27,7 @@
#include <nios2.h>
#include <nios2-io.h>
+#include <asm/io.h>
#include <asm/ptrace.h>
#include <common.h>
#include <command.h>
@@ -79,7 +80,7 @@ void tmr_isr (void *arg)
/* Interrupt is cleared by writing anything to the
* status register.
*/
- tmr->status = 0;
+ writel (&tmr->status, 0);
timestamp += CFG_NIOS_TMRMS;
#ifdef CONFIG_STATUS_LED
status_led_tick(timestamp);
@@ -88,16 +89,17 @@ void tmr_isr (void *arg)
static void tmr_init (void)
{
- nios_timer_t *tmr =(nios_timer_t *)CACHE_BYPASS(CFG_NIOS_TMRBASE);
+ nios_timer_t *tmr =(nios_timer_t *)CFG_NIOS_TMRBASE;
+
+ writel (&tmr->status, 0);
+ writel (&tmr->control, 0);
+ writel (&tmr->control, NIOS_TIMER_STOP);
- tmr->control &= ~(NIOS_TIMER_START | NIOS_TIMER_ITO);
- tmr->control |= NIOS_TIMER_STOP;
#if defined(CFG_NIOS_TMRCNT)
- tmr->periodl = CFG_NIOS_TMRCNT & 0xffff;
- tmr->periodh = (CFG_NIOS_TMRCNT >> 16) & 0xffff;
+ writel (&tmr->periodl, CFG_NIOS_TMRCNT & 0xffff);
+ writel (&tmr->periodh, (CFG_NIOS_TMRCNT >> 16) & 0xffff);
#endif
- tmr->control |= ( NIOS_TIMER_ITO |
- NIOS_TIMER_CONT |
+ writel (&tmr->control, NIOS_TIMER_ITO | NIOS_TIMER_CONT |
NIOS_TIMER_START );
irq_install_handler (CFG_NIOS_TMRIRQ, tmr_isr, (void *)tmr);
}