lib/sw_services/xilplmi/src/xplmi_err.c
void XPlmi_ErrMgr(int ErrStatus)
{
#ifndef PLM_DEBUG_MODE
	u32 RegVal;
#endif
	u8 SlrType = (u8)(XPlmi_In32(PMC_TAP_SLR_TYPE) &
			PMC_TAP_SLR_TYPE_VAL_MASK);

	/* Print the PLM error */
	XPlmi_Printf(DEBUG_GENERAL, "PLM Error Status: 0x%08lx\n\r", ErrStatus);
	XPlmi_UtilRMW(PMC_GLOBAL_PMC_FW_ERR, PMC_GLOBAL_PMC_FW_ERR_DATA_MASK,
			(u32)ErrStatus);

	/*
	 * Check if SLR Type is Master or Monolithic
	 * and take error action accordingly.
	 */
	if ((SlrType == XPLMI_SSIT_MASTER_SLR) ||
		(SlrType == XPLMI_SSIT_MONOLITIC)) {
		/*
		 * Fallback if boot PDI is not done
		 * else just return, so that we receive next requests
		 */
		if (XPlmi_IsLoadBootPdiDone() == FALSE) {
			XPlmi_DumpRegisters();
			/*
			 * If boot mode is jtag, donot reset. This is to keep
			 * the system state intact for further debug.
			 */
#ifndef PLM_DEBUG_MODE
			if((XPlmi_In32(CRP_BOOT_MODE_USER) &
					CRP_BOOT_MODE_USER_BOOT_MODE_MASK) == 0U)
#endif
			{
				while (TRUE) {
					;
				}
			}

#ifndef PLM_DEBUG_MODE
			/* Update Multiboot register */
			RegVal = XPlmi_In32(PMC_GLOBAL_PMC_MULTI_BOOT);
			XPlmi_Out32(PMC_GLOBAL_PMC_MULTI_BOOT, RegVal + 1U);

			XPlmi_TriggerFwNcrError();
#endif
		}
	} else {
		/*
		 * Trigger SSIT error to Master SLR if SLR Type is Slave SLR
		 * And clear it immediately
		 */
		XPlmi_UtilRMW(PMC_GLOBAL_SSIT_ERR, PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK,
				PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK);
		XPlmi_UtilRMW(PMC_GLOBAL_SSIT_ERR, PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK,
				0x0U);
	}
}
/*****************************************************************************/
/**
 * @brief	This function is called in PLM error cases.
 *
 * @param	ErrStatus is the error code written to the FW_ERR register
 *
 * @return	None
 *
 *****************************************************************************/
@brief       This function is called in PLM error cases.
@param       ErrStatus is the error code written to the FW_ERR register

@return      None
@brief This function is called in PLM error cases . @param ErrStatus is the error code written to the FW_ERR register @return None
void XPlmi_ErrMgr(int ErrStatus)
{
#ifndef PLM_DEBUG_MODE
	u32 RegVal;
#endif
	u8 SlrType = (u8)(XPlmi_In32(PMC_TAP_SLR_TYPE) &
			PMC_TAP_SLR_TYPE_VAL_MASK);
	XPlmi_Printf(DEBUG_GENERAL, "PLM Error Status: 0x%08lx\n\r", ErrStatus);
	XPlmi_UtilRMW(PMC_GLOBAL_PMC_FW_ERR, PMC_GLOBAL_PMC_FW_ERR_DATA_MASK,
			(u32)ErrStatus);
	if ((SlrType == XPLMI_SSIT_MASTER_SLR) ||
		(SlrType == XPLMI_SSIT_MONOLITIC)) {
		if (XPlmi_IsLoadBootPdiDone() == FALSE) {
			XPlmi_DumpRegisters();
#ifndef PLM_DEBUG_MODE
			if((XPlmi_In32(CRP_BOOT_MODE_USER) &
					CRP_BOOT_MODE_USER_BOOT_MODE_MASK) == 0U)
#endif
			{
				while (TRUE) {
					;
				}
			}
#ifndef PLM_DEBUG_MODE
			RegVal = XPlmi_In32(PMC_GLOBAL_PMC_MULTI_BOOT);
			XPlmi_Out32(PMC_GLOBAL_PMC_MULTI_BOOT, RegVal + 1U);
			XPlmi_TriggerFwNcrError();
#endif
		}
	} else {
		XPlmi_UtilRMW(PMC_GLOBAL_SSIT_ERR, PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK,
				PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK);
		XPlmi_UtilRMW(PMC_GLOBAL_SSIT_ERR, PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK,
				0x0U);
	}
}
void XPlmi_ErrMgr ( int ErrStatus ) { #ifndef PLM_DEBUG_MODE u32 RegVal ; #endif u8 SlrType = ( u8 ) ( XPlmi_In32 ( PMC_TAP_SLR_TYPE ) & PMC_TAP_SLR_TYPE_VAL_MASK ) ; XPlmi_Printf ( DEBUG_GENERAL , " \n \r " , ErrStatus ) ; XPlmi_UtilRMW ( PMC_GLOBAL_PMC_FW_ERR , PMC_GLOBAL_PMC_FW_ERR_DATA_MASK , ( u32 ) ErrStatus ) ; if ( ( SlrType == XPLMI_SSIT_MASTER_SLR ) || ( SlrType == XPLMI_SSIT_MONOLITIC ) ) { if ( XPlmi_IsLoadBootPdiDone ( ) == FALSE ) { XPlmi_DumpRegisters ( ) ; #ifndef PLM_DEBUG_MODE if ( ( XPlmi_In32 ( CRP_BOOT_MODE_USER ) & CRP_BOOT_MODE_USER_BOOT_MODE_MASK ) == 0U ) #endif { while ( TRUE ) { ; } } #ifndef PLM_DEBUG_MODE RegVal = XPlmi_In32 ( PMC_GLOBAL_PMC_MULTI_BOOT ) ; XPlmi_Out32 ( PMC_GLOBAL_PMC_MULTI_BOOT , RegVal + 1U ) ; XPlmi_TriggerFwNcrError ( ) ; #endif } } else { XPlmi_UtilRMW ( PMC_GLOBAL_SSIT_ERR , PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK , PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK ) ; XPlmi_UtilRMW ( PMC_GLOBAL_SSIT_ERR , PMC_GLOBAL_SSIT_ERR_IRQ_OUT_2_MASK , 0x0U ) ; } }
@brief       This function is called in PLM error cases.
@brief This function is called in PLM error cases .
/* Print the PLM error */ /*
	 * Check if SLR Type is Master or Monolithic
	 * and take error action accordingly.
	 */ /*
		 * Fallback if boot PDI is not done
		 * else just return, so that we receive next requests
		 */ /*
			 * If boot mode is jtag, donot reset. This is to keep
			 * the system state intact for further debug.
			 */ /* Update Multiboot register */ /*
		 * Trigger SSIT error to Master SLR if SLR Type is Slave SLR
		 * And clear it immediately
		 */