lib/sw_apps/versal_psmfw/src/xpsmfw_dvsec.c
static XStatus XPsmFw_CpmInit(u32 CpmPowerId, u32 CpmSlcrAddr)
{
	XStatus Status = XST_FAILURE;

	(void)memset(&CpmParam, 0, sizeof(CpmParam));
	CpmParam.CpmPowerId = CpmPowerId;
	CpmParam.CpmSlcr = CpmSlcrAddr;

	switch(CpmParam.CpmPowerId) {
	case XPSMFW_POWER_CPM5:
		CpmParam.PcieaDvsec0 = CpmParam.CpmSlcr + CPM5_PCIEA_DVSEC0_SLCR_OFF;
		CpmParam.PcieaAttrib0 = CpmParam.CpmSlcr + CPM5_PCIEA_ATTRIB0_SLCR_OFF;
		CpmParam.PcieCsr0 = CpmParam.CpmSlcr + CPM5_PCIEA_CSR0_SLCR_OFF;
		Status = XST_SUCCESS;
		break;
	case XPSMFW_POWER_CPM:
		CpmParam.PcieaDvsec0 = CpmParam.CpmSlcr + PCIEA_DVSEC0_SLCR_OFF;
		CpmParam.PcieaAttrib0 = CpmParam.CpmSlcr + PCIEA_ATTRIB0_SLCR_OFF;
		Status = XST_SUCCESS;
		break;
	default:
		Status = XST_INVALID_PARAM;
		break;
	}

	return Status;
}
/****************************************************************************/
/**
 * @brief	Initialize CPM PowerId and Base address params
 *
 * @param	CpmPowerId	The PowerId of CPM domain
 * @param	CpmSlcrAddr	BaseAddress of CPM_SLCR module
 *
 * @return	XST_SUCCESS or error code
 *
 * @note	None
 *
 ****************************************************************************/
@brief       Initialize CPM PowerId and Base address params
@param       CpmPowerId      The PowerId of CPM domain
@param       CpmSlcrAddr     BaseAddress of CPM_SLCR module

@return      XST_SUCCESS or error code

@note        None
@brief Initialize CPM PowerId and Base address params @param CpmPowerId The PowerId of CPM domain @param CpmSlcrAddr BaseAddress of CPM_SLCR module @return XST_SUCCESS or error code @note None
static XStatus XPsmFw_CpmInit(u32 CpmPowerId, u32 CpmSlcrAddr)
{
	XStatus Status = XST_FAILURE;
	(void)memset(&CpmParam, 0, sizeof(CpmParam));
	CpmParam.CpmPowerId = CpmPowerId;
	CpmParam.CpmSlcr = CpmSlcrAddr;
	switch(CpmParam.CpmPowerId) {
	case XPSMFW_POWER_CPM5:
		CpmParam.PcieaDvsec0 = CpmParam.CpmSlcr + CPM5_PCIEA_DVSEC0_SLCR_OFF;
		CpmParam.PcieaAttrib0 = CpmParam.CpmSlcr + CPM5_PCIEA_ATTRIB0_SLCR_OFF;
		CpmParam.PcieCsr0 = CpmParam.CpmSlcr + CPM5_PCIEA_CSR0_SLCR_OFF;
		Status = XST_SUCCESS;
		break;
	case XPSMFW_POWER_CPM:
		CpmParam.PcieaDvsec0 = CpmParam.CpmSlcr + PCIEA_DVSEC0_SLCR_OFF;
		CpmParam.PcieaAttrib0 = CpmParam.CpmSlcr + PCIEA_ATTRIB0_SLCR_OFF;
		Status = XST_SUCCESS;
		break;
	default:
		Status = XST_INVALID_PARAM;
		break;
	}
	return Status;
}
static XStatus XPsmFw_CpmInit ( u32 CpmPowerId , u32 CpmSlcrAddr ) { XStatus Status = XST_FAILURE ; ( void ) memset ( & CpmParam , 0 , sizeof ( CpmParam ) ) ; CpmParam . CpmPowerId = CpmPowerId ; CpmParam . CpmSlcr = CpmSlcrAddr ; switch ( CpmParam . CpmPowerId ) { case XPSMFW_POWER_CPM5 : CpmParam . PcieaDvsec0 = CpmParam . CpmSlcr + CPM5_PCIEA_DVSEC0_SLCR_OFF ; CpmParam . PcieaAttrib0 = CpmParam . CpmSlcr + CPM5_PCIEA_ATTRIB0_SLCR_OFF ; CpmParam . PcieCsr0 = CpmParam . CpmSlcr + CPM5_PCIEA_CSR0_SLCR_OFF ; Status = XST_SUCCESS ; break ; case XPSMFW_POWER_CPM : CpmParam . PcieaDvsec0 = CpmParam . CpmSlcr + PCIEA_DVSEC0_SLCR_OFF ; CpmParam . PcieaAttrib0 = CpmParam . CpmSlcr + PCIEA_ATTRIB0_SLCR_OFF ; Status = XST_SUCCESS ; break ; default : Status = XST_INVALID_PARAM ; break ; } return Status ; }
@brief       Initialize CPM PowerId and Base address params
 @param       CpmPowerId      The PowerId of CPM domain
 @param       CpmSlcrAddr     BaseAddress of CPM_SLCR module
@brief Initialize CPM PowerId and Base address params @param CpmPowerId The PowerId of CPM domain @param CpmSlcrAddr BaseAddress of CPM_SLCR module