lib/sw_apps/zynqmp_pmufw/src/pm_system.c
s32 PmSystemRequirementAdd(void)
{
	s32 status = XST_FAILURE;
	u32 i;

	for (i = 0U; i < ARRAY_SIZE(pmSystemReqs); i++) {
		PmRequirement* req;

		req = PmRequirementAdd(NULL, pmSystemReqs[i].slave);
		if (NULL == req) {
			status = XST_FAILURE;
			goto done;
		}

		status = PmCheckCapabilities(req->slave, pmSystemReqs[i].caps);
		if (XST_SUCCESS != status) {
			status = XST_FAILURE;
			goto done;
		}
		/**
		 * Do not assign system using slave flag for PL as it required
		 * only during subsystem restart to skip power down during
		 * subsystem restart
		 */
		if ((&pmSlavePl_g != pmSystemReqs[i].slave) ||
		    (0U != pmSystemReqs[i].caps)) {
			req->info |= PM_SYSTEM_USING_SLAVE_MASK;
		}
		req->preReq = (u8)pmSystemReqs[i].caps;
		req->currReq = (u8)pmSystemReqs[i].caps;
		req->nextReq = (u8)pmSystemReqs[i].caps;
		req->defaultReq = (u8)pmSystemReqs[i].caps;
		req->latencyReq = MAX_LATENCY;
	}

#ifdef ENABLE_POS
	/* Add DDR context saving requirements */
	status = PmSystemPosDdrRequirementAdd();
#endif

done:
	return status;
}
/**
 * PmSystemRequirementAdd() - Add requirements of the system
 * @return	XST_SUCCESS if requirements are added, XST_FAILURE otherwise
 */
Add requirements of the system
@return      XST_SUCCESS if requirements are added, XST_FAILURE otherwise
Add requirements of the system @return XST_SUCCESS if requirements are added XST_FAILURE otherwise
s32 PmSystemRequirementAdd(void)
{
	s32 status = XST_FAILURE;
	u32 i;
	for (i = 0U; i < ARRAY_SIZE(pmSystemReqs); i++) {
		PmRequirement* req;
		req = PmRequirementAdd(NULL, pmSystemReqs[i].slave);
		if (NULL == req) {
			status = XST_FAILURE;
			goto done;
		}
		status = PmCheckCapabilities(req->slave, pmSystemReqs[i].caps);
		if (XST_SUCCESS != status) {
			status = XST_FAILURE;
			goto done;
		}
		if ((&pmSlavePl_g != pmSystemReqs[i].slave) ||
		    (0U != pmSystemReqs[i].caps)) {
			req->info |= PM_SYSTEM_USING_SLAVE_MASK;
		}
		req->preReq = (u8)pmSystemReqs[i].caps;
		req->currReq = (u8)pmSystemReqs[i].caps;
		req->nextReq = (u8)pmSystemReqs[i].caps;
		req->defaultReq = (u8)pmSystemReqs[i].caps;
		req->latencyReq = MAX_LATENCY;
	}
#ifdef ENABLE_POS
	status = PmSystemPosDdrRequirementAdd();
#endif
done:
	return status;
}
s32 PmSystemRequirementAdd ( void ) { s32 status = XST_FAILURE ; u32 i ; for ( i = 0U ; i < ARRAY_SIZE ( pmSystemReqs ) ; i ++ ) { PmRequirement * req ; req = PmRequirementAdd ( NULL , pmSystemReqs [ i ] . slave ) ; if ( NULL == req ) { status = XST_FAILURE ; goto done ; } status = PmCheckCapabilities ( req -> slave , pmSystemReqs [ i ] . caps ) ; if ( XST_SUCCESS != status ) { status = XST_FAILURE ; goto done ; } if ( ( & pmSlavePl_g != pmSystemReqs [ i ] . slave ) || ( 0U != pmSystemReqs [ i ] . caps ) ) { req -> info |= PM_SYSTEM_USING_SLAVE_MASK ; } req -> preReq = ( u8 ) pmSystemReqs [ i ] . caps ; req -> currReq = ( u8 ) pmSystemReqs [ i ] . caps ; req -> nextReq = ( u8 ) pmSystemReqs [ i ] . caps ; req -> defaultReq = ( u8 ) pmSystemReqs [ i ] . caps ; req -> latencyReq = MAX_LATENCY ; } #ifdef ENABLE_POS status = PmSystemPosDdrRequirementAdd ( ) ; #endif done : return status ; }
PmSystemRequirementAdd() - Add requirements of the system
 @return      XST_SUCCESS if requirements are added, XST_FAILURE otherwise
PmSystemRequirementAdd () - Add requirements of the system @return XST_SUCCESS if requirements are added XST_FAILURE otherwise
/**
		 * Do not assign system using slave flag for PL as it required
		 * only during subsystem restart to skip power down during
		 * subsystem restart
		 */ /* Add DDR context saving requirements */