?? power_test.c
字號:
////////////////////////////////
SetAlarmWakeup();
SetEintWakeup();
Outp32SYSC(0x804, 0x1<<7); // nBATF Wake-up Mask disable
SetBatteryFaultEvent(eFLT_INT);
SetADCTSWakeup();
/////////////////////////////////
// 1) Check&Enable HCLK_GATE[22,21,0]
// 2) Check BLK_PWR_STAT
// 3) Check&Clear WAKEUP_STAT
//////////////////////////////
CheckHCLK_ForPM();
CheckBLKPWR_ForPM();
CheckWAKESTAT_ForPM(1);
printf("\nCPU will goes to Deep Stop Mode!\n\n");
UART_TxEmpty(); //
////////////////////////////////
// Enter the Stop Mode
// 1. Setting "CFG_STANDBYWFI" to "2'b10" ( PWR_CFG(0x7E00_F804)
// 2. Setting "STOP_CFG"(0x7E00_F814) -> ARM_LOGIC/MEM, TOP_LOGIC/MEM OFF, OSC_EN ="0"
// 2. Enter to the STANDBYWFI Command
////////////////////////////////
SYSC_OSCSTAB(1);
SYSC_SetSTOPCFG(0, 0, 0, 0); // Set ARM_LOGIC/MEM, TOP_LOGIC/MEM to "1"
SYSC_SetCFGWFI(eSTOP, 0); //
MMU_WaitForInterrupt();
printf("CPU doesn't go to Deep Stop Mode\n");
/*
//Restore the port configurations
printf("\nI/O Port is restored!\n");
for(i=0;i<36;i++){
*( (volatile U32 *)0x56000000 + i)=portStatus[i];
}
*/
// Int. Disable
INTC_Disable(NUM_EINT1);
INTC_Disable(NUM_RTC_ALARM);
INTC_Disable(NUM_BATF);
INTC_Disable(NUM_PENDN);
}
// Int. Disable
INTC_Disable(NUM_EINT1);
INTC_Disable(NUM_RTC_ALARM);
INTC_Disable(NUM_BATF);
INTC_Disable(NUM_PENDN);
}
void ConfigSleepGPIO()
{
u32 uTTT1, uTTT2, uTTT3;
//printf("PHY OFF\n");
uTTT1 = Inp32SYSC(0x900);
uTTT1 = uTTT1|(1<<14);
Outp32SYSC(0x900, uTTT1); // USB_PWR_DN_EN
Outp32(0x7C100000, 0xF); // USB_Power Down
//printf("rOTHERS(PWR_DN_EN): 0x%x\n", Inp32SYSC(0x900));
uTTT1 = Inp32SYSC(0x900);
uTTT1 = uTTT1 & ~(1<<16);
Outp32SYSC(0x900, uTTT1);
//printf("rOTHERS(USB_SIG_MASK): 0x%x\n", Inp32SYSC(0x900));
//printf("rOTHERS(USB_SIG_MASK): 0x%x\n", Inp32SYSC(0x900));
// OTG Power Control....
printf("rGPA: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008000), Inp32(0x7F008004), Inp32(0x7F008008), Inp32(0x7F00800C),Inp32(0x7F008010));
printf("rGPB: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008020), Inp32(0x7F008024), Inp32(0x7F008028), Inp32(0x7F00802C),Inp32(0x7F008030));
printf("rGPC: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008040), Inp32(0x7F008044), Inp32(0x7F008048), Inp32(0x7F00804C),Inp32(0x7F008050));
printf("rGPD: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008060), Inp32(0x7F008064), Inp32(0x7F008068), Inp32(0x7F00806C),Inp32(0x7F008070));
printf("rGPE: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008080), Inp32(0x7F008084), Inp32(0x7F008088), Inp32(0x7F00808C),Inp32(0x7F008090));
printf("rGPF: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0080A0), Inp32(0x7F0080A4), Inp32(0x7F0080A8), Inp32(0x7F0080AC),Inp32(0x7F0080B0));
printf("rGPG: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0080C0), Inp32(0x7F0080C4), Inp32(0x7F0080C8), Inp32(0x7F0080CC),Inp32(0x7F0080D0));
printf("rGPH: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0080E0), Inp32(0x7F0080E4), Inp32(0x7F0080E8), Inp32(0x7F0080EC),Inp32(0x7F0080F0),Inp32(0x7F0080F4));
printf("rGPI: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008100), Inp32(0x7F008104), Inp32(0x7F008108), Inp32(0x7F00810C),Inp32(0x7F008110));
printf("rGPJ: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008120), Inp32(0x7F008124), Inp32(0x7F008128), Inp32(0x7F00812C),Inp32(0x7F008130));
printf("rGPK: 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008800), Inp32(0x7F008804), Inp32(0x7F008808), Inp32(0x7F00880C));
printf("rGPL: 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008810), Inp32(0x7F008814), Inp32(0x7F008818), Inp32(0x7F00881C));
printf("rGPM: 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008820), Inp32(0x7F008824), Inp32(0x7F008828));
printf("rGPN: 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008830), Inp32(0x7F008834), Inp32(0x7F008838));
printf("rGPO: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008140), Inp32(0x7F008144), Inp32(0x7F008148), Inp32(0x7F00814C),Inp32(0x7F008150));
printf("rGPP: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008160), Inp32(0x7F008164), Inp32(0x7F008168), Inp32(0x7F00816C),Inp32(0x7F008170));
printf("rGPQ: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008180), Inp32(0x7F008184), Inp32(0x7F008188), Inp32(0x7F00818C),Inp32(0x7F008190));
printf("rSPCON: 0x%x\n", Inp32(0x7F0081A0));
printf("rMEMCONSTOP: 0x%x, 0x%x\n", Inp32(0x7F0081B0), Inp32(0x7F0081B4));
printf("rMEMCONSLP: 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0081C0), Inp32(0x7F0081C4),Inp32(0x7F0081C8));
printf("rMEMDRVCON: 0x%x, 0x%x\n", Inp32(0x7F0081D0), Inp32(0x7F0081D4));
printf("rSPCONSLP, SPLEN: 0x%x, 0x%x\n", Inp32(0x7F008880),Inp32(0x7F008930));
printf("\n========================================================\n");
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_MEM0 : GPO, GPP, GPQ Group =>15~20uA
// :
//Outp32(0x7F008160, 0x0A88AAAA ); // GPPCON
Outp32(0x7F008160, 0x0); // GPPCON
GPIO_SetPullUDSleepAll(eGPIO_O, 0x55555AAA); //
GPIO_SetConRegSleepAll(eGPIO_O, 0xAAAAAAAA); // Input
GPIO_SetConRegSleepAll(eGPIO_P, 0x2AAAAAAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_P, 0x2AAAAAAA); // Pull-up
//GPIO_SetPullUDSleepAll(eGPIO_P, 0x2AAAAAAA); // Pull-up
GPIO_SetConRegSleepAll(eGPIO_Q, 0x2AAAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_Q, 0x2AAAA); // Pull-up
//Outp32(0x7F0081C0, 0x05555252); // MEM0CONSLP0
Outp32(0x7F0081C0, 0x05555151); // MEM0CONSLP0
//Outp32(0x7F0081C4, 0x2A95555); // MEM0CONSLP1
Outp32(0x7F0081C4, 0x2A95555); // MEM0CONSLP1 Waitn 矯規 救等巴
//printf("rGPOCONSLP: 0x%x\n", Inp32(0x7F00814c));
//printf("rGPOPUDSLP: 0x%x\n", Inp32(0x7F008150));
//printf("rGPPCONSLP: 0x%x\n", Inp32(0x7F00816C));
//printf("rGPPPUDSLP: 0x%x\n", Inp32(0x7F008170));
//printf("rGPQCONSLP: 0x%x\n", Inp32(0x7F00818C));
//printf("rGPQPUDSLP: 0x%x\n", Inp32(0x7F008190));
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_MEM1 : GPO, GPP Group
// : Default = 0
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_EXT : UART, I2C, IrDA, SPI0, Camera, PWM
// : GPA, GPB, GPC[0:3], GPF
GPIO_SetConRegSleepAll(eGPIO_A, 0xAAAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_A, 0x5555); // Pull-Down
GPIO_SetConRegSleepAll(eGPIO_B, 0x2AAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_B, 0x1555); // Pull-Down
GPIO_SetConRegSleepAll(eGPIO_C, 0xAAAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_C, 0xA555); // Pull-Down, I2C Pull-up
GPIO_SetConRegSleepAll(eGPIO_F, 0xAAAAAAAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_F, 0x95555555); // Pull-Down, XPWM_TOUT1 Pull-up
//printf("rGPACONSLP: 0x%x\n", Inp32(0x7F00800C));
//printf("rGPAPUDSLP: 0x%x\n", Inp32(0x7F008010));
//printf("rGPBCONSLP: 0x%x\n", Inp32(0x7F00802C));
//printf("rGPBPUDSLP: 0x%x\n", Inp32(0x7F008030));
//printf("rGPCCONSLP: 0x%x\n", Inp32(0x7F00804C));
//printf("rGPCPUDSLP: 0x%x\n", Inp32(0x7F008050));
//printf("rGPFCONSLP: 0x%x\n", Inp32(0x7F0080AC));
//printf("rGPFPUDSLP: 0x%x\n", Inp32(0x7F0080B0));
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_MMC : MMC, SPI1
// : GPC[4:7], GPG, GPH
GPIO_SetConRegSleepAll(eGPIO_G, 0x2AAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_G, 0x1555); // Pull-Down
GPIO_SetConRegSleepAll(eGPIO_H, 0xAAAAA); // Input
GPIO_SetPullUDSleepAll(eGPIO_H, 0x55555); // Pull-Down
//printf("rGPGCONSLP: 0x%x\n", Inp32(0x7F0080CC));
//printf("rGPGPUDSLP: 0x%x\n", Inp32(0x7F0080D0));
//printf("rGPGCONSLP: 0x%x\n", Inp32(0x7F0080F0));
//printf("rGPGPUDSLP: 0x%x\n", Inp32(0x7F0080F4));
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_PCM : Audio Port0,1 => Leakage 70uA瀝檔 => Tr Switch Issue??
// : GPD, GPE
GPIO_SetConRegSleepAll(eGPIO_D, 0x2AA); // Input
GPIO_SetPullUDSleepAll(eGPIO_D, 0x155); // Pull-Down
//GPIO_SetConRegSleepAll(eGPIO_E, 0x2AA); // Input, GPE1 Output "0"
GPIO_SetConRegSleepAll(eGPIO_E, 0x2A2); // Input, GPE1 Output "0"
GPIO_SetPullUDSleepAll(eGPIO_E, 0x151); // Pull-Down => 0??
//printf("rGPDCONSLP: 0x%x\n", Inp32(0x7F00806C));
//printf("rGPDPUDSLP: 0x%x\n", Inp32(0x7F008070));
//printf("rGPECONSLP: 0x%x\n", Inp32(0x7F00808C));
//printf("rGPEPUDSLP: 0x%x\n", Inp32(0x7F008090));
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_LCD : LCD => 犬牢 鞘夸 Output Low => 0, Input Pull-Down GPJ俊輯... GPJ11,8,9
// : GPI, GPJ
Outp32(0x7410800C, 0x0); // Bypass OFF
//GPIO_SetConRegSleepAll(eGPIO_I, 0x00000000); // Output Low
uTTT1 = Inp32(0x7F008108); // Back-up GPIPUD
GPIO_SetConRegSleepAll(eGPIO_I, 0xAAAAAAAA); // Input
Outp32(0x7F008108, uTTT1);
uTTT1 = Inp32(0x7F008150); //Back-up GPOPUDSLP
uTTT2 = Inp32(0x7F008190); //Back-up GPQPUDSLP
uTTT3 = Inp32(0x7F008100); // Back-up GPICONSLP
GPIO_SetPullUDSleepAll(eGPIO_I, 0x55555555); // Pull-Down
Outp32(0x7F008150, uTTT1);
Outp32(0x7F008190, uTTT2);
Outp32(0x7F008100, uTTT3);
uTTT1 = Inp32(0x7F008128); // Back-up GPJPUD
GPIO_SetConRegSleepAll(eGPIO_J, 0xAAAAAA); // Input
Outp32(0x7F008128, uTTT1);
uTTT1 = Inp32(0x7F008170); //Back-up GPPPUDSLP
uTTT2 = Inp32(0x7F008120); //Back-up GPJCON
GPIO_SetPullUDSleepAll(eGPIO_J, 0x555555); // Pull-Down
Outp32(0x7F008170, uTTT1);
Outp32(0x7F008120, uTTT2);
//printf("rGPICONSLP: 0x%x\n", Inp32(0x7F00810C));
//printf("rGPIPUDSLP: 0x%x\n", Inp32(0x7F008110));
//printf("rGPJCONSLP: 0x%x\n", Inp32(0x7F00812C));
//printf("rGPJPUDSLP: 0x%x\n", Inp32(0x7F008130));
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_HI : Host/Modem I/F => SMDK Default Setting...
// : GPK, GPL, GPM
//uTTT1 = Inp32(0x7F008010); // Back-up GPAPUDSLP
//GPIO_SetFunctionAll(eGPIO_K, 0x0, 0x0); // EVT0, GPKCON0, GPKCON1 => GPACON, GPADAT
//GPIO_SetFunctionAll(eGPIO_L, 0x0, 0x0);
//GPIO_SetFunctionAll(eGPIO_M, 0x0, 0x0);
//Outp32(0x7F008010, uTTT1);
// Ids_Alive@Sleep EVT0
GPIO_SetFunctionAll(eGPIO_L, 0x0, 0x0);
Outp32(0x7F00881c, 0x25555555); // GPL14 Pull-up, GPL13 Pull dn
///////////////////////////////////////////////////////////////////////////////////////////
// VDD_SYS : EINT Port, Reset, Clock, JTAG, Others
// : GPN[15:0]
uTTT1 = Inp32(0x7F008030); //Back-up GPBPUDSLP
GPIO_SetFunctionAll(eGPIO_N, 0x0, 0x0);
GPIO_SetPullUpDownAll(eGPIO_N, 0x55A95555);
Outp32(0x7F008030, uTTT1);
// Others
Outp32(0x7F008880, 0x1010); // Reset Out
// Printf All I/O
printf("\n========================================================\n");
printf("rGPA: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008000), Inp32(0x7F008004), Inp32(0x7F008008), Inp32(0x7F00800C),Inp32(0x7F008010));
printf("rGPB: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008020), Inp32(0x7F008024), Inp32(0x7F008028), Inp32(0x7F00802C),Inp32(0x7F008030));
printf("rGPC: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008040), Inp32(0x7F008044), Inp32(0x7F008048), Inp32(0x7F00804C),Inp32(0x7F008050));
printf("rGPD: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008060), Inp32(0x7F008064), Inp32(0x7F008068), Inp32(0x7F00806C),Inp32(0x7F008070));
printf("rGPE: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008080), Inp32(0x7F008084), Inp32(0x7F008088), Inp32(0x7F00808C),Inp32(0x7F008090));
printf("rGPF: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0080A0), Inp32(0x7F0080A4), Inp32(0x7F0080A8), Inp32(0x7F0080AC),Inp32(0x7F0080B0));
printf("rGPG: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0080C0), Inp32(0x7F0080C4), Inp32(0x7F0080C8), Inp32(0x7F0080CC),Inp32(0x7F0080D0));
printf("rGPH: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0080E0), Inp32(0x7F0080E4), Inp32(0x7F0080E8), Inp32(0x7F0080EC),Inp32(0x7F0080F0),Inp32(0x7F0080F4));
printf("rGPI: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008100), Inp32(0x7F008104), Inp32(0x7F008108), Inp32(0x7F00810C),Inp32(0x7F008110));
printf("rGPJ: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008120), Inp32(0x7F008124), Inp32(0x7F008128), Inp32(0x7F00812C),Inp32(0x7F008130));
printf("rGPK: 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008800), Inp32(0x7F008804), Inp32(0x7F008808), Inp32(0x7F00880C));
printf("rGPL: 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008810), Inp32(0x7F008814), Inp32(0x7F008818), Inp32(0x7F00881C));
printf("rGPM: 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008820), Inp32(0x7F008824), Inp32(0x7F008828));
printf("rGPN: 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008830), Inp32(0x7F008834), Inp32(0x7F008838));
printf("rGPO: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008140), Inp32(0x7F008144), Inp32(0x7F008148), Inp32(0x7F00814C),Inp32(0x7F008150));
printf("rGPP: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008160), Inp32(0x7F008164), Inp32(0x7F008168), Inp32(0x7F00816C),Inp32(0x7F008170));
printf("rGPQ: 0x%x, 0x%x, 0x%x, 0x%x, 0x%x\n", Inp32(0x7F008180), Inp32(0x7F008184), Inp32(0x7F008188), Inp32(0x7F00818C),Inp32(0x7F008190));
printf("rSPCON: 0x%x\n", Inp32(0x7F0081A0));
printf("rMEMCONSTOP: 0x%x, 0x%x\n", Inp32(0x7F0081B0), Inp32(0x7F0081B4));
printf("rMEMCONSLP: 0x%x, 0x%x, 0x%x\n", Inp32(0x7F0081C0), Inp32(0x7F0081C4),Inp32(0x7F0081C8));
printf("rMEMDRVCON: 0x%x, 0x%x\n", Inp32(0x7F0081D0), Inp32(0x7F0081D4));
printf("rSPCONSLP, SPLEN: 0x%x, 0x%x\n", Inp32(0x7F008880),Inp32(0x7F008930));
}
//////////
// Function Name : SLEEPT_Basic
// Function Description : Sleep Mode Test - Baisc Test
// Input : None
// Output : None
// Version : v0.1
void SLEEPT_Basic (void)
{
u32 uRstId;
uRstId = SYSC_RdRSTSTAT(1);
if( ( uRstId == 3 ) && !(g_OnTest) )
{
printf("Wake-up form SLEEP Mode \n");
CheckData_SDRAM(_DRAM_BaseAddress+0x1000000, 0x10000);
//Check & Clear Wake-up Source
SYSC_ClrWKUPSTAT();
//Read RawInterrupt Status
printf("VIC0RawStatus: 0x%x \n", Inp32(0x71200008));
printf("VIC1RawStatus: 0x%x \n", Inp32(0x71300008));
printf("SLEEP mode test is done\n");
g_OnTest = 1;
}
else // Entering into SLEEP Mode
{
g_OnTest=0;
printf("[SLEEP Mode Test]\n");
printf("S3C6400 will wake-up by EINT9~11 or Other wake-up sources\n");
printf("Test pattern for SDRAM Self-Refresh is filled!\n");
InitData_SDRAM(_DRAM_BaseAddress+0x1000000, 0x10000);
// ADC & RTC OFF
ADC_SelectStandbyMode(1); //ADC Stand-by
RTC_SetCON(0,0,0,0,0,0); //RTC SFR R/W Disable.
////////////////////////////////
// Save I/O Ports
////////////////////////////////
// Save the port configurations
//printf("I/O Port is stored!\n");
//for(i=0;i<36;i++) {
// portStatus[i]=*( (volatile U32 *)0x56000000 + i); // 0x5600_0000:GPACON addr.
// }
//printf("I/O Port is set for Stop Mode!\n");
//ConfigSleepGPIO();
printf("Wake-up source is set!\n");
////////////////////////////////
// Wake-up Source Setting
// Wake-up Source Interrupts are must enabled at Stop Mode
////////////////////////////////
SetAlarmWakeup();
SetEintWakeup();
Outp32SYSC(0x804, 0x1<<7); // nBATF Wake-up Mask disable
SetBatteryFaultEvent(eFLT_INT);
printf("System stablilization counter register!\n");
////////////////////////////////
// OSCSTABLE = Clock Control
// PWRSTABLE = Reset Control
////////////////////////////////
SYSC_OSCSTAB(0x1);
SYSC_PWRSTAB(0x1);
/////////////////////////////////
// 1) Check&Enable HCLK_GATE[22,21,0]
// 2) Check BLK_PWR_STAT
// 3) Check&Clear WAKEUP_STAT
//////////////////////////////
CheckHCLK_ForPM();
CheckBLKPWR_ForPM();
CheckWAKESTAT_ForPM(1);
printf("\nCPU will goes to SLEEP Mode!\n\n");
UART_TxEmpty(); //
////////////////////////////////
// Enter the Stop Mode
// 1. Setting "CFG_STANDBYWFI" to "2'b11" ( PWR_CFG(0x7E00_F804)
// 2. Setting "SLEEP_CFG"(0x7E00_F818) -> OSC_EN ="0"
// 2. Enter to the STANDBYWFI Command
////////////////////////////////
SYSC_SetCFGWFI(eSLEEP, 0);
MMU_WaitForInterrupt();
printf("CPU doesn't go to Sleep Mode\n");
}
}
//////////
// Function Name : ESLEEPT_Basic
// Function Description : ESleep Mode Test - Baisc Test
// Input : None
// Output : None
// Version : v0.1
void ESLEEPT_Basic (void)
{
u32 uRstId;
u32 uInform0, uInform7;
u32 uINTSEL;
printf("rINFORM0: 0x%x\n", Inp32Inform(0));
printf("rINFORM7: 0x%x\n", Inp32Inform(7));
uInform0 = 0xABCD6400;
uInform7 = 0x6400ABCD;
uRstId = SYSC_RdRSTSTAT(1);
// if( ( uRstId == 4 ) && !(g_OnTest) )
if( ( uRstId == 3 ) && !(g_OnTest) ) // EVT0
{
printf(" ESLEEP Mode \n");
CheckData_SDRAM(_DRAM_BaseAddress+0x1000000, 0x10000);
//Check Information Register Value
if( (uInform0 !=Inp32Inform(0) )||(uInform7 != Inp32Inform(7)))
{
printf(" Information Register Value is wrong!!! \n");
}
else
{
printf(" Information Register Value is correct!!! \n");
}
//Check & Clear Wake-up Source
SYSC_ClrWKUPSTAT();
//Read RawInterrupt Status
printf("VIC0RawStatus: 0x%x \n", Inp32(0x71200008));
printf("VIC1RawStatus: 0x%x \n", Inp32(0x71300008));
printf("SLEEP mode test is done\n");
g_OnTest_ESLP = 1;
}
else // Entering into SLEEP Mode
{
g_OnTest_ESLP=0;
printf("[ESLEEP Mode Test]\n");
printf("Test pattern for SDRAM Self-Refresh is filled!\n");
InitData_SDRAM(_DRAM_BaseAddress+0x1000000, 0x10000);
// ADC & RTC OFF
ADC_SelectStandbyMode(1); //ADC Stand-by
RTC_SetCON(0,0,0,0,0,0); //RTC SFR R/W Disable.
////////////////////////////////
// Save I/O Ports
////////////////////////////////
// Save the port configurations
//printf("I/O Port is stored!\n");
//for(i=0;i<36;i++) {
// portStatus[i]=*( (volatile U32 *)0x56000000 + i); // 0x5600_0000:GPACON addr.
// }
//printf("I/O Port is set for Stop Mode!\n");
//ConfigSleepGPIO();
// Fill Information Register - for test
uInform0 = 0xABCD6400;
uInform7 = 0x6400ABCD;
Outp32Inform(0,uInform0);
Outp32Inform(7,uInform7);
printf("Wake-up source is set!\n");
////////////////////////////////
// Wake-up Source Setting
// Wake-up Source Interrupts are must enabled at Stop Mode
////////////////////////////////
SetAlarmWakeup();
SetEintWakeup();
Outp32SYSC(0x804, 0x1<<7); // nBATF Wake-up Mask disable
SetBatteryFaultEvent(eFLT_INT);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -