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

	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertVoid(VsmId < XPRC_MAX_NUMBER_OF_VSMS);
	Xil_AssertVoid(ShutdownRequired <= XPRC_RM_CR_SW_HW_SHUTDOWN_REQUIRED);
	Xil_AssertVoid((StartupRequired == XPRC_RM_CR_STARTUP_NOT_REQUIRED) ||
			(StartupRequired == XPRC_RM_CR_SW_STARTUP_REQUIRED));
	Xil_AssertVoid(ResetRequired <= XPRC_RM_CR_HIGH_RESET_REQUIRED);
	Xil_AssertVoid(ResetDuration < XPRC_RM_CR_MAX_RESETDURATION);

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

	Data |= ((ShutdownRequired << XPRC_RM_CR_SHUTDOWN_REQUIRED_SHIFT) &
			XPRC_RM_CR_SHUTDOWN_REQUIRED_MASK);
	Data |= ((StartupRequired << XPRC_RM_CR_STARTUP_REQUIRED_SHIFT) &
			XPRC_RM_CR_STARTUP_REQUIRED_MASK);
	Data |= ((ResetRequired << XPRC_RM_CR_RESET_REQUIRED_SHIFT) &
			XPRC_RM_CR_RESET_REQUIRED_MASK);
	Data |= ((ResetDuration << XPRC_RM_CR_RESET_DURATION_SHIFT) &
			XPRC_RM_CR_RESET_DURATION_MASK);

	xprc_printf(XPRC_DEBUG_GENERAL,"XPrc_SetRmControl :: 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);

	XPrc_WriteReg(Address, Data);
}
/*****************************************************************************/
/**
*
* This function set 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 set the control information for Reconfigurable Module.
This function set the control information for Reconfigurable Module .
void XPrc_SetRmControl(XPrc *InstancePtr, u16 VsmId, u16 RmId,
	u8 ShutdownRequired, u8 StartupRequired, u8 ResetRequired,
	u8 ResetDuration)
{
	u32 Address;
	u32 Data = 0;
	Xil_AssertVoid(InstancePtr != NULL);
	Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
	Xil_AssertVoid(VsmId < XPRC_MAX_NUMBER_OF_VSMS);
	Xil_AssertVoid(ShutdownRequired <= XPRC_RM_CR_SW_HW_SHUTDOWN_REQUIRED);
	Xil_AssertVoid((StartupRequired == XPRC_RM_CR_STARTUP_NOT_REQUIRED) ||
			(StartupRequired == XPRC_RM_CR_SW_STARTUP_REQUIRED));
	Xil_AssertVoid(ResetRequired <= XPRC_RM_CR_HIGH_RESET_REQUIRED);
	Xil_AssertVoid(ResetDuration < XPRC_RM_CR_MAX_RESETDURATION);
	Address = XPrc_GetRegisterAddress(InstancePtr, VsmId,
			XPRC_RM_CONTROL_REG, RmId);
	Data |= ((ShutdownRequired << XPRC_RM_CR_SHUTDOWN_REQUIRED_SHIFT) &
			XPRC_RM_CR_SHUTDOWN_REQUIRED_MASK);
	Data |= ((StartupRequired << XPRC_RM_CR_STARTUP_REQUIRED_SHIFT) &
			XPRC_RM_CR_STARTUP_REQUIRED_MASK);
	Data |= ((ResetRequired << XPRC_RM_CR_RESET_REQUIRED_SHIFT) &
			XPRC_RM_CR_RESET_REQUIRED_MASK);
	Data |= ((ResetDuration << XPRC_RM_CR_RESET_DURATION_SHIFT) &
			XPRC_RM_CR_RESET_DURATION_MASK);
	xprc_printf(XPRC_DEBUG_GENERAL,"XPrc_SetRmControl :: 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);
	XPrc_WriteReg(Address, Data);
}
void XPrc_SetRmControl ( XPrc * InstancePtr , u16 VsmId , u16 RmId , u8 ShutdownRequired , u8 StartupRequired , u8 ResetRequired , u8 ResetDuration ) { u32 Address ; u32 Data = 0 ; Xil_AssertVoid ( InstancePtr != NULL ) ; Xil_AssertVoid ( InstancePtr -> IsReady == XIL_COMPONENT_IS_READY ) ; Xil_AssertVoid ( VsmId < XPRC_MAX_NUMBER_OF_VSMS ) ; Xil_AssertVoid ( ShutdownRequired <= XPRC_RM_CR_SW_HW_SHUTDOWN_REQUIRED ) ; Xil_AssertVoid ( ( StartupRequired == XPRC_RM_CR_STARTUP_NOT_REQUIRED ) || ( StartupRequired == XPRC_RM_CR_SW_STARTUP_REQUIRED ) ) ; Xil_AssertVoid ( ResetRequired <= XPRC_RM_CR_HIGH_RESET_REQUIRED ) ; Xil_AssertVoid ( ResetDuration < XPRC_RM_CR_MAX_RESETDURATION ) ; Address = XPrc_GetRegisterAddress ( InstancePtr , VsmId , XPRC_RM_CONTROL_REG , RmId ) ; Data |= ( ( ShutdownRequired << XPRC_RM_CR_SHUTDOWN_REQUIRED_SHIFT ) & XPRC_RM_CR_SHUTDOWN_REQUIRED_MASK ) ; Data |= ( ( StartupRequired << XPRC_RM_CR_STARTUP_REQUIRED_SHIFT ) & XPRC_RM_CR_STARTUP_REQUIRED_MASK ) ; Data |= ( ( ResetRequired << XPRC_RM_CR_RESET_REQUIRED_SHIFT ) & XPRC_RM_CR_RESET_REQUIRED_MASK ) ; Data |= ( ( ResetDuration << XPRC_RM_CR_RESET_DURATION_SHIFT ) & XPRC_RM_CR_RESET_DURATION_MASK ) ; xprc_printf ( XPRC_DEBUG_GENERAL , " " " " " " " \n \r " , InstancePtr -> Config . DeviceId , VsmId , Address , Data , ResetDuration , ResetRequired , StartupRequired , ShutdownRequired ) ; XPrc_WriteReg ( Address , Data ) ; }
This function set the control information for Reconfigurable Module.
This function set the control information for Reconfigurable Module .