XilinxProcessorIPLib/drivers/prc/src/xprc.c
void XPrc_PrintVsmStatus(XPrc *InstancePtr, u32 VsmIdOrStatus, char * Prefix)
{
	u32 Status = VsmIdOrStatus;
	u8 Is_shutdown;
	u8 State;
	u8 Error;

	if (InstancePtr != NULL) {
		Status = XPrc_ReadStatusReg(InstancePtr, VsmIdOrStatus);
	}

	Is_shutdown = XPrc_IsVsmInShutdown(NULL, Status);
	State = XPrc_GetVsmState(NULL, Status);
	Error = XPrc_GetVsmErrorStatus(NULL, Status);

	if (Is_shutdown != 0) {
		/* The STATE field doesn't represent the state. Instead, bit 0
		 * contains the value of RM_SHUTDOWN_ACK. That means we don't
		 * tell RM_ID or BS_ID either because they are only valid if
		 * the VSM isn'tempty, and we can't tell that in the shutdown
		 * mode.
		 */

		/* Shutdown mode */
		xprc_core_printf(XPRC_DEBUG_GENERAL,"%sMode : SHUTDOWN\n\r",
				Prefix);
		xprc_core_printf(XPRC_DEBUG_GENERAL,"%sRM_SHUTDOWN_ACK : %x\n\r",
				Prefix, State);
	}
	else {
		/* Active Mode */
		xprc_printf(XPRC_DEBUG_GENERAL,"%sMode : ACTIVE\n\r", Prefix);
		switch (State) {
			case XPRC_SR_STATE_EMPTY:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE :"
					"EMPTY (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_HW_SHUTDOWN:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : HW"
					"SHUTDOWN (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_SW_SHUTDOWN:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : SW"
					"SHUTDOWN (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_RM_UNLOAD:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : RM"
					"UNLOAD (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_RM_LOAD:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : RM"
					"LOAD (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_SW_STARTUP:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : SW"
					"STARTUP (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_RM_RESET:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : RM"
					"RESET (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_FULL:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : FULL"
					"(%x)\n\r", Prefix, State);
				break;
			default:
				break;
		}
		if (State != XPRC_SR_STATE_EMPTY) {
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sRM_ID : %d\n\r",
				Prefix, XPrc_GetRmIdFromStatus(NULL, Status));
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sBS_ID : %d\n\r",
				Prefix, XPrc_GetBsIdFromStatus(NULL, Status));
		}
	}
	switch (Error) {
		case XPRC_SR_BS_COMPATIBLE_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : BS"
				"COMPATIBLE ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_DECOMPRESS_BAD_FORMAT_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : DECOMPRESS"
				"BAD FORMAT ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_DECOMPRESS_BAD_SIZE_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : DECOMPRESS"
				"BAD SIZE ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_FETCH_AND_CP_LOST_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : FETCH AND"
				"CP LOST_ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_FETCH_AND_BS_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : FETCH AND BS"
				"ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_FETCH_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : FETCH ERROR"
				"(%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_CP_LOST_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : CP LOST"
				"ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_BS_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : BS ERROR"
				"(%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_BAD_CONFIG_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : BAD CONFIG"
				"ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_NO_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : NO ERROR"
				"(%x)\n\r", Prefix, Error);
			break;
		default:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : UNKNOWN"
				"(%x)\n\r", Prefix, Error);
			break;
	}
}
/*****************************************************************************/
/**
*
* This function is used to Print the VSM Status.
*
* @param	InstancePtr is a pointer to the PRC instance.
* @param	VsmIdOrStatus is an identifier of the VSM to access or
* 		a pre-read status word.
* @param	Prefix is a text string that will prefix each line of output.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function is used to Print the VSM Status.
This function is used to Print the VSM Status .
void XPrc_PrintVsmStatus(XPrc *InstancePtr, u32 VsmIdOrStatus, char * Prefix)
{
	u32 Status = VsmIdOrStatus;
	u8 Is_shutdown;
	u8 State;
	u8 Error;
	if (InstancePtr != NULL) {
		Status = XPrc_ReadStatusReg(InstancePtr, VsmIdOrStatus);
	}
	Is_shutdown = XPrc_IsVsmInShutdown(NULL, Status);
	State = XPrc_GetVsmState(NULL, Status);
	Error = XPrc_GetVsmErrorStatus(NULL, Status);
	if (Is_shutdown != 0) {
		xprc_core_printf(XPRC_DEBUG_GENERAL,"%sMode : SHUTDOWN\n\r",
				Prefix);
		xprc_core_printf(XPRC_DEBUG_GENERAL,"%sRM_SHUTDOWN_ACK : %x\n\r",
				Prefix, State);
	}
	else {
		xprc_printf(XPRC_DEBUG_GENERAL,"%sMode : ACTIVE\n\r", Prefix);
		switch (State) {
			case XPRC_SR_STATE_EMPTY:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE :"
					"EMPTY (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_HW_SHUTDOWN:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : HW"
					"SHUTDOWN (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_SW_SHUTDOWN:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : SW"
					"SHUTDOWN (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_RM_UNLOAD:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : RM"
					"UNLOAD (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_RM_LOAD:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : RM"
					"LOAD (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_SW_STARTUP:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : SW"
					"STARTUP (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_RM_RESET:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : RM"
					"RESET (%x)\n\r", Prefix, State);
				break;
			case XPRC_SR_STATE_FULL:
				xprc_core_printf(XPRC_DEBUG_GENERAL,"%sSTATE : FULL"
					"(%x)\n\r", Prefix, State);
				break;
			default:
				break;
		}
		if (State != XPRC_SR_STATE_EMPTY) {
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sRM_ID : %d\n\r",
				Prefix, XPrc_GetRmIdFromStatus(NULL, Status));
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sBS_ID : %d\n\r",
				Prefix, XPrc_GetBsIdFromStatus(NULL, Status));
		}
	}
	switch (Error) {
		case XPRC_SR_BS_COMPATIBLE_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : BS"
				"COMPATIBLE ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_DECOMPRESS_BAD_FORMAT_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : DECOMPRESS"
				"BAD FORMAT ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_DECOMPRESS_BAD_SIZE_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : DECOMPRESS"
				"BAD SIZE ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_FETCH_AND_CP_LOST_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : FETCH AND"
				"CP LOST_ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_FETCH_AND_BS_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : FETCH AND BS"
				"ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_FETCH_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : FETCH ERROR"
				"(%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_CP_LOST_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : CP LOST"
				"ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_BS_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : BS ERROR"
				"(%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_BAD_CONFIG_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : BAD CONFIG"
				"ERROR (%x)\n\r", Prefix, Error);
			break;
		case XPRC_SR_NO_ERROR:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : NO ERROR"
				"(%x)\n\r", Prefix, Error);
			break;
		default:
			xprc_core_printf(XPRC_DEBUG_GENERAL,"%sERROR : UNKNOWN"
				"(%x)\n\r", Prefix, Error);
			break;
	}
}
void XPrc_PrintVsmStatus ( XPrc * InstancePtr , u32 VsmIdOrStatus , char * Prefix ) { u32 Status = VsmIdOrStatus ; u8 Is_shutdown ; u8 State ; u8 Error ; if ( InstancePtr != NULL ) { Status = XPrc_ReadStatusReg ( InstancePtr , VsmIdOrStatus ) ; } Is_shutdown = XPrc_IsVsmInShutdown ( NULL , Status ) ; State = XPrc_GetVsmState ( NULL , Status ) ; Error = XPrc_GetVsmErrorStatus ( NULL , Status ) ; if ( Is_shutdown != 0 ) { xprc_core_printf ( XPRC_DEBUG_GENERAL , " \n \r " , Prefix ) ; xprc_core_printf ( XPRC_DEBUG_GENERAL , " \n \r " , Prefix , State ) ; } else { xprc_printf ( XPRC_DEBUG_GENERAL , " \n \r " , Prefix ) ; switch ( State ) { case XPRC_SR_STATE_EMPTY : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_HW_SHUTDOWN : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_SW_SHUTDOWN : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_RM_UNLOAD : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_RM_LOAD : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_SW_STARTUP : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_RM_RESET : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; case XPRC_SR_STATE_FULL : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , State ) ; break ; default : break ; } if ( State != XPRC_SR_STATE_EMPTY ) { xprc_core_printf ( XPRC_DEBUG_GENERAL , " \n \r " , Prefix , XPrc_GetRmIdFromStatus ( NULL , Status ) ) ; xprc_core_printf ( XPRC_DEBUG_GENERAL , " \n \r " , Prefix , XPrc_GetBsIdFromStatus ( NULL , Status ) ) ; } } switch ( Error ) { case XPRC_SR_BS_COMPATIBLE_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_DECOMPRESS_BAD_FORMAT_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_DECOMPRESS_BAD_SIZE_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_FETCH_AND_CP_LOST_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_FETCH_AND_BS_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_FETCH_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_CP_LOST_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_BS_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_BAD_CONFIG_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; case XPRC_SR_NO_ERROR : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; default : xprc_core_printf ( XPRC_DEBUG_GENERAL , " " " \n \r " , Prefix , Error ) ; break ; } }
This function is used to Print the VSM Status.
This function is used to Print the VSM Status .
/* The STATE field doesn't represent the state. Instead, bit 0
		 * contains the value of RM_SHUTDOWN_ACK. That means we don't
		 * tell RM_ID or BS_ID either because they are only valid if
		 * the VSM isn'tempty, and we can't tell that in the shutdown
		 * mode.
		 */ /* Shutdown mode */ /* Active Mode */