shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
阅读:3773回复:5

pxa270休眠唤醒的新进展,高手帮忙分析下,感谢。

楼主#
更多 发布于:2008-09-04 02:16
release版与debug版的区别在哪?把debug版本下的display驱动放到release下编译照样出样下列错误。。。

GP1 Irq
PwrButtonIntrThread :go to sleep!
SA2Video::PowerHandler++++++++++
DispDrvrPowerHandler----------bOff = 1
DispDrvrPowerHandler----------bOff = 1
DispDrvrPowerHandler----------bOff = 1
+LCD driver: suspend
XllpLCDSuspend+++++++++++++++++++
PWR_PowerDown++++++++++++++++++++++++++
BKL_PowerDown
SetBackLightState****0**** ulduty:0
SetBackLightState ****5555555555****
fly++++++++++1111OEMPowerOff!pPmgrSleepParams=0xba8ba268
flyflyfly+PmgrInitSleepParam
++PmgrInitSleepParam
-PmgrInitSleepParam
fly++++++++++2222OEMPowerOff!pPmgrSleepParams=0xba8ba268
+++++++++++++
+++++XllpPmSleepCLevelProcessing+++++
++++++XllpPmSleepCLevelProcessing++++
+++++++++++++
+++++++++++++
+++++XllpPmSaveRegsInList+++++
+++++++++++++
+++++XllpPmSaveAllRegLists+++++
+++++++++++++
蔲lyflyfly+OEMPowerOff-----------------end

BKL_PowerUp
SetBackLightState****0**** ulduty:1023
SetBackLightState ****5555555555****
PWR_PowerUp++++++++++++++++++++
Data Abort: Thread=9a4de400 Proc=98517f60 'device.exe'
AKY=00000005 PC=96cc5748(NK.EXE+0x0000d748) RA=9a4de400(???+0x9a4de400) BVA=0b1ee000 FSR=000000f5
ERROR: Power Handler function yield to low priority thread.


这是release版本的NK,总是死在这个地方。编了个debug版本的,居然过去了。不知道怎么回事。高手帮忙分析一下吧。感谢。。。。

GP1 Irq
0x9a4246e0: PwrButtonIntrThread :go to sleep!
GP1 Irq

0x9a4246e0: Powering Off system:
0x9a4246e0:   Calling GWES power proc.
0x9GP1 Irq
a4246e0: SA2Video::PowerHandler++++++++++
0x9a4246e0: DispDrvrPowerHandler----------bOff = 1
0x9a4246e0: DispDrvrPowerHandler----------bOff = 1
0x9a4246e0: DispDrvrPowerHandler----------bOff = 1
0x9a4246e0: +LCD driver: suspend
0x9a4246e0: XllpLCDSuspend+++++++++++++++++++
0x9a4246e0:   Calling device manager power proc.
0x9a4246e0: PWR_PowerDown++++++++++++++++++++++++++
0x9a4246e0: BKL_PowerDown
0x9a4246e0: SetBackLightState****0**** ulduty:0
0x9a4246e0: SetBackLightState ****5555555555****
0x9a4246e0: WARNING: Event 7a5e88a6 is deleted while other thread is waiting for it
0x9a4246e0:   Calling OEMPowerOff...
fly++++++++++1111OEMPowerOff!pPmgrSleepParams=0xba8ba268
flyflyfly+PmgrInitSleepParam
++PmgrInitSleepParam
-PmgrInitSleepParam
fly++++++++++2222OEMPowerOff!pPmgrSleepParams=0xba8ba268
+++++++++++++
+++++XllpPmSleepCLevelProcessing+++++
++++++XllpPmSleepCLevelProcessing++++
+++++++++++++
+++++++++++++
+++++XllpPmSaveRegsInList+++++
+++++++++++++
+++++XllpPmSaveAllRegLists+++++
+++++++++++++
奻lyflyfly+OEMPowerOff-----------------end
0x9a4246e0: Back from OEMPowerOff
0x9a4246e0:   Calling device manager power proc.
0x9a4246e0:
BKL_PowerUp
0x9a4246e0: SetBackLightState****0**** ulduty:1023
0x9a4246e0: SetBackLightState ****5555555555****
0x9a4246e0: PWR_PowerUp++++++++++++++++++++
0x9a4246e0:   Calling GWES power proc.
0x9a4246e0: SA2Video::PowerHandler++++++++++
0x9a4246e0: DispDrvrPowerHandler----------bOff = 0

