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

	/* Deassert reset to trigger the PLL locking */
	XPfw_RMW32(pll->addr + PM_PLL_CTRL_OFFSET, PM_PLL_CTRL_RESET_MASK,
		   ~PM_PLL_CTRL_RESET_MASK);
	/* Poll status register for the lock */
	status = XPfw_UtilPollForMask(pll->statusAddr, (u32)1 << pll->lockShift,
				      PM_PLL_LOCK_TIMEOUT);

#ifdef ENABLE_EM
	/*
	 * Restore PLL lock error interrupts and error enable
	 * once PLL is locked
	 */
	XPfw_Write32(PMU_GLOBAL_ERROR_INT_EN_2,
		     ((pll->errValue & 1U) << pll->errShift));
	XPfw_Write32(PMU_GLOBAL_ERROR_POR_EN_2,
		     (((pll->errValue >> 1) & 1U) << pll->errShift));
	XPfw_Write32(PMU_GLOBAL_ERROR_SRST_EN_2,
		     (((pll->errValue >> 2) & 1U) << pll->errShift));
	XPfw_Write32(PMU_GLOBAL_ERROR_SIG_EN_2,
		     (((pll->errValue >> 3) & 1U) << pll->errShift));
	XPfw_RMW32(PMU_GLOBAL_ERROR_EN_2, (1U << pll->errShift),
			(((pll->errValue >> 4) & 1U) << pll->errShift));
#endif

	return status;
}
/**
 * PmPllLock() - Trigger locking of the PLL and wait for it to lock
 * @pll		Target PLL
 *
 * @status	Status of polling for the lock status as returned by
 *		XPfw_UtilPollForMask
 */
Trigger locking of the PLL and wait for it to lock
@pll         Target PLL

@status      Status of polling for the lock status as returned by
XPfw_UtilPollForMask
Trigger locking of the PLL and wait for it to lock @pll Target PLL @status Status of polling for the lock status as returned by XPfw_UtilPollForMask
static s32 PmPllLock(const PmPll* const pll)
{
	s32 status;
	XPfw_RMW32(pll->addr + PM_PLL_CTRL_OFFSET, PM_PLL_CTRL_RESET_MASK,
		   ~PM_PLL_CTRL_RESET_MASK);
	status = XPfw_UtilPollForMask(pll->statusAddr, (u32)1 << pll->lockShift,
				      PM_PLL_LOCK_TIMEOUT);
#ifdef ENABLE_EM
	XPfw_Write32(PMU_GLOBAL_ERROR_INT_EN_2,
		     ((pll->errValue & 1U) << pll->errShift));
	XPfw_Write32(PMU_GLOBAL_ERROR_POR_EN_2,
		     (((pll->errValue >> 1) & 1U) << pll->errShift));
	XPfw_Write32(PMU_GLOBAL_ERROR_SRST_EN_2,
		     (((pll->errValue >> 2) & 1U) << pll->errShift));
	XPfw_Write32(PMU_GLOBAL_ERROR_SIG_EN_2,
		     (((pll->errValue >> 3) & 1U) << pll->errShift));
	XPfw_RMW32(PMU_GLOBAL_ERROR_EN_2, (1U << pll->errShift),
			(((pll->errValue >> 4) & 1U) << pll->errShift));
#endif
	return status;
}
static s32 PmPllLock ( const PmPll * const pll ) { s32 status ; XPfw_RMW32 ( pll -> addr + PM_PLL_CTRL_OFFSET , PM_PLL_CTRL_RESET_MASK , ~ PM_PLL_CTRL_RESET_MASK ) ; status = XPfw_UtilPollForMask ( pll -> statusAddr , ( u32 ) 1 << pll -> lockShift , PM_PLL_LOCK_TIMEOUT ) ; #ifdef ENABLE_EM XPfw_Write32 ( PMU_GLOBAL_ERROR_INT_EN_2 , ( ( pll -> errValue & 1U ) << pll -> errShift ) ) ; XPfw_Write32 ( PMU_GLOBAL_ERROR_POR_EN_2 , ( ( ( pll -> errValue >> 1 ) & 1U ) << pll -> errShift ) ) ; XPfw_Write32 ( PMU_GLOBAL_ERROR_SRST_EN_2 , ( ( ( pll -> errValue >> 2 ) & 1U ) << pll -> errShift ) ) ; XPfw_Write32 ( PMU_GLOBAL_ERROR_SIG_EN_2 , ( ( ( pll -> errValue >> 3 ) & 1U ) << pll -> errShift ) ) ; XPfw_RMW32 ( PMU_GLOBAL_ERROR_EN_2 , ( 1U << pll -> errShift ) , ( ( ( pll -> errValue >> 4 ) & 1U ) << pll -> errShift ) ) ; #endif return status ; }
PmPllLock() - Trigger locking of the PLL and wait for it to lock
 @pll         Target PLL
PmPllLock () - Trigger locking of the PLL and wait for it to lock @pll Target PLL
/* Deassert reset to trigger the PLL locking */ /* Poll status register for the lock */ /*
	 * Restore PLL lock error interrupts and error enable
	 * once PLL is locked
	 */