AnsweredAssumed Answered

Interrupt for EPIT is not working in sleep mode.

Question asked by James Ban on Oct 27, 2014
Latest reply on Nov 4, 2014 by Shousheng Zhao

I moved the question to this community.

---------------------------------------

Now I am trying to make a timer which is working at sleep mode of iMX6.

BSP version is Linux 3.0.35(imx_3.0.35_4.0.0).

Because already GPT has been used as general timer in the kernel, EPIT has been used for a special timer.

The use case is to wake up the system from sleep mode after several seconds.(for example 100 sec)

I confirmed that the interrupt has worked well at active mode and the timer counter has gone well at sleep mode.

But there has been always a crash in kernel side whenever the interrupt has happened at sleep mode.

The setting is below for the special timer.

 

val = __raw_readl(MXC_CCM_CCGR1);

val |= (MXC_CCM_CCGRx_CG_MASK << MXC_CCM_CCGRx_CG6_OFFSET);

  __raw_writel(val, MXC_CCM_CCGR1);

hwtimer_base = ioremap(EPIT1_BASE_ADDR, SZ_4K);

  __raw_writel(0x0, hwtimer_base + EPITCR);

  __raw_writel(0xffffffff, hwtimer_base + EPITLR);

  __raw_writel(EPITCR_EN | EPITCR_CLKSRC_REF_LOW | EPITCR_WAITEN | EPITCR_STOPEN ,  hwtimer_base + EPITCR);

 

  set_irq_flags(MXC_INT_EPIT1, IRQF_VALID);

  val = request_threaded_irq(MXC_INT_EPIT1, NULL, epit_timer_interrupt, IRQF_ONESHOT|IRQF_NO_SUSPEND ,  "EPIT1", (void *)0);

  enable_irq_wake(MXC_INT_EPIT1);

 

val = __raw_readl(hwtimer_base + EPITCR);

val |= EPITCR_OCIEN;

__raw_writel(val, hwtimer_base + EPITCR);

 

tcmp = __raw_readl(hwtimer_base + EPITCNR);

  __raw_writel(-3200000, hwtimer_base + EPITCMPR);

 

Is there anything for me to do more for this use case?

Outcomes