void MsSystemReset(void) { if((IsHouseKeepingBootingMode()==FALSE)&&(ENABLE_MODULE_SECURITY_BOOT==1)) { msAPI_PM_MBX_Init(); msAPI_PM_Reset(); } else { MDrv_Sys_WholeChipReset(); } hang(); }
MS_BOOL msAPI_PM_Reset(void) { MBX_Msg MB_Command; printf("\033[0;33m Do mailbox init\033[0m\n"); msAPI_PM_MBX_Init(); memset((void*)&MB_Command, 0, sizeof(MBX_Msg)); MB_Command.eRoleID = E_MBX_ROLE_PM; MB_Command.eMsgType = E_MBX_MSG_TYPE_INSTANT; MB_Command.u8Ctrl = 0; MB_Command.u8MsgClass = E_MBX_CLASS_PM_NOWAIT; MB_Command.u8Index = PM_CMDIDX_GLOBAL_CHIP_RESET; MB_Command.u8ParameterCount = 0; printf("\033[0;33m Send reset message tp PM51.\033[0m\n\n"); MDrv_MBX_SendMsg(&MB_Command); return TRUE; }
void msAPI_Power_PowerDown_EXEC(void) { PM_Result pmResult; static PM_PowerDownCfg PmPowerDownCfg; #if 0//eric.peng MDrv_BDMA_SetSPIOffsetForMCU(); #endif if(msAPI_PM_MBX_Init()==FALSE) { return; } //MDrv_MBX_SetDbgLevel(MBX_DBG_LEVEL_ALL); //MDrv_PM_SetDbgLevel(E_PM_DBGLV_INFO); //To Do: MDrv_PM_Check_Version is used on checking PM version(zeo 2.0 or not?). However, the utopia driver for A5 doesn't update to the newest. // So the current head file doen't include this protoype. if(MDrv_PM_Check_Version(TRUE)) { // Initialize IR before power down msAPI_IR_Initialize(); } // Initialize SAR before power down msAPI_KeyPad_Initialize(); static PM_WakeCfg PmWakeCfg = { .bPmWakeEnableIR = TRUE, .bPmWakeEnableSAR = TRUE, .bPmWakeEnableGPIO0 = FALSE, .bPmWakeEnableGPIO1 = FALSE, .bPmWakeEnableUART1 = FALSE, .bPmWakeEnableSYNC = FALSE, .bPmWakeEnableESYNC = FALSE, .bPmWakeEnableRTC0 = TRUE, .bPmWakeEnableRTC1 = TRUE, .bPmWakeEnableDVI0 = FALSE, .bPmWakeEnableDVI2 = FALSE, .bPmWakeEnableCEC = FALSE, .bPmWakeEnableAVLINK = FALSE, .u8PmStrMode = TRUE, .u8PmWakeIR = { //IR wake-up key define IRKEY_POWER, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, .u8PmWakeIR2 = { //IR wake-up key define IRKEY_POWER, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } };