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);
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);
val = request_threaded_irq(MXC_INT_EPIT1, NULL, epit_timer_interrupt, IRQF_ONESHOT|IRQF_NO_SUSPEND , "EPIT1", (void *)0);
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?