lib/sw_apps/zynqmp_pmufw/src/pm_pll.c
static s32 PmPllResume(PmPll* const pll)
{
	s32 status = XST_SUCCESS;

	PmInfo("%s 0->1\r\n", pll->node.name);

	if (0U != (pll->flags & PM_PLL_CONTEXT_SAVED)) {
		PmPllRestoreContext(pll);
	}

	if (0U != (PM_PLL_CTRL_RESET_MASK & pll->context.ctrl)) {
		/* By saved/init configuration PLL is in reset, leave it as is */
		goto done;
	}
	if (NULL != pll->node.parent) {
		status = PmPowerRequestParent(&pll->node);
		if (XST_SUCCESS != status) {
			goto done;
		}
	}
	status = PmPllLock(pll);
	if (XST_SUCCESS != status) {
		/* Failed to lock PLL - assert reset and return */
		XPfw_RMW32(pll->addr + PM_PLL_CTRL_OFFSET,
			   PM_PLL_CTRL_RESET_MASK, PM_PLL_CTRL_RESET_MASK);
		goto done;
	}

	/* PLL is bypassed here (done by the reset) */
	if (0U == (PM_PLL_CTRL_BYPASS_MASK & pll->context.ctrl)) {
		/* According to saved context PLL should not be bypassed */
		XPfw_RMW32(pll->addr + PM_PLL_CTRL_OFFSET,
			   PM_PLL_CTRL_BYPASS_MASK,
			  ~PM_PLL_CTRL_BYPASS_MASK);
	}
	PmNodeUpdateCurrState(&pll->node, PM_PLL_STATE_LOCKED);

done:
	return status;
}
/**
 * PmPllResume() - Restore PLL context
 * @pll         Pll whose context should be restored
 *
 * @return      Status of resume:
 *              - XST_SUCCESS if resumed correctly
 *              - XST_FAILURE if resume failed (if PLL failed to lock)
 */
Restore PLL context
@pll         Pll whose context should be restored

@return      Status of resume:
- XST_SUCCESS if resumed correctly
- XST_FAILURE if resume failed (if PLL failed to lock)
Restore PLL context @pll Pll whose context should be restored @return Status of resume : - XST_SUCCESS if resumed correctly - XST_FAILURE if resume failed ( if PLL failed to lock )
static s32 PmPllResume(PmPll* const pll)
{
	s32 status = XST_SUCCESS;
	PmInfo("%s 0->1\r\n", pll->node.name);
	if (0U != (pll->flags & PM_PLL_CONTEXT_SAVED)) {
		PmPllRestoreContext(pll);
	}
	if (0U != (PM_PLL_CTRL_RESET_MASK & pll->context.ctrl)) {
		goto done;
	}
	if (NULL != pll->node.parent) {
		status = PmPowerRequestParent(&pll->node);
		if (XST_SUCCESS != status) {
			goto done;
		}
	}
	status = PmPllLock(pll);
	if (XST_SUCCESS != status) {
		XPfw_RMW32(pll->addr + PM_PLL_CTRL_OFFSET,
			   PM_PLL_CTRL_RESET_MASK, PM_PLL_CTRL_RESET_MASK);
		goto done;
	}
	if (0U == (PM_PLL_CTRL_BYPASS_MASK & pll->context.ctrl)) {
		XPfw_RMW32(pll->addr + PM_PLL_CTRL_OFFSET,
			   PM_PLL_CTRL_BYPASS_MASK,
			  ~PM_PLL_CTRL_BYPASS_MASK);
	}
	PmNodeUpdateCurrState(&pll->node, PM_PLL_STATE_LOCKED);
done:
	return status;
}
static s32 PmPllResume ( PmPll * const pll ) { s32 status = XST_SUCCESS ; PmInfo ( " \r \n " , pll -> node . name ) ; if ( 0U != ( pll -> flags & PM_PLL_CONTEXT_SAVED ) ) { PmPllRestoreContext ( pll ) ; } if ( 0U != ( PM_PLL_CTRL_RESET_MASK & pll -> context . ctrl ) ) { goto done ; } if ( NULL != pll -> node . parent ) { status = PmPowerRequestParent ( & pll -> node ) ; if ( XST_SUCCESS != status ) { goto done ; } } status = PmPllLock ( pll ) ; if ( XST_SUCCESS != status ) { XPfw_RMW32 ( pll -> addr + PM_PLL_CTRL_OFFSET , PM_PLL_CTRL_RESET_MASK , PM_PLL_CTRL_RESET_MASK ) ; goto done ; } if ( 0U == ( PM_PLL_CTRL_BYPASS_MASK & pll -> context . ctrl ) ) { XPfw_RMW32 ( pll -> addr + PM_PLL_CTRL_OFFSET , PM_PLL_CTRL_BYPASS_MASK , ~ PM_PLL_CTRL_BYPASS_MASK ) ; } PmNodeUpdateCurrState ( & pll -> node , PM_PLL_STATE_LOCKED ) ; done : return status ; }
PmPllResume() - Restore PLL context
 @pll         Pll whose context should be restored
PmPllResume () - Restore PLL context @pll Pll whose context should be restored
/* By saved/init configuration PLL is in reset, leave it as is */ /* Failed to lock PLL - assert reset and return */ /* PLL is bypassed here (done by the reset) */ /* According to saved context PLL should not be bypassed */