XilinxProcessorIPLib/drivers/resetps/src/xresetps.c
XStatus XResetPs_ResetAssert(XResetPs *InstancePtr,
						   const XResetPs_RstId ResetID)
{
	/* Arguments validation */
	Xil_AssertNonvoid(InstancePtr != NULL);
	if (!((ResetID <= XRESETPS_RSTID_END) &&
		 ((ResetID > XRESETPS_RSTID_START)||
		  (ResetID == XRESETPS_RSTID_START)))) {
		return XST_INVALID_PARAM;
	}

#if EL1_NONSECURE
	/* Assert reset via PMUFW */
	u64 SmcArgs;
	XSmc_OutVar out;

	SmcArgs =  (u64)XRESETPS_RSTACT_ASSERT << 32;
	SmcArgs |= ((u64)(ResetID + XRESETPS_RSTID_BASE));

	out = Xil_Smc(PM_ASSERT_SMC_FID, SmcArgs, 0, 0, 0, 0, 0, 0);

	return ((u32)out.Arg0);
#else
	u32 RegAddr;
	u32 RegBitmask;
	u32 RegValue;

	/* Ignoring Nodes that doesnot support assert */
	if (!XRESETPS_CHK_ASSERT_SUPPORT(ResetMap[ResetID].SupportedActions)) {
			return XST_NO_FEATURE;
	}

	RegAddr = ResetMap[ResetID].SlcrregAddr;
	RegBitmask = ResetMap[ResetID].SlcrregBitmask;

	/* Enable bit to assert reset */
	RegValue = XResetPs_ReadReg(RegAddr);
	RegValue |= RegBitmask;
	XResetPs_WriteReg(RegAddr, RegValue);

	return XST_SUCCESS;
#endif
}
/****************************************************************************/
/**
*
* Assert reset for specific peripheral based on reset ID.
*
* @param	InstancePtr is a pointer to the XResetPs instance.
* @param	ResetID is the ID of the peripheral.
*
* @return
*		- XST_SUCCESS if reset assertion was successful.
*		- Error Code otherwise.
*
* @note		None.
*
******************************************************************************/
Assert reset for specific peripheral based on reset ID.
Assert reset for specific peripheral based on reset ID .
XStatus XResetPs_ResetAssert(XResetPs *InstancePtr,
						   const XResetPs_RstId ResetID)
{
	Xil_AssertNonvoid(InstancePtr != NULL);
	if (!((ResetID <= XRESETPS_RSTID_END) &&
		 ((ResetID > XRESETPS_RSTID_START)||
		  (ResetID == XRESETPS_RSTID_START)))) {
		return XST_INVALID_PARAM;
	}
#if EL1_NONSECURE
	u64 SmcArgs;
	XSmc_OutVar out;
	SmcArgs =  (u64)XRESETPS_RSTACT_ASSERT << 32;
	SmcArgs |= ((u64)(ResetID + XRESETPS_RSTID_BASE));
	out = Xil_Smc(PM_ASSERT_SMC_FID, SmcArgs, 0, 0, 0, 0, 0, 0);
	return ((u32)out.Arg0);
#else
	u32 RegAddr;
	u32 RegBitmask;
	u32 RegValue;
	if (!XRESETPS_CHK_ASSERT_SUPPORT(ResetMap[ResetID].SupportedActions)) {
			return XST_NO_FEATURE;
	}
	RegAddr = ResetMap[ResetID].SlcrregAddr;
	RegBitmask = ResetMap[ResetID].SlcrregBitmask;
	RegValue = XResetPs_ReadReg(RegAddr);
	RegValue |= RegBitmask;
	XResetPs_WriteReg(RegAddr, RegValue);
	return XST_SUCCESS;
#endif
}
XStatus XResetPs_ResetAssert ( XResetPs * InstancePtr , const XResetPs_RstId ResetID ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; if ( ! ( ( ResetID <= XRESETPS_RSTID_END ) && ( ( ResetID > XRESETPS_RSTID_START ) || ( ResetID == XRESETPS_RSTID_START ) ) ) ) { return XST_INVALID_PARAM ; } #if EL1_NONSECURE u64 SmcArgs ; XSmc_OutVar out ; SmcArgs = ( u64 ) XRESETPS_RSTACT_ASSERT << 32 ; SmcArgs |= ( ( u64 ) ( ResetID + XRESETPS_RSTID_BASE ) ) ; out = Xil_Smc ( PM_ASSERT_SMC_FID , SmcArgs , 0 , 0 , 0 , 0 , 0 , 0 ) ; return ( ( u32 ) out . Arg0 ) ; #else u32 RegAddr ; u32 RegBitmask ; u32 RegValue ; if ( ! XRESETPS_CHK_ASSERT_SUPPORT ( ResetMap [ ResetID ] . SupportedActions ) ) { return XST_NO_FEATURE ; } RegAddr = ResetMap [ ResetID ] . SlcrregAddr ; RegBitmask = ResetMap [ ResetID ] . SlcrregBitmask ; RegValue = XResetPs_ReadReg ( RegAddr ) ; RegValue |= RegBitmask ; XResetPs_WriteReg ( RegAddr , RegValue ) ; return XST_SUCCESS ; #endif }
Assert reset for specific peripheral based on reset ID.
Assert reset for specific peripheral based on reset ID .
/* Arguments validation */ /* Assert reset via PMUFW */ /* Ignoring Nodes that doesnot support assert */ /* Enable bit to assert reset */