lib/sw_apps/zynqmp_pmufw/src/pm_proc.c
static s32 PmProcTrToForcedOff(PmProc* const proc)
{
	s32 status;
	bool killed;
	u32 pwrReq;

	PmInfo("%s active->forced off\r\n", proc->node.name);

	proc->node.latencyMarg = MAX_LATENCY;
	proc->resumeAddress = 0ULL;
	status = PmProcSleep(proc);
	PmNodeUpdateCurrState(&proc->node, PM_PROC_STATE_FORCEDOFF);
	PmProcDisableEvents(proc);

	pwrReq = XPfw_Read32(proc->pwrDnReqAddr);
	if (0U != (proc->pwrDnReqMask & pwrReq)) {
		pwrReq &= ~proc->pwrDnReqMask;
		XPfw_Write32(proc->pwrDnReqAddr, pwrReq);
	}

	if ((XST_SUCCESS != status) || (NULL == proc->master)) {
		goto done;
	}

	/* If master is also forced down we do not need to notify it */
	killed = PmMasterIsKilled(proc->master);
	if (false == killed) {
		status = PmMasterFsm(proc->master, PM_MASTER_EVENT_FORCED_PROC);
	}

done:
	return status;
}
/**
 * PmProcTrToForcedOff() - FSM transition from active to force powerdown
 *                         state
 * @proc    Pointer to processor whose FSM is changing state
 *
 * @return  Operation status
 *
 * @note    Executes when some other processor authorized to do so requests
 *          through PM API the PMU to powered down this processor. This
 *          processor is not informed about the following power down and
 *          therefore PMU does not wait for it to execute wfi. If processor has
 *          no implemented sleep function it will continue executing
 *          instructions.
 *          If the power down request bit is set when the processor is forced
 *          off, the bit must be cleared to ensure that
 *          1. Processor correctly concludes on the future boot that it is not
 *             resuming
 *          2. No wfi propagates to the PMU on the future boot (before processor
 *             clears the bit on its own)
 */
FSM transition from active to force powerdown
state
@proc    Pointer to processor whose FSM is changing state

@return  Operation status

@note    Executes when some other processor authorized to do so requests
through PM API the PMU to powered down this processor. This
processor is not informed about the following power down and
therefore PMU does not wait for it to execute wfi. If processor has
no implemented sleep function it will continue executing
instructions.
If the power down request bit is set when the processor is forced
off, the bit must be cleared to ensure that
1. Processor correctly concludes on the future boot that it is not
resuming
2. No wfi propagates to the PMU on the future boot (before processor
clears the bit on its own)
FSM transition from active to force powerdown state @proc Pointer to processor whose FSM is changing state @return Operation status @note Executes when some other processor authorized to do so requests through PM API the PMU to powered down this processor . This processor is not informed about the following power down and therefore PMU does not wait for it to execute wfi . If processor has no implemented sleep function it will continue executing instructions . If the power down request bit is set when the processor is forced off the bit must be cleared to ensure that 1 . Processor correctly concludes on the future boot that it is not resuming 2 . No wfi propagates to the PMU on the future boot ( before processor clears the bit on its own )
static s32 PmProcTrToForcedOff(PmProc* const proc)
{
	s32 status;
	bool killed;
	u32 pwrReq;
	PmInfo("%s active->forced off\r\n", proc->node.name);
	proc->node.latencyMarg = MAX_LATENCY;
	proc->resumeAddress = 0ULL;
	status = PmProcSleep(proc);
	PmNodeUpdateCurrState(&proc->node, PM_PROC_STATE_FORCEDOFF);
	PmProcDisableEvents(proc);
	pwrReq = XPfw_Read32(proc->pwrDnReqAddr);
	if (0U != (proc->pwrDnReqMask & pwrReq)) {
		pwrReq &= ~proc->pwrDnReqMask;
		XPfw_Write32(proc->pwrDnReqAddr, pwrReq);
	}
	if ((XST_SUCCESS != status) || (NULL == proc->master)) {
		goto done;
	}
	killed = PmMasterIsKilled(proc->master);
	if (false == killed) {
		status = PmMasterFsm(proc->master, PM_MASTER_EVENT_FORCED_PROC);
	}
done:
	return status;
}
static s32 PmProcTrToForcedOff ( PmProc * const proc ) { s32 status ; bool killed ; u32 pwrReq ; PmInfo ( " \r \n " , proc -> node . name ) ; proc -> node . latencyMarg = MAX_LATENCY ; proc -> resumeAddress = 0ULL ; status = PmProcSleep ( proc ) ; PmNodeUpdateCurrState ( & proc -> node , PM_PROC_STATE_FORCEDOFF ) ; PmProcDisableEvents ( proc ) ; pwrReq = XPfw_Read32 ( proc -> pwrDnReqAddr ) ; if ( 0U != ( proc -> pwrDnReqMask & pwrReq ) ) { pwrReq &= ~ proc -> pwrDnReqMask ; XPfw_Write32 ( proc -> pwrDnReqAddr , pwrReq ) ; } if ( ( XST_SUCCESS != status ) || ( NULL == proc -> master ) ) { goto done ; } killed = PmMasterIsKilled ( proc -> master ) ; if ( false == killed ) { status = PmMasterFsm ( proc -> master , PM_MASTER_EVENT_FORCED_PROC ) ; } done : return status ; }
PmProcTrToForcedOff() - FSM transition from active to force powerdown
                         state
 @proc    Pointer to processor whose FSM is changing state
PmProcTrToForcedOff () - FSM transition from active to force powerdown state @proc Pointer to processor whose FSM is changing state
/* If master is also forced down we do not need to notify it */