0x9a4246e0: DispDrvrPowerHandler----------bOff = 0
0x9a4246e0: DispDrvrPowerHandler----------bOff = 0
0x9a4246e0: +LCD driver: resume
0x9a4246e0: XllpLCDResume+++++++++++++++++++
0x9a4246e0: XllpLCDInit****GPDR01=ffffc808,GAFR01_U=988a8510
0x9a4246e0: LTV350QV----------------------++++
0x9a4246e0: **********LCD Controller Register Begin**********
0x9a4246e0:      LCCR0= 5b008f8 LCCR1= 1a05153f LCCR2= 10228ef LCCR3= 4300004 LCCR4=0 LCCR5=3f3f3f3f
0x9a4246e0:      FBR0= 0 FBR1= 0 FBR2= 0 FBR3= 0 FBR4=0 FBR5=0 FBR6=0
0x9a4246e0:      LCSR1= 0 LCSR0= 0 LIIDR= 60b259a8 TRGBR= aa5500 TCR=754f
0x9a4246e0:      OVL1C1= 200000 OVL1C2= 0 OVL2C1= 200000 OVL2C2= 0
0x9a4246e0:      CCR= 0 CMDCR= 100
0x9a4246e0:      FDADR0= a3a00000 FSADR0= 0 FIDR0= 0 LDCMD0= 0
0x9a4246e0:      FDADR1= 0 FSADR1= 0 FIDR1= 0 LDCMD1= 0
0x9a4246e0:      FDADR2= 0 FSADR2= 0 FIDR2= 0 LDCMD2= 0
0x9a4246e0:      FDADR3= 0 FSADR3= 0 FIDR3= 0 LDCMD3= 0
0x9a4246e0:      FDADR4= 0 FSADR4= 0 FIDR4= 0 LDCMD4= 0
0x9a4246e0:      FDADR5= 0 FSADR5= 0 FIDR5= 0 LDCMD5= 0
0x9a4246e0:      FDADR6= 0 FSADR6= 0 FIDR6= 0 LDCMD6= 0
0x9a4246e0: **********LCD Controller Register End**********
0x9a4246e0:   Returning to normally scheduled programming.
http://www.esdevelop.cn
high
论坛版主
论坛版主
  • 注册日期2002-08-10
  • 最后登录2010-07-26
  • 粉丝4
  • 关注0
  • 积分60分
  • 威望655点
  • 贡献值0点
  • 好评度56点
  • 原创分0分
  • 专家分60分
沙发#
发布于:2008-09-04 03:45
看起来已经唤醒了。

我的想法, 能不能排除一下, 先把电影管理的驱动去掉, 先排除这个原因, 指定是pwr等驱动。
jidazhuo1
驱动牛犊
驱动牛犊
  • 注册日期2008-01-07
  • 最后登录2010-10-09
  • 粉丝0
  • 关注0
  • 积分3分
  • 威望6点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2008-09-09 11:53
DATASHEET里的说明,要确保1显示完当前buffer,2外设都是idle.相应clock都停止.3写ox7到pmu的寄存器.如果没有前边两步,就出现你的错误了.我也曾经遇到过.后来改好了.
shuiii
驱动牛犊
驱动牛犊
  • 注册日期2005-08-26
  • 最后登录2011-05-30
  • 粉丝1
  • 关注0
  • 积分605分
  • 威望173点
  • 贡献值0点
  • 好评度57点
  • 原创分0分
  • 专家分0分
