免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1996 | 回复: 0
打印 上一主题 下一主题

[操作系统] s5pv210休眠问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-12-19 17:04 |只看该作者 |倒序浏览
各位s5pv210方面的高手,小弟最近在调试其休眠功能,根据手册上说:

To 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.

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.

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

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 + 0x;
    tmp &= ~(3 << 6);
    tmp |= (2 << 6);
    __raw_writel(tmp,(S5PV210_GPH0_BASE + 0x);

    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?";
}

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

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP