FSL DDR: Remove duplicate setting of cs0_bnds register on 86xx.
[oweals/u-boot.git] / cpu / nios / interrupts.c
index 981b8f7d80f140b1398964f18568eb93daacf159..75e491d8436cbbc1f3bd3e432c42d6da111f039b 100644 (file)
 #include <asm/ptrace.h>
 #include <common.h>
 #include <command.h>
+#include <watchdog.h>
+#ifdef CONFIG_STATUS_LED
+#include <status_led.h>
+#endif
 
 /****************************************************************************/
 
@@ -51,6 +55,7 @@ void reset_timer (void)
 
 ulong get_timer (ulong base)
 {
+       WATCHDOG_RESET ();
        return (timestamp - base);
 }
 
@@ -72,6 +77,9 @@ void timer_interrupt (struct pt_regs *regs)
        nios_timer_t *tmr = (nios_timer_t *)CFG_NIOS_TMRBASE;
        tmr->status = 0;
        timestamp += CFG_NIOS_TMRMS;
+#ifdef CONFIG_STATUS_LED
+       status_led_tick(timestamp);
+#endif
 }
 #endif
 
@@ -122,6 +130,10 @@ int interrupt_init (void)
 
        tmr->control &= ~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;
+#endif
 #endif
 
        for (vec=0; vec<64; vec++ ) {
@@ -161,13 +173,13 @@ void irq_install_handler (int vec, interrupt_handler_t *handler, void *arg)
 }
 
 /*************************************************************************/
-#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
+#if defined(CONFIG_CMD_IRQ)
 int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
        int vec;
 
        printf ("\nInterrupt-Information:\n");
-       printf ("Nr  Routine   Arg       CouIt's ok to cnt\n");
+       printf ("Nr  Routine   Arg       Count\n");
 
        for (vec=0; vec<64; vec++) {
                if (irq_vecs[vec].handler != NULL) {
@@ -181,4 +193,4 @@ int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        return (0);
 }
-#endif  /* CONFIG_COMMANDS & CFG_CMD_IRQ */
+#endif