地板#
发布于:2008-09-11 21:13
引用第2楼jidazhuo1于2008-09-09 11:53发表的  :
DATASHEET里的说明,要确保1显示完当前buffer,2外设都是idle.相应clock都停止.3写ox7到pmu的寄存器.如果没有前边两步,就出现你的错误了.我也曾经遇到过.后来改好了.


现在发现DEBUG版本唤醒后也是死了。屏没有显示了。。
1.显示完当前buffer???请问我要怎么样确认呢,
2.外设都是idle.相应clock都停止.,是不是suspend的时候,在每个驱动的XXX_PowerDown函数下要的CLOCK都关掉.
大侠能说得详细一点吗?这问题困住我都一个月了了。。过不去啊。。。。
http://www.esdevelop.cn
jidazhuo1
驱动牛犊
驱动牛犊
  • 注册日期2008-01-07
  • 最后登录2010-10-09
  • 粉丝0
  • 关注0
  • 积分3分
  • 威望6点
  • 贡献值0点
  • 好评度2点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2008-09-22 15:20
    unsigned int    i=0;
    XLLP_PM_SPMU_T  *pSPMReg=NULL;
    XLLP_PM_BPMU_T  *pBPMUReg=NULL;
    volatile XLLP_CLKMGR_T *pCLKS         = (volatile XLLP_CLKMGR_T *)OALPAtoVA(MONAHANS_BASE_REG_PA_CLKMGR, FALSE);
#if 0
    volatile DWORD temp;
#endif
    BOOL bSideCarEnabled=FALSE;
    BOOL bSramEnabled = FALSE;

    volatile UINT32     *pMFPBase = (volatile UINT32 *)OALPAtoVA(MONAHANS_BASE_REG_PA_MFP, FALSE);
    volatile UINT32     *pMFP_I2C_SCL = pMFPBase + 0x2C4;
    volatile UINT32     *pMFP_I2C_SDA = pMFPBase + 0x2C8;
    volatile UINT32     *pOSCCReg = (volatile UINT32 *)OALPAtoVA(MONAHANS_BASE_REG_PA_OSCC, FALSE);        

    XLLP_RTC_T    *pRTC=NULL;

#ifdef RTC_WAKEUP_TEST
    DWORD rcnt;
#endif

#ifdef ENABLE_RCOMP
    XLLP_MEMC_T memc;
#endif

#ifdef MHLV_A2_WA_SAVE_RESTORE_OSCR0
    volatile XLLP_OST_T * pOST= (volatile XLLP_OST_T  * ) OALPAtoVA(MONAHANS_BASE_REG_PA_OST, FALSE);
