lib/sw_apps/zynqmp_pmufw/src/pm_system.c
s32 PmSystemFinalizePowerOffSuspend(void)
{
	u32 i;
	s32 status;
	PmRequirement* req;

	/* Save system context */
	PmSystemSaveContext();

	/* Release all requirements for all masters in system */
	status = PmMasterReleaseAll();
	if (XST_SUCCESS != status) {
		goto done;
	}

	/* Prepare system requirements for entering Power Off Suspend */
	for (i = 0U; i < ARRAY_SIZE(pmSystemReqs); i++) {
		u32 caps = 0U;

		/* Put DDR in retention state during Power Off Suspend */
		if (pmSystemReqs[i].slave == &pmSlaveDdr_g) {
			caps |= PM_CAP_CONTEXT;
			/* Save DDR clocks settings */
			PmClockSave(&pmSlaveDdr_g.node);
		}

		req = PmRequirementGetNoMaster(pmSystemReqs[i].slave);
		if (NULL != req) {
			if (caps != req->currReq) {
				status = PmRequirementUpdate(req, caps);
				if (XST_SUCCESS != status) {
					goto done;
				}
			}
		} else {
			status = XST_FAILURE;
			goto done;
		}
	}

	/* Save DDR context */
	status = PmHookPosSaveDdrContext();
	if (XST_SUCCESS != status) {
		goto done;
	}

	/* Release DDR context saving slave capabilities */
	status = PmSystemPosFinalizeDdrCaps();

done:
	return status;
}
/**
 * PmSystemFinalizePowerOffSuspend() - Finalize entering Power Off Suspend state
 *
 * @return	This function will not return in case of entering Power Off
 * 		Suspend, failure code otherwise
 */
Finalize entering Power Off Suspend state
@return      This function will not return in case of entering Power Off
Suspend, failure code otherwise
Finalize entering Power Off Suspend state @return This function will not return in case of entering Power Off Suspend failure code otherwise
s32 PmSystemFinalizePowerOffSuspend(void)
{
	u32 i;
	s32 status;
	PmRequirement* req;
	PmSystemSaveContext();
	status = PmMasterReleaseAll();
	if (XST_SUCCESS != status) {
		goto done;
	}
	for (i = 0U; i < ARRAY_SIZE(pmSystemReqs); i++) {
		u32 caps = 0U;
		if (pmSystemReqs[i].slave == &pmSlaveDdr_g) {
			caps |= PM_CAP_CONTEXT;
			PmClockSave(&pmSlaveDdr_g.node);
		}
		req = PmRequirementGetNoMaster(pmSystemReqs[i].slave);
		if (NULL != req) {
			if (caps != req->currReq) {
				status = PmRequirementUpdate(req, caps);
				if (XST_SUCCESS != status) {
					goto done;
				}
			}
		} else {
			status = XST_FAILURE;
			goto done;
		}
	}
	status = PmHookPosSaveDdrContext();
	if (XST_SUCCESS != status) {
		goto done;
	}
	status = PmSystemPosFinalizeDdrCaps();
done:
	return status;
}
s32 PmSystemFinalizePowerOffSuspend ( void ) { u32 i ; s32 status ; PmRequirement * req ; PmSystemSaveContext ( ) ; status = PmMasterReleaseAll ( ) ; if ( XST_SUCCESS != status ) { goto done ; } for ( i = 0U ; i < ARRAY_SIZE ( pmSystemReqs ) ; i ++ ) { u32 caps = 0U ; if ( pmSystemReqs [ i ] . slave == & pmSlaveDdr_g ) { caps |= PM_CAP_CONTEXT ; PmClockSave ( & pmSlaveDdr_g . node ) ; } req = PmRequirementGetNoMaster ( pmSystemReqs [ i ] . slave ) ; if ( NULL != req ) { if ( caps != req -> currReq ) { status = PmRequirementUpdate ( req , caps ) ; if ( XST_SUCCESS != status ) { goto done ; } } } else { status = XST_FAILURE ; goto done ; } } status = PmHookPosSaveDdrContext ( ) ; if ( XST_SUCCESS != status ) { goto done ; } status = PmSystemPosFinalizeDdrCaps ( ) ; done : return status ; }
PmSystemFinalizePowerOffSuspend() - Finalize entering Power Off Suspend state
 @return      This function will not return in case of entering Power Off
              Suspend, failure code otherwise
PmSystemFinalizePowerOffSuspend () - Finalize entering Power Off Suspend state @return This function will not return in case of entering Power Off Suspend failure code otherwise
/* Save system context */ /* Release all requirements for all masters in system */ /* Prepare system requirements for entering Power Off Suspend */ /* Put DDR in retention state during Power Off Suspend */ /* Save DDR clocks settings */ /* Save DDR context */ /* Release DDR context saving slave capabilities */