Преглед изворни кода

Fix sc520 timer interrupt generation

The current implementation has the timer being started before the interrupt
handler is installed. It the interrupt occurs before the handler is
installed, the timer interrupt is never reset and the timer stops

Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Graeme Russ пре 15 година
родитељ
комит
04ff9ab158
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      cpu/i386/sc520/sc520_timer.c

+ 3 - 3
cpu/i386/sc520/sc520_timer.c

@@ -54,9 +54,6 @@ int timer_init(void)
 	write_mmcr_word (SC520_GPTMR1MAXCMPA, 100);
 	write_mmcr_word (SC520_GPTMR1MAXCMPA, 100);
 	write_mmcr_word (SC520_GPTMR1CTL, 0xe009);
 	write_mmcr_word (SC520_GPTMR1CTL, 0xe009);
 
 
-	/* Clear the GP Timers status register */
-	write_mmcr_byte (SC520_GPTMRSTA, 0x07);
-
 	/* Register the SC520 specific timer interrupt handler */
 	/* Register the SC520 specific timer interrupt handler */
 	register_timer_isr (sc520_timer_isr);
 	register_timer_isr (sc520_timer_isr);
 
 
@@ -64,6 +61,9 @@ int timer_init(void)
 	irq_install_handler (0, timer_isr, NULL);
 	irq_install_handler (0, timer_isr, NULL);
 	unmask_irq (0);
 	unmask_irq (0);
 
 
+	/* Clear the GP Timer 1 status register to get the show rolling*/
+	write_mmcr_byte (SC520_GPTMRSTA, 0x02);
+
 	return 0;
 	return 0;
 }
 }