#endif
OALMSGS(TRUE, (L"+++OEMPowerOff\r\n"));
    bSramEnabled = EnableSRAM();

    /* Check if it need to back up the SRAM content */
    if (bSramEnabled)
    {
        /*Before sleep, back up the SRAM content which had been used only in IMM driver */
        SaveSRAMDataToDDR(g_SleepContent.aucSRAMSave, sizeof(g_SleepContent.aucSRAMSave));
    }

    // enable boot rom clock
    XllpClockEnable((P_XLLP_CLKMGR_T)pCLKS, XLLP_CLK_BOOT, XLLP_TRUE);


    pSPMReg = OALPAtoVA(MONAHANS_BASE_REG_PA_SPMU, FALSE);
    pBPMUReg = OALPAtoVA(MONAHANS_BASE_REG_PA_BPMU, FALSE);
    pRTC=OALPAtoVA(MONAHANS_BASE_REG_PA_RTC, FALSE);
    
    InitRegBase();
    
    for(i=0;i<g_SleepContent.RegCount;i++)
    {
        g_SleepContent.SleepSave= *g_SleepContent.RegBase;
    }

    /*save clock manager registers */
    XllpClockSave(OALPAtoVA(MONAHANS_BASE_REG_PA_CLKMGR, FALSE), &(g_SleepContent.Clkmgr));    

    
    /*save interrupt controller register */    
    XllpINTCSave(OALPAtoVA(MONAHANS_BASE_REG_PA_INTC,FALSE), &(g_SleepContent.Intc));    

    /*save GPIO registers */    
    XllpGpioSave(OALPAtoVA(MONAHANS_BASE_REG_PA_GPIO,FALSE), &(g_SleepContent.Gpio));        

    /*initialize XLLP_PM_DATA_SAVE_T */    
    /* should set:modeSaveFlags, areaAddress, flushFunc, psprAddress,     * copySramFunc, sramAddress, extendedChecksumByteCount */    

    g_SleepContent.PMData.modeSaveFlags = 0x3f;//XLLP_PM_MODE_SAVE_FLAG_SVC;    
    g_SleepContent.PMData.areaAddress = (unsigned long)&(g_SleepContent.PMData);    
    g_SleepContent.PMData.flushFunc = FlushCpuCache;    
    g_SleepContent.PMData.psprAddress = (unsigned long)&(pSPMReg->pspr);    
    
    //content->pm_data->sramAddress = sram_start;    
    //content->pm_data.copySramFunc = copy_bootcode_to_sram;    
    g_SleepContent.PMData.extendedChecksumByteCount = sizeof(SLEEP_CONTENT)- sizeof(XLLP_PM_DATA_SAVE_T);    

    // setup ext_wakeup1 as rising and falling edge wake-up source
    // config pwer register
    //*((XLLP_VUINT32_T *)OALPAtoVA(0x43000010, FALSE)) |= 0xd;// masked by Andre

    // get access permission of 0x5c010000 from CADDO    
    g_SRAM_Start =(unsigned int) OALPAtoVA(MONAHANS_BASE_REG_PA_IMSTORAGE+0x14000, FALSE);    

    OALMSGS(TRUE, (L"g_SRAM_Start is :0x%x\r\n", g_SRAM_Start));    
    
    /* save the resume back address into DDR SDRAM */    
    OALMSGS(TRUE, (L"Finish init save content\r\n"));    
    
    *(UINT32 *)(BSP_RESUME_PARAM1_UA)     = OALVAtoPA(XllpPmResumeFromSleep);    
    *(UINT32 *)(BSP_RESUME_PARAM2_UA) = OALVAtoPA(&(g_SleepContent.PMData));    
    
    /* clear PWSR */
    pSPMReg->pwsr =     pSPMReg->pwsr;

    /* clear and set PECR */    
    pSPMReg->pecr = pSPMReg->pecr;    
    pSPMReg->pecr |= 0x1<<28;    
    //pSPMReg->pecr &= 0xA0000000;    // masked by Andre

    /* clear ASCR, ARSR */    
    pBPMUReg->ascr =     pBPMUReg->ascr;
    pBPMUReg->arsr =     pBPMUReg->arsr;


    /* Ensure CLK_POUT is disabled*/
    *pOSCCReg = 0x1E5;
    //OALMSGS(TRUE, (L"OEMPowerOff:Ensure CLK_POUT is disabled\r\n"));    

    /* Set Pull-Ups on I2C Lines for sleep mode*/
      // this has been done in XllpPmEnterSleep function
    *pMFP_I2C_SCL = 0x141;
    *pMFP_I2C_SDA = 0x141;
    //OALMSGS(TRUE, (L"OEMPowerOff:Set Pull-Ups on I2C Lines for sleep mode\r\n"));    

      /* Enable DC-DC regulator in Deep Sleep
      Set L1_DIS bit to 1.  Set L1_DIS bit to 1.  L0_EN determines source for S2.
      L0_EN determines source for S2.*/
      pSPMReg->pcfr |= 0x2000;
      /*Set L0_EN bit to 0.  The DC-DC converter is used in S2 and S3.*/
      pSPMReg->pcfr &= ~(0x1<<12);
    //OALMSGS(TRUE, (L"OEMPowerOff:Enable DC-DC regulator in Deep Sleep\r\n"));    

      /* Set SRAM retention while in S2. All SRAM / L2  ON*/
    pBPMUReg->ad3r = 0x01FF;
    //OALMSGS(TRUE, (L"OEMPowerOff:Set SRAM retention while in S2\r\n"));    
    /* make sure that sram bank 0 is not off */    
    //pBPMUReg->ad3r |= 0x1; // masked


    // can be wake up by RTC and EXT_WAKEUP[0,1] from sevice unit.    
    // EXT_WAKEUP[0] connects SW6 and EXT_WAKEUP[1] connects IRQ_N of PMIC.    
    // pSPMReg->pwer = 0xF;
    
    // PWER =     0x8000000F;    
    

    pBPMUReg->ad3sr |= 0xffffffff;    

