在s5pc110平台发现一个现象,睡眠的时候过了一段时间系统自动唤醒了,然后马上就又睡眠下去,期间LCD,backligh都没有亮。当初以为是哪个中断触发了系统唤醒,可细想想不对啊,如果按键中断唤醒话怎么马上就睡下去了呢!带着这个问题大致看了下代码,原来是RTC造成的!这bug不过现在还不知道要不要改!!^_^
首先得清楚平台下支持哪些模式
了解在睡眠的模式的时候支持哪些wake-up的mode
- static void s5pv210_pm_prepare(void)
- {
- unsigned int tmp;
- /* ensure at least INFORM0 has the resume address */
- __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0);
- /* WFI for SLEEP mode configuration by SYSCON */
- tmp = __raw_readl(S5P_PWR_CFG);
- tmp &= S5P_CFG_WFI_CLEAN;
- tmp |= S5P_CFG_WFI_SLEEP;
- __raw_writel(tmp, S5P_PWR_CFG);
- printk("hbb test %s read S5P_PWR_CFG = %0x\n",__func__,tmp);
- /* SYSCON interrupt handling disable */
- tmp = __raw_readl(S5P_OTHERS);
- tmp |= S5P_OTHER_SYSC_INTOFF;
- __raw_writel(tmp, S5P_OTHERS);
- __raw_writel(0xffffffff, (VA_VIC0 + VIC_INT_ENABLE_CLEAR));
- __raw_writel(0xffffffff, (VA_VIC1 + VIC_INT_ENABLE_CLEAR));
- __raw_writel(0xffffffff, (VA_VIC2 + VIC_INT_ENABLE_CLEAR));
- __raw_writel(0xffffffff, (VA_VIC3 + VIC_INT_ENABLE_CLEAR));
- tmp = __raw_readl(S5P_WAKEUP_MASK);
- tmp &= ~(1 << 1 | 1 << 5);
- __raw_writel(tmp, S5P_WAKEUP_MASK);
- printk("hbb test %s read S5P_WAKEUP_MASK = %0x\n",__func__,tmp);
-
- s3c_pm_do_save(sromc_save, ARRAY_SIZE(sromc_save));
- s3c_pm_do_save(core_save, ARRAY_SIZE(core_save));
- }
上面那段代码很好解释在sleep的模式的仅支持EINT 和RTC wake-up了!
现在再看看唤醒的时候
- static inline void s3c_pm_arch_show_resume_irqs(void)
- {
- printk( "S5P_WAKEUP_STAT 0x%X\n", __raw_readl(S5P_WAKEUP_STAT));
- printk("%s: s3c_irqwake_eintmask = 0x%x \n",__func__,__raw_readl(S5P_EINT_WAKEUP_MASK));
- printk( "EINT_PEND 0x%X, 0x%X, 0x%X, 0x%X\n",
- __raw_readl(S5P_EINT_PEND(0)), __raw_readl(S5P_EINT_PEND(1)),
- __raw_readl(S5P_EINT_PEND(2)), __raw_readl(S5P_EINT_PEND(3)));
- }
发现在自动唤醒的时候打印S5P_WAKEUP_STAT的value为0x2,再看看下面图
阅读(1690) | 评论(0) | 转发(0) |