9 #include <linux/timex.h>
10 #include <linux/time.h>
14 #include <linux/sched.h>
18 #include <asm/types.h>
19 #include <asm/signal.h>
21 #include <asm/delay.h>
22 #include <asm/irq_regs.h>
26 #undef USE_CASCADE_TIMERS
30 unsigned char timer_count,
t1;
31 unsigned short presc_count;
36 timer_count = *R_TIMER0_DATA;
37 presc_count = *R_TIM_PRESC_STATUS;
41 if (timer_count != t1){
43 presc_count = *R_TIM_PRESC_STATUS;
66 count = *R_TIMER0_DATA;
98 #define start_watchdog reset_watchdog
100 #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
101 static int watchdog_key = 0;
108 #define WATCHDOG_MIN_FREE_PAGES 8
113 #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
118 *R_WATCHDOG =
IO_FIELD(R_WATCHDOG,
key, watchdog_key) |
129 #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
131 *R_WATCHDOG =
IO_FIELD(R_WATCHDOG,
key, watchdog_key) |
152 #ifdef USE_CASCADE_TIMERS
154 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) |
155 IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) |
158 IO_STATE( R_TIMER_CTRL, clksel1, cascade0) |
161 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz);
210 #ifdef USE_CASCADE_TIMERS
212 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) |
213 IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) |
215 IO_STATE( R_TIMER_CTRL, tm1, stop_ld) |
216 IO_STATE( R_TIMER_CTRL, clksel1, cascade0) |
218 IO_STATE( R_TIMER_CTRL, tm0, stop_ld) |
219 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz);
222 IO_FIELD( R_TIMER_CTRL, timerdiv1, 0) |
223 IO_FIELD( R_TIMER_CTRL, timerdiv0, 0) |
226 IO_STATE( R_TIMER_CTRL, clksel1, cascade0) |
229 IO_STATE( R_TIMER_CTRL, clksel0, c6250kHz);
232 IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) |
235 IO_STATE(R_TIMER_CTRL, tm1, stop_ld) |
236 IO_STATE(R_TIMER_CTRL, clksel1, c19k2Hz) |
238 IO_STATE(R_TIMER_CTRL, tm0, stop_ld) |
239 IO_STATE(R_TIMER_CTRL, clksel0, flexible);
242 IO_FIELD(R_TIMER_CTRL, timerdiv1, 192) |
246 IO_STATE(R_TIMER_CTRL, clksel1, c19k2Hz) |
249 IO_STATE(R_TIMER_CTRL, clksel0, flexible);
255 IO_STATE(R_IRQ_MASK0_SET, timer0,
set);
263 #if defined(CONFIG_ETRAX_WATCHDOG) && !defined(CONFIG_SVINTO_SIM)
264 printk(
"Enabling watchdog...\n");
277 IO_STATE(R_IRQ_MASK0_SET, watchdog_nmi,
set);