主题 : 210休眠问题----请高手协助 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 58322
精华: 0
发帖: 32
金钱: 160 两
威望: 32 点
贡献值: 0 点
综合积分: 64 分
注册时间: 2011-11-06
最后登录: 2023-03-24
楼主  发表于: 2014-12-19 17:01

 210休眠问题----请高手协助

各位s5pv210方面的高手,小弟最近在调试其休眠功能,根据手册上说:
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0To enter the SLEEP mode,
1. Set SLEEP_CFG based on the users' requirements.
2. Set CFG_STANDBYWFI field of PWR_CFG to 2’b11.
3. Set SYSCON_INT_DISABLE field of OTHERS to 1’b1
4. Execute Wait-For-Interrupt instruction (WFI). If SYSCON_INT_DISABLE field of OTHERS is still 1'b1 after
 calling wfi instruction, this indicates wfi instruction is ignored by the processor and user should call wfi instruction again.
MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0
Then the SYSCON performs the following sequence to enter SLEEP mode.
1. Complete all active bus transactions.
2. Complete all active memory controller transactions.
3. Allow the external DRAM enter self-refresh mode (to preserve DRAM contents).
4. Disable all PLLs.
5. Selectively disable OSCs except 32.768 KHz.
6. XPWRRGTON becomes low to power off external voltage regulator.


但是,我执行了休眠后,发现板子也停止无响应,但是用万用表测量MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0XPWRRGTON 引脚,发现其一直是高的!!!!不知道为什么??我的代码如下:


static void s5pv210_pm_prepare(void)
{
    unsigned int tmp;
    printk("s5pv210_pm_prepare ... \n");
    /* ensure at least INFORM0 has the resume address */
    //__raw_writel(virt_to_phys(show_on_debug), S5P_INFORM0);
    __raw_writel(virt_to_phys(s3c_cpu_resume), S5P_INFORM0);
    #if 1
    tmp = __raw_readl(S5P_SLEEP_CFG);//1 Set SLEEP_CFG based on the users' requirements.
    tmp &= ~(S5P_SLEEP_CFG_OSC_EN | S5P_SLEEP_CFG_USBOSC_EN);
    __raw_writel(tmp, S5P_SLEEP_CFG);
    #endif
    /* WFI for SLEEP mode configuration by SYSCON */
    //2 .Set CFG_STANDBYWFI field of PWR_CFG to 2’b11.
    tmp = __raw_readl(S5P_PWR_CFG);
    tmp &= S5P_CFG_WFI_CLEAN;
    tmp |= S5P_CFG_WFI_SLEEP;
    __raw_writel(tmp, S5P_PWR_CFG);

    /* SYSCON interrupt handling disable */
    //3. Set SYSCON_INT_DISABLE field of OTHERS to 1’b1
   
    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));
 
  __raw_writel(0xffffffff, S5P_VIC0REG(VIC_INT_SOFT_CLEAR));
    __raw_writel(0xffffffff, S5P_VIC1REG(VIC_INT_SOFT_CLEAR));
    __raw_writel(0xffffffff, S5P_VIC2REG(VIC_INT_SOFT_CLEAR));
    __raw_writel(0xffffffff, S5P_VIC3REG(VIC_INT_SOFT_CLEAR));
 
    tmp = __raw_readl(S5P_EINT_CON(0));
    tmp &= ~(7<<12);
    tmp |= (2<<12);
    __raw_writel(tmp,S5P_EINT_CON(0));
   
    tmp = __raw_readl(S5P_EINT_MASK(0));
    tmp &= ~(0xFF<<0);
    __raw_writel(tmp,S5P_EINT_MASK(0));
   
   
    tmp = __raw_readl(S5PV210_GPH0_BASE + 0x8);
    tmp &= ~(3 << 6);
    tmp |= (2 << 6);
    __raw_writel(tmp,(S5PV210_GPH0_BASE + 0x8));

    tmp = __raw_readl(S5PV210_GPH0_BASE);
    tmp |= 0xF000;
    __raw_writel(tmp,S5PV210_GPH0_BASE);

    tmp = __raw_readl(S5P_EINT_WAKEUP_MASK);
    tmp &= ~(1<<3);
    __raw_writel(tmp,S5P_EINT_WAKEUP_MASK);
   
    tmp = __raw_readl(S5P_WAKEUP_MASK);
    tmp &= ~((1<<5)|(1<<1));
    __raw_writel(tmp,S5P_WAKEUP_MASK);
   
    s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
}
void s5pv210_cpu_suspend(void)
{
    unsigned long tmp;

    /* issue the standby signal into the pm unit. Note, we
     * issue a write-buffer drain just in case */

    tmp = 0;
    printk("[[[[[[s5pv210_cpu_suspend]]]]]]\n");
    //4. Execute Wait-For-Interrupt instruction (WFI).
    asm("b 1f\n\t"
        ".align 5\n\t"
        "1:\n\t"
        "mcr p15, 0, %0, c7, c10, 5\n\t"
        "mcr p15, 0, %0, c7, c10, 4\n\t"
        "wfi" : : "r" (tmp));

    /* we should never get past here */
    panic("sleep resumed to originator?");
}


请各位有调试过此问题的高手,帮助解决!!!!!!!谢谢!!!!