/** * ImcSleep - IMC Sleep. * * * @param[in] FchDataPtr Fch configuration structure pointer. * */ VOID ImcSleep ( IN VOID *FchDataPtr ) { UINT8 Msgdata; FCH_DATA_BLOCK *LocalCfgPtr; AMD_CONFIG_PARAMS *StdHeader; LocalCfgPtr = (FCH_DATA_BLOCK *) FchDataPtr; StdHeader = LocalCfgPtr->StdHeader; if (!(IsImcEnabled (StdHeader)) ) { return; ///IMC is not enabled } Msgdata = 0x00; WriteECmsg (MSG_REG0, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0xB4; WriteECmsg (MSG_REG1, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0x00; WriteECmsg (MSG_REG2, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0x96; WriteECmsg (MSG_SYS_TO_IMC, AccessWidth8, &Msgdata, StdHeader); WaitForEcLDN9MailboxCmdAck (StdHeader); }
/** * ImcDisableSurebootTimer - IMC Disable Sureboot Timer. * * * @param[in] FchDataPtr Fch configuration structure pointer. * */ VOID ImcDisableSurebootTimer ( IN VOID *FchDataPtr ) { UINT8 Msgdata; AMD_CONFIG_PARAMS *StdHeader; StdHeader = ((FCH_DATA_BLOCK *) FchDataPtr)->StdHeader; if (!(IsImcEnabled (StdHeader)) ) { return; ///IMC is not enabled } ImcWakeup (FchDataPtr); Msgdata = 0x00; WriteECmsg (MSG_REG0, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0x01; WriteECmsg (MSG_REG1, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0x00; WriteECmsg (MSG_REG2, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0x94; WriteECmsg (MSG_SYS_TO_IMC, AccessWidth8, &Msgdata, StdHeader); WaitForEcLDN9MailboxCmdAck (StdHeader); ImcSleep (FchDataPtr); }
/** * ImcCrashReset - IMC Crash Reset * * * @param[in] FchDataPtr Fch configuration structure pointer. * */ VOID ImcCrashReset ( IN VOID *FchDataPtr ) { UINT8 Msgdata; FCH_DATA_BLOCK *LocalCfgPtr; AMD_CONFIG_PARAMS *StdHeader; LocalCfgPtr = (FCH_DATA_BLOCK *) FchDataPtr; StdHeader = LocalCfgPtr->StdHeader; if (!(IsImcEnabled (StdHeader)) ) { return; ///IMC is not enabled } ReadECmsg (MSG_REG0, AccessWidth8, &Msgdata, StdHeader); if ( Msgdata != 0xfa) { ReadECmsg (MSG_REGA, AccessWidth8, &Msgdata, StdHeader); if ( Msgdata != 0x5A ) { ReadECmsg (MSG_REGB, AccessWidth8, &Msgdata, StdHeader); if ( Msgdata != 0xA5 ) { // Set up MSG_REGA = 0x5A and MSG_REGB = 0xA5 as a flag to indicate IMC has been // reset once already, this is to prevent repeating the reset forever. Msgdata = 0x5A; WriteECmsg (MSG_REGA, AccessWidth8, &Msgdata, StdHeader); Msgdata = 0xA5; WriteECmsg (MSG_REGB, AccessWidth8, &Msgdata, StdHeader); SoftwareDisableImc (LocalCfgPtr); } } } }