XilinxProcessorIPLib/drivers/prc/src/xprc.c
void XPrc_GetRmControl(XPrc *InstancePtr, u16 VsmId, u16 RmId,
			u8 *ShutdownRequired, u8 *StartupRequired,
			u8 *ResetRequired, u8 *ResetDuration)
{
	u32 Address;
	u32 Data;

	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertVoid(VsmId < XPRC_MAX_NUMBER_OF_VSMS);

	Address = XPrc_GetRegisterAddress(InstancePtr, VsmId,
			XPRC_RM_CONTROL_REG, RmId);

	Data = XPrc_ReadReg(Address);

	if (ShutdownRequired != NULL) {
		*ShutdownRequired = (Data & XPRC_RM_CR_SHUTDOWN_REQUIRED_MASK)
				>> XPRC_RM_CR_SHUTDOWN_REQUIRED_SHIFT;
	}

	if (StartupRequired != NULL) {
		*StartupRequired = (Data & XPRC_RM_CR_STARTUP_REQUIRED_MASK)
				>> XPRC_RM_CR_STARTUP_REQUIRED_SHIFT;
	}

	if (ResetRequired != NULL) {
		*ResetRequired = (Data & XPRC_RM_CR_RESET_REQUIRED_MASK) >>
				XPRC_RM_CR_RESET_REQUIRED_SHIFT;
	}

	if (ResetDuration != NULL) {
		*ResetDuration = (Data & XPRC_RM_CR_RESET_DURATION_MASK) >>
				XPRC_RM_CR_RESET_DURATION_SHIFT;
	}

	xprc_printf(XPRC_DEBUG_GENERAL,"XPrc_GetRmControl :: Instance %d,"
		"VSMID = %x, Address = %x, Data = %x (| Reset Duration %0d |"
		"Reset Required %0d | Startup Required = %0d | Shutdown"
		"Required = %0d |)\n\r", InstancePtr->Config.DeviceId,
		VsmId, Address, Data, *ResetDuration, *ResetRequired,
		*StartupRequired, *ShutdownRequired);

}
/*****************************************************************************/
/**
*
* This function get the control information for Reconfigurable Module.
*
* @param	InstancePtr is a pointer to the PRC instance.
* @param	VsmId is the identifier of the VSM to access.
* @param	RmId is the identifier of the Reconfigurable Module.
* @param	ShutdownRequired value for the Reconfigurable Module.
*		- XPRC_RM_CR_NO_SHUTDOWN_REQUIRED(00): No Reconfigurable Module
*		  shutdown is required.
*		- XPRC_RM_CR_HW_SHUTDOWN_REQUIRED(01) : Hardware Reconfigurable
*		  Module shutdown is required.
*		- XPRC_RM_CR_HW_SW_SHUTDOWN_REQUIRED(10) : Hardware then
*		  software shutdown is required.
*		- XPRC_RM_CR_SW_HW_SHUTDOWN_REQUIRED(11) : Software then
*		  hardware shutdown is required.
* @param	StartupRequired value for the Reconfigurable Module.
*		- XPRC_RM_CR_STARTUP_NOT_REQUIRED (0) : No start-up is required
*		- XPRC_RM_CR_SW_STARTUP_REQUIRED (1) : Software start-up is
*		  required.
* @param	ResetRequired value for the Reconfigurable Module.
*		- XPRC_RM_CR_NO_RESET_REQUIRED(00): No Reconfigurable Module
*		  Reset is required.
*		- 01: RESERVED.
*		- XPRC_RM_CR_LOW_RESET_REQUIRED(10) : Active-Low Reconfigurable
*		  Module reset is required.
*		- XPRC_RM_CR_HIGH_RESET_REQUIRED(11) : Active-High
*		  Reconfigurable Module reset is required.
* @param	ResetDuration value for the Reconfigurable Module.
*		The maximum reset duration is 256 clock cycles.
*
* @return	None.
*
* @note		None.
*
******************************************************************************/
This function get the control information for Reconfigurable Module.
This function get the control information for Reconfigurable Module .
void XPrc_GetRmControl(XPrc *InstancePtr, u16 VsmId, u16 RmId,
			u8 *ShutdownRequired, u8 *StartupRequired,
			u8 *ResetRequired, u8 *ResetDuration)
{
	u32 Address;
	u32 Data;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertVoid(VsmId < XPRC_MAX_NUMBER_OF_VSMS);
	Address = XPrc_GetRegisterAddress(InstancePtr, VsmId,
			XPRC_RM_CONTROL_REG, RmId);
	Data = XPrc_ReadReg(Address);
	if (ShutdownRequired != NULL) {
		*ShutdownRequired = (Data & XPRC_RM_CR_SHUTDOWN_REQUIRED_MASK)
				>> XPRC_RM_CR_SHUTDOWN_REQUIRED_SHIFT;
	}
	if (StartupRequired != NULL) {
		*StartupRequired = (Data & XPRC_RM_CR_STARTUP_REQUIRED_MASK)
				>> XPRC_RM_CR_STARTUP_REQUIRED_SHIFT;
	}
	if (ResetRequired != NULL) {
		*ResetRequired = (Data & XPRC_RM_CR_RESET_REQUIRED_MASK) >>
				XPRC_RM_CR_RESET_REQUIRED_SHIFT;
	}
	if (ResetDuration != NULL) {
		*ResetDuration = (Data & XPRC_RM_CR_RESET_DURATION_MASK) >>
				XPRC_RM_CR_RESET_DURATION_SHIFT;
	}
	xprc_printf(XPRC_DEBUG_GENERAL,"XPrc_GetRmControl :: Instance %d,"
		"VSMID = %x, Address = %x, Data = %x (| Reset Duration %0d |"
		"Reset Required %0d | Startup Required = %0d | Shutdown"
		"Required = %0d |)\n\r", InstancePtr->Config.DeviceId,
		VsmId, Address, Data, *ResetDuration, *ResetRequired,
		*StartupRequired, *ShutdownRequired);
}
void XPrc_GetRmControl ( XPrc * InstancePtr , u16 VsmId , u16 RmId , u8 * ShutdownRequired , u8 * StartupRequired , u8 * ResetRequired , u8 * ResetDuration ) { u32 Address ; u32 Data ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertVoid ( VsmId < XPRC_MAX_NUMBER_OF_VSMS ) ; Address = XPrc_GetRegisterAddress ( InstancePtr , VsmId , XPRC_RM_CONTROL_REG , RmId ) ; Data = XPrc_ReadReg ( Address ) ; if ( ShutdownRequired != NULL ) { * ShutdownRequired = ( Data & XPRC_RM_CR_SHUTDOWN_REQUIRED_MASK ) >> XPRC_RM_CR_SHUTDOWN_REQUIRED_SHIFT ; } if ( StartupRequired != NULL ) { * StartupRequired = ( Data & XPRC_RM_CR_STARTUP_REQUIRED_MASK ) >> XPRC_RM_CR_STARTUP_REQUIRED_SHIFT ; } if ( ResetRequired != NULL ) { * ResetRequired = ( Data & XPRC_RM_CR_RESET_REQUIRED_MASK ) >> XPRC_RM_CR_RESET_REQUIRED_SHIFT ; } if ( ResetDuration != NULL ) { * ResetDuration = ( Data & XPRC_RM_CR_RESET_DURATION_MASK ) >> XPRC_RM_CR_RESET_DURATION_SHIFT ; } xprc_printf ( XPRC_DEBUG_GENERAL , " " " " " " " \n \r " , InstancePtr -> Config . DeviceId , VsmId , Address , Data , * ResetDuration , * ResetRequired , * StartupRequired , * ShutdownRequired ) ; }
This function get the control information for Reconfigurable Module.
This function get the control information for Reconfigurable Module .