lib/sw_apps/zynqmp_pmufw/src/pm_pll.c
static void PmPllBypassAndReset(PmPll* const pll)
{
	u32 pllCtrl = pll->addr + PM_PLL_CTRL_OFFSET;
	u32 r;
#ifdef ENABLE_EM
	u32 pllErrMask = 1 << pll->errShift;
	pll->errValue = 0;
	/*
	 * Store PLL lock error interrupt mask and error enable
	 * before disabling it
	 */
	pll->errValue |= (~XPfw_Read32(PMU_GLOBAL_ERROR_INT_MASK_2) &
			   pllErrMask) >> pll->errShift;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_POR_MASK_2) &
			   pllErrMask) >> pll->errShift) << 1;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_SRST_MASK_2) &
			   pllErrMask) >> pll->errShift) << 2;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_SIG_MASK_2) &
			   pllErrMask) >> pll->errShift) << 3;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_EN_2) &
			   pllErrMask) >> pll->errShift) << 4;
	/* Disable PLL lock error interrupts before powering down PLL */
	XPfw_Write32(PMU_GLOBAL_ERROR_INT_DIS_2, pllErrMask);
	XPfw_Write32(PMU_GLOBAL_ERROR_POR_DIS_2, pllErrMask);
	XPfw_Write32(PMU_GLOBAL_ERROR_SRST_DIS_2, pllErrMask);
	XPfw_Write32(PMU_GLOBAL_ERROR_SIG_DIS_2, pllErrMask);
	XPfw_RMW32(PMU_GLOBAL_ERROR_EN_2, pllErrMask, 0x0U);
#endif

	/* Bypass PLL before putting it into the reset */
	r = Xil_In32(pllCtrl);
	r |= PM_PLL_CTRL_BYPASS_MASK;
	Xil_Out32(pllCtrl, r);

	/* Power down PLL (= reset PLL) */
	r = Xil_In32(pllCtrl);
	r |= PM_PLL_CTRL_RESET_MASK;
	Xil_Out32(pllCtrl, r);
}
/**
 * PmPllBypassAndReset() - Bypass and reset/power down a PLL
 * @pll Pointer to a Pll to be bypassed/reset
 */
Bypass and reset/power down a PLL
@pll Pointer to a Pll to be bypassed/reset
Bypass and reset / power down a PLL @pll Pointer to a Pll to be bypassed / reset
static void PmPllBypassAndReset(PmPll* const pll)
{
	u32 pllCtrl = pll->addr + PM_PLL_CTRL_OFFSET;
	u32 r;
#ifdef ENABLE_EM
	u32 pllErrMask = 1 << pll->errShift;
	pll->errValue = 0;
	pll->errValue |= (~XPfw_Read32(PMU_GLOBAL_ERROR_INT_MASK_2) &
			   pllErrMask) >> pll->errShift;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_POR_MASK_2) &
			   pllErrMask) >> pll->errShift) << 1;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_SRST_MASK_2) &
			   pllErrMask) >> pll->errShift) << 2;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_SIG_MASK_2) &
			   pllErrMask) >> pll->errShift) << 3;
	pll->errValue |= ((~XPfw_Read32(PMU_GLOBAL_ERROR_EN_2) &
			   pllErrMask) >> pll->errShift) << 4;
	XPfw_Write32(PMU_GLOBAL_ERROR_INT_DIS_2, pllErrMask);
	XPfw_Write32(PMU_GLOBAL_ERROR_POR_DIS_2, pllErrMask);
	XPfw_Write32(PMU_GLOBAL_ERROR_SRST_DIS_2, pllErrMask);
	XPfw_Write32(PMU_GLOBAL_ERROR_SIG_DIS_2, pllErrMask);
	XPfw_RMW32(PMU_GLOBAL_ERROR_EN_2, pllErrMask, 0x0U);
#endif
	r = Xil_In32(pllCtrl);
	r |= PM_PLL_CTRL_BYPASS_MASK;
	Xil_Out32(pllCtrl, r);
	r = Xil_In32(pllCtrl);
	r |= PM_PLL_CTRL_RESET_MASK;
	Xil_Out32(pllCtrl, r);
}
static void PmPllBypassAndReset ( PmPll * const pll ) { u32 pllCtrl = pll -> addr + PM_PLL_CTRL_OFFSET ; u32 r ; #ifdef ENABLE_EM u32 pllErrMask = 1 << pll -> errShift ; pll -> errValue = 0 ; pll -> errValue |= ( ~ XPfw_Read32 ( PMU_GLOBAL_ERROR_INT_MASK_2 ) & pllErrMask ) >> pll -> errShift ; pll -> errValue |= ( ( ~ XPfw_Read32 ( PMU_GLOBAL_ERROR_POR_MASK_2 ) & pllErrMask ) >> pll -> errShift ) << 1 ; pll -> errValue |= ( ( ~ XPfw_Read32 ( PMU_GLOBAL_ERROR_SRST_MASK_2 ) & pllErrMask ) >> pll -> errShift ) << 2 ; pll -> errValue |= ( ( ~ XPfw_Read32 ( PMU_GLOBAL_ERROR_SIG_MASK_2 ) & pllErrMask ) >> pll -> errShift ) << 3 ; pll -> errValue |= ( ( ~ XPfw_Read32 ( PMU_GLOBAL_ERROR_EN_2 ) & pllErrMask ) >> pll -> errShift ) << 4 ; XPfw_Write32 ( PMU_GLOBAL_ERROR_INT_DIS_2 , pllErrMask ) ; XPfw_Write32 ( PMU_GLOBAL_ERROR_POR_DIS_2 , pllErrMask ) ; XPfw_Write32 ( PMU_GLOBAL_ERROR_SRST_DIS_2 , pllErrMask ) ; XPfw_Write32 ( PMU_GLOBAL_ERROR_SIG_DIS_2 , pllErrMask ) ; XPfw_RMW32 ( PMU_GLOBAL_ERROR_EN_2 , pllErrMask , 0x0U ) ; #endif r = Xil_In32 ( pllCtrl ) ; r |= PM_PLL_CTRL_BYPASS_MASK ; Xil_Out32 ( pllCtrl , r ) ; r = Xil_In32 ( pllCtrl ) ; r |= PM_PLL_CTRL_RESET_MASK ; Xil_Out32 ( pllCtrl , r ) ; }
PmPllBypassAndReset() - Bypass and reset/power down a PLL
 @pll Pointer to a Pll to be bypassed/reset
PmPllBypassAndReset () - Bypass and reset / power down a PLL @pll Pointer to a Pll to be bypassed / reset
/*
	 * Store PLL lock error interrupt mask and error enable
	 * before disabling it
	 */ /* Disable PLL lock error interrupts before powering down PLL */ /* Bypass PLL before putting it into the reset */ /* Power down PLL (= reset PLL) */