plat/xilinx/zynqmp/pm_service/pm_api_clock.c
/**
 * pm_api_pll_bypass_and_reset() - Bypass and reset PLL
 * @clock_id: Id of the PLL
 *
 * This function is to bypass and reset PLL.
 */
Bypass and reset PLL
@clock_id: Id of the PLL

This function is to bypass and reset PLL.
Bypass and reset PLL @clock_id : Id of the PLL This function is to bypass and reset PLL .
static inline enum pm_ret_status
pm_api_pll_bypass_and_reset(unsigned int clock_id, unsigned int flag)
{
	enum pm_ret_status ret = PM_RET_SUCCESS;
	unsigned int reg, val;
	int lockbit;
	reg = clocks[clock_id].control_reg;
	if (flag & CLK_PLL_RESET_ASSERT) {
		ret = pm_mmio_write(reg, PLLCTRL_BP_MASK, PLLCTRL_BP_MASK);
		if (ret != PM_RET_SUCCESS)
			return ret;
		ret = pm_mmio_write(reg, PLLCTRL_RESET_MASK,
				    PLLCTRL_RESET_MASK);
		if (ret != PM_RET_SUCCESS)
			return ret;
	}
	if (flag & CLK_PLL_RESET_RELEASE) {
		ret = pm_mmio_write(reg, PLLCTRL_RESET_MASK,
				    ~PLLCTRL_RESET_MASK);
		if (ret != PM_RET_SUCCESS)
			return ret;
		lockbit = pll_get_lockbit(clock_id);
		do {
			ret = pm_mmio_read(clocks[clock_id].status_reg, &val);
			if (ret != PM_RET_SUCCESS)
				return ret;
		} while ((lockbit >= 0) && !(val & (1 << lockbit)));
		ret = pm_mmio_write(reg, PLLCTRL_BP_MASK,
			      ~(unsigned int)PLLCTRL_BP_MASK);
	}
	return ret;
}
static inline enum pm_ret_status pm_api_pll_bypass_and_reset ( unsigned int clock_id , unsigned int flag ) { enum pm_ret_status ret = PM_RET_SUCCESS ; unsigned int reg , val ; int lockbit ; reg = clocks [ clock_id ] . control_reg ; if ( flag & CLK_PLL_RESET_ASSERT ) { ret = pm_mmio_write ( reg , PLLCTRL_BP_MASK , PLLCTRL_BP_MASK ) ; if ( ret != PM_RET_SUCCESS ) return ret ; ret = pm_mmio_write ( reg , PLLCTRL_RESET_MASK , PLLCTRL_RESET_MASK ) ; if ( ret != PM_RET_SUCCESS ) return ret ; } if ( flag & CLK_PLL_RESET_RELEASE ) { ret = pm_mmio_write ( reg , PLLCTRL_RESET_MASK , ~ PLLCTRL_RESET_MASK ) ; if ( ret != PM_RET_SUCCESS ) return ret ; lockbit = pll_get_lockbit ( clock_id ) ; do { ret = pm_mmio_read ( clocks [ clock_id ] . status_reg , & val ) ; if ( ret != PM_RET_SUCCESS ) return ret ; } while ( ( lockbit >= 0 ) && ! ( val & ( 1 << lockbit ) ) ) ; ret = pm_mmio_write ( reg , PLLCTRL_BP_MASK , ~ ( unsigned int ) PLLCTRL_BP_MASK ) ; } return ret ; }
pm_api_pll_bypass_and_reset() - Bypass and reset PLL
 @clock_id: Id of the PLL
pm_api_pll_bypass_and_reset () - Bypass and reset PLL @clock_id : Id of the PLL