#ifdef RTC_WAKEUP_TEST
       /* Add RTC as wakeup source for test ...*/
        rcnt = pRTC->rcnr;
     OALMSGS(TRUE, (L"current time is %d\r\n", rcnt));
     pRTC->rtar = rcnt + 20;
     RT_ALARM_INT_EN(pRTC->rtsr);
#endif
     RT_ALARM_INT_EN(pRTC->rtsr);

    SetWakeupSource();    
    
    /* go to Zzzz */
    //BSPPowerOff();
    OALKitlPowerOff();
    /*For GPIO status maintainance before system sleep, Jane, 20080807, begin*/
    GPIO_ReservedWhenPoweroff();
    /*For GPIO status maintainance before system sleep, Jane, 20080807, end*/
    //
    // Implements platform-specific bits just before we suspend.
    // Usually contains power optimziations that are not safely applied until this point.
    //
    if(NULL != pPlatformPreSuspend)
        (*pPlatformPreSuspend)();

#ifdef BSP_SLEEP_D0CS_WORKAROUND
    SleepWAWriteRegister((short)0x0b, "0000110000000000000000000000001" );       // Prepare for S2, workaround.
#endif

    OALMSGS(TRUE, (L"Call XllpPmEnterSleep\r\n"));    
    //OALMSGS(TRUE, (L"Dump pin values before going to sleep\r\n"));
    //DumpMFPDomainAuto();
#if 0
    if(pCLKS->d0cken_b & 0x200)
    {
        bSideCarEnabled = TRUE;            // already enabled; no need to do anything.
    }
    else
    {
        bSideCarEnabled = FALSE;
        pCLKS->d0cken_b |= 0x200;        // It's off. Enable SideCar (usb2.0 and GCU).
        temp = pCLKS->d0cken_b;
    }

#endif
#ifdef MHLV_A2_WA_SAVE_RESTORE_OSCR0
    oscr0_saved = pOST->oscr0;
#endif

    /* ****************************** ENTER D3 *********************** */
    XllpPmEnterSleep(&(g_SleepContent.PMData));                 // Enter S2, wait for wake.
    /* ****************************** EXIT D3  *********************** */

#ifdef MHLV_A2_WA_SAVE_RESTORE_OSCR0
    pOST->oscr0 = oscr0_saved ;
#endif

    *pOSCCReg |= 0x800;
#if 0    
    if(FALSE==bSideCarEnabled)
    {
        //RETAILMSG(1, (TEXT("[IPM] - Disabling sidecar\r\n")));
        pCLKS->d0cken_b &= ~0x200;        // It was off upon entry. Re-disable SideCar (usb2.0 and GCU).
        temp = pCLKS->d0cken_b;
    }
#endif

    // inside this function, it will check dbgserial enabled or not
    InitDebugSerial((UINT32) MONAHANS_BASE_REG_PA_SIRUART, FALSE);

    OALMSGS(TRUE, (L"Resume back from XllpPmEnterSleep\r\n"));

    /*Andre: disable EXT_WAKEUP0 interrupt here*/
    pSPMReg->pwer &=   ~0x1; // disable EXT_WAKEUP0 rising edge wake up
    pBPMUReg->ad3er &= ~0x1 ; //disable RTC Alarm wakeup and EXT_WAKEUP0 edge detect
    pSPMReg->pecr &= ~0x1<<28; //don't generate interrupt when EXT_WAKEUP0 pin changes

        RT_ALARM_INT_DIS(pRTC->rtsr);

