summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/timrot-imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/timrot-imx233.c')
-rw-r--r--firmware/target/arm/imx233/timrot-imx233.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/timrot-imx233.c b/firmware/target/arm/imx233/timrot-imx233.c
index 64a7c63f24..b2a1181ece 100644
--- a/firmware/target/arm/imx233/timrot-imx233.c
+++ b/firmware/target/arm/imx233/timrot-imx233.c
@@ -39,6 +39,8 @@ define_timer_irq(3)
39void imx233_setup_timer(unsigned timer_nr, bool reload, unsigned count, 39void imx233_setup_timer(unsigned timer_nr, bool reload, unsigned count,
40 unsigned src, unsigned prescale, bool polarity, imx233_timer_fn_t fn) 40 unsigned src, unsigned prescale, bool polarity, imx233_timer_fn_t fn)
41{ 41{
42 int oldstatus = disable_interrupt_save(IRQ_FIQ_STATUS);
43
42 timer_fns[timer_nr] = fn; 44 timer_fns[timer_nr] = fn;
43 45
44 HW_TIMROT_TIMCTRL(timer_nr) = src | prescale; 46 HW_TIMROT_TIMCTRL(timer_nr) = src | prescale;
@@ -65,6 +67,8 @@ void imx233_setup_timer(unsigned timer_nr, bool reload, unsigned count,
65 imx233_enable_interrupt(INT_SRC_TIMER(timer_nr), false); 67 imx233_enable_interrupt(INT_SRC_TIMER(timer_nr), false);
66 /* finally update */ 68 /* finally update */
67 __REG_SET(HW_TIMROT_TIMCTRL(timer_nr)) = HW_TIMROT_TIMCTRL__UPDATE; 69 __REG_SET(HW_TIMROT_TIMCTRL(timer_nr)) = HW_TIMROT_TIMCTRL__UPDATE;
70
71 restore_interrupt(oldstatus);
68} 72}
69 73
70void imx233_timrot_init(void) 74void imx233_timrot_init(void)