/*--------------------------------------------------------------------------*/
/* Common LMM handler */
/*--------------------------------------------------------------------------*/
void LMM_Handler(void)
{
int32_t status = SM_ERR_SUCCESS;
/* Not required to boot? */
if (s_bootSkip != 0U)
{
/* Check if possible to boot? */
status = LMM_SystemLmCheck(s_bootLm);
}
/* Okay to try to start? */
if (status == SM_ERR_SUCCESS)
{
lmm_rst_rec_t bootRec, shutdownRec;
/* Get system reason info */
LM_SystemReason(0U, &bootRec, &shutdownRec);
/* Boot LM and store status */
s_bootStatus = LMM_SystemLmBoot(0U, 0U, s_bootLm, &bootRec);
/* Store boot time */
s_lmStartTime[s_bootLm] = DEV_SM_Usec64Get();
}
else
{
/* Report no error */
s_bootStatus = SM_ERR_SUCCESS;
}
}
/*--------------------------------------------------------------------------*/
/* Get LM boot time */
/*--------------------------------------------------------------------------*/
uint64_t LMM_BootTimeGet(uint32_t lmId)
{
SM_TEST_MODE_EXEC(SM_TEST_MODE_LMM_ALT1, s_lmStartTime[lmId] = 0ULL)
return s_lmStartTime[lmId];
}
/*--------------------------------------------------------------------------*/
/* Get cfg info */
/*--------------------------------------------------------------------------*/
string LMM_CfgInfoGet(uint32_t *mSel)
{
static string cfgName = SM_LM_CFG_NAME;
/* Return mSel value */
*mSel = s_mSel;
/* Return cfg file name */
return cfgName;
}