#ifdef RTC_WAKEUP_TEST
        RT_ALARM_INT_DIS(pRTC->rtsr);
#endif

#ifdef BSP_SLEEP_D0CS_WORKAROUND    
    SleepWAWriteRegister((short)0x0b, "0000000000000000000000000000000"); // Complete S2 Exit.
#endif


    //BSPPowerOn();
//resume_back:
    

    g_oalWakeSource = GetWakeupSource();
    OALMSGS(TRUE,(L"Wakeup Source %d, AD3SR 0x%x\r\n",g_oalWakeSource, pBPMUReg->ad3sr));

    /* come back */        
    /* restore GPIO registers */    
    XllpGpioRestore(OALPAtoVA(MONAHANS_BASE_REG_PA_GPIO,FALSE), &g_SleepContent.Gpio);    
    /* :restore interrupt controller register */    
    XllpINTCRestore(OALPAtoVA(MONAHANS_BASE_REG_PA_INTC,FALSE), &(g_SleepContent.Intc));    
    /* restore OST timer registers */    
    //XllpOSTRestore(OST_BASE, &(content->ost));    
    /* restore clok manager registers */    
    XllpClockRestore(OALPAtoVA(MONAHANS_BASE_REG_PA_CLKMGR,FALSE), &(g_SleepContent.Clkmgr));
    /* some device such as PMIC will need special handle for EXT_WAKEUP[0,1]*/    

    for(i=0;i<g_SleepContent.RegCount;i++)
    {
        *g_SleepContent.RegBase=g_SleepContent.SleepSave;
    }

    //read back to make sure all register have writen.
    for(i=0;i<g_SleepContent.RegCount;i++)
    {
        g_SleepContent.SleepSave= *g_SleepContent.RegBase;

    }
    
    OALKitlPowerOn();

#ifdef ENABLE_RCOMP
    // re-init the RCOMP eval, and enable RCOMP interrupt.
    memc.dmem=( XLLP_UINT32_T) OALPAtoVA(MONAHANS_BASE_REG_PA_DMEMC, FALSE);
    memc.rcEvalInterval=0x13D62; //0.2 second RCOMP updates
    memc.rcRange=2;          // resistive compensation range
    OALMSG(TRUE, (L"OEMPowerOff(): to restart the RCOMP eval, and enable RCOMP interrupts\r\n"));
    XllpMemcRcompInit(&memc);
#endif

    /* Check if it need to retore the SRAM or turn off the SRAM power */
    if (bSramEnabled)
    {
        /* Restore the SRAM content which had been used only in IMM driver */
        RestoreSRAMDataFromDDR(g_SleepContent.aucSRAMSave, sizeof(g_SleepContent.aucSRAMSave));
    }
    else
        /* turn off SRAM */
        DisableSRAM();
        
    
    // disable boot rom clock
    XllpClockEnable((P_XLLP_CLKMGR_T)pCLKS, XLLP_CLK_BOOT, XLLP_FALSE);

    //NKDbgPrintfW(TEXT("***Wakeup Source %d, AD3SR 0x%x\r\n"), g_oalWakeSource, pBPMUReg->ad3sr);

    pBPMUReg->ascr &= 0x7FFFFFFF;

    OALMSGS(TRUE, (L"Return from OEMPowerOff\r\n"));    
参考如上代码
liulord
驱动牛犊
驱动牛犊
  • 注册日期2007-07-31
  • 最后登录2009-05-18
  • 粉丝0
  • 关注0
  • 积分22分
  • 威望155点
  • 贡献值0点
  • 好评度25点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2008-10-13 15:02
先将pwr驱动的pwrup修改下,只出调试不做操作。再看过不过得去吧。
游客

返回顶部