Lines Matching refs:val
163 u32 val = readl(pll->status_base + ctrl->status.offset); in pll_wait_for_lock() local
165 if (val & (1 << ctrl->status.shift)) in pll_wait_for_lock()
174 const u32 offset, u32 val) in iproc_pll_write() argument
178 writel(val, base + offset); in iproc_pll_write()
182 val = readl(base + offset); in iproc_pll_write()
188 u32 val; in __pll_disable() local
191 val = readl(pll->asiu_base + ctrl->asiu.offset); in __pll_disable()
192 val &= ~(1 << ctrl->asiu.en_shift); in __pll_disable()
193 iproc_pll_write(pll, pll->asiu_base, ctrl->asiu.offset, val); in __pll_disable()
197 val = readl(pll->control_base + ctrl->aon.offset); in __pll_disable()
198 val |= bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift; in __pll_disable()
199 iproc_pll_write(pll, pll->control_base, ctrl->aon.offset, val); in __pll_disable()
204 val = readl(pll->pwr_base + ctrl->aon.offset); in __pll_disable()
205 val |= 1 << ctrl->aon.iso_shift; in __pll_disable()
206 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val); in __pll_disable()
209 val &= ~(bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift); in __pll_disable()
210 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val); in __pll_disable()
217 u32 val; in __pll_enable() local
220 val = readl(pll->control_base + ctrl->aon.offset); in __pll_enable()
221 val &= ~(bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift); in __pll_enable()
222 iproc_pll_write(pll, pll->control_base, ctrl->aon.offset, val); in __pll_enable()
227 val = readl(pll->pwr_base + ctrl->aon.offset); in __pll_enable()
228 val |= bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift; in __pll_enable()
229 val &= ~(1 << ctrl->aon.iso_shift); in __pll_enable()
230 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val); in __pll_enable()
235 val = readl(pll->asiu_base + ctrl->asiu.offset); in __pll_enable()
236 val |= (1 << ctrl->asiu.en_shift); in __pll_enable()
237 iproc_pll_write(pll, pll->asiu_base, ctrl->asiu.offset, val); in __pll_enable()
245 u32 val; in __pll_put_in_reset() local
249 val = readl(pll->control_base + reset->offset); in __pll_put_in_reset()
251 val |= BIT(reset->reset_shift) | BIT(reset->p_reset_shift); in __pll_put_in_reset()
253 val &= ~(BIT(reset->reset_shift) | BIT(reset->p_reset_shift)); in __pll_put_in_reset()
254 iproc_pll_write(pll, pll->control_base, reset->offset, val); in __pll_put_in_reset()
260 u32 val; in __pll_bring_out_reset() local
265 val = readl(pll->control_base + dig_filter->offset); in __pll_bring_out_reset()
266 val &= ~(bit_mask(dig_filter->ki_width) << dig_filter->ki_shift | in __pll_bring_out_reset()
269 val |= ki << dig_filter->ki_shift | kp << dig_filter->kp_shift | in __pll_bring_out_reset()
271 iproc_pll_write(pll, pll->control_base, dig_filter->offset, val); in __pll_bring_out_reset()
273 val = readl(pll->control_base + reset->offset); in __pll_bring_out_reset()
275 val &= ~(BIT(reset->reset_shift) | BIT(reset->p_reset_shift)); in __pll_bring_out_reset()
277 val |= BIT(reset->reset_shift) | BIT(reset->p_reset_shift); in __pll_bring_out_reset()
278 iproc_pll_write(pll, pll->control_base, reset->offset, val); in __pll_bring_out_reset()
290 u32 val; in pll_fractional_change_only() local
295 val = readl(pll->status_base + ctrl->status.offset); in pll_fractional_change_only()
296 if ((val & (1 << ctrl->status.shift)) == 0) in pll_fractional_change_only()
299 val = readl(pll->control_base + ctrl->ndiv_int.offset); in pll_fractional_change_only()
300 ndiv_int = (val >> ctrl->ndiv_int.shift) & in pll_fractional_change_only()
306 val = readl(pll->control_base + ctrl->pdiv.offset); in pll_fractional_change_only()
307 pdiv = (val >> ctrl->pdiv.shift) & bit_mask(ctrl->pdiv.width); in pll_fractional_change_only()
322 u32 val; in pll_set_rate() local
367 val = readl(pll->control_base + ctrl->ndiv_frac.offset); in pll_set_rate()
368 val &= ~(bit_mask(ctrl->ndiv_frac.width) << in pll_set_rate()
370 val |= vco->ndiv_frac << ctrl->ndiv_frac.shift; in pll_set_rate()
372 ctrl->ndiv_frac.offset, val); in pll_set_rate()
382 val = readl(pll->control_base + ctrl->macro_mode.offset); in pll_set_rate()
383 val &= ~(bit_mask(ctrl->macro_mode.width) << in pll_set_rate()
385 val |= PLL_USER_MODE << ctrl->macro_mode.shift; in pll_set_rate()
387 ctrl->macro_mode.offset, val); in pll_set_rate()
392 val = readl(pll->control_base + ctrl->vco_ctrl.l_offset); in pll_set_rate()
395 val |= (1 << PLL_VCO_LOW_SHIFT); in pll_set_rate()
398 val &= ~(1 << PLL_VCO_HIGH_SHIFT); in pll_set_rate()
400 val |= (1 << PLL_VCO_HIGH_SHIFT); in pll_set_rate()
402 iproc_pll_write(pll, pll->control_base, ctrl->vco_ctrl.l_offset, val); in pll_set_rate()
405 val = readl(pll->control_base + ctrl->ndiv_int.offset); in pll_set_rate()
406 val &= ~(bit_mask(ctrl->ndiv_int.width) << ctrl->ndiv_int.shift); in pll_set_rate()
407 val |= vco->ndiv_int << ctrl->ndiv_int.shift; in pll_set_rate()
408 iproc_pll_write(pll, pll->control_base, ctrl->ndiv_int.offset, val); in pll_set_rate()
412 val = readl(pll->control_base + ctrl->ndiv_frac.offset); in pll_set_rate()
413 val &= ~(bit_mask(ctrl->ndiv_frac.width) << in pll_set_rate()
415 val |= vco->ndiv_frac << ctrl->ndiv_frac.shift; in pll_set_rate()
417 val); in pll_set_rate()
421 val = readl(pll->control_base + ctrl->pdiv.offset); in pll_set_rate()
422 val &= ~(bit_mask(ctrl->pdiv.width) << ctrl->pdiv.shift); in pll_set_rate()
423 val |= vco->pdiv << ctrl->pdiv.shift; in pll_set_rate()
424 iproc_pll_write(pll, pll->control_base, ctrl->pdiv.offset, val); in pll_set_rate()
463 u32 val; in iproc_pll_recalc_rate() local
472 val = readl(pll->status_base + ctrl->status.offset); in iproc_pll_recalc_rate()
473 if ((val & (1 << ctrl->status.shift)) == 0) in iproc_pll_recalc_rate()
481 val = readl(pll->control_base + ctrl->ndiv_int.offset); in iproc_pll_recalc_rate()
482 ndiv_int = (val >> ctrl->ndiv_int.shift) & in iproc_pll_recalc_rate()
487 val = readl(pll->control_base + ctrl->ndiv_frac.offset); in iproc_pll_recalc_rate()
488 ndiv_frac = (val >> ctrl->ndiv_frac.shift) & in iproc_pll_recalc_rate()
493 val = readl(pll->control_base + ctrl->pdiv.offset); in iproc_pll_recalc_rate()
494 pdiv = (val >> ctrl->pdiv.shift) & bit_mask(ctrl->pdiv.width); in iproc_pll_recalc_rate()
590 u32 val; in iproc_clk_enable() local
593 val = readl(pll->control_base + ctrl->enable.offset); in iproc_clk_enable()
594 val &= ~(1 << ctrl->enable.enable_shift); in iproc_clk_enable()
595 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val); in iproc_clk_enable()
598 val = readl(pll->control_base + ctrl->enable.offset); in iproc_clk_enable()
599 val &= ~(1 << ctrl->enable.hold_shift); in iproc_clk_enable()
600 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val); in iproc_clk_enable()
610 u32 val; in iproc_clk_disable() local
615 val = readl(pll->control_base + ctrl->enable.offset); in iproc_clk_disable()
616 val |= 1 << ctrl->enable.enable_shift; in iproc_clk_disable()
617 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val); in iproc_clk_disable()
626 u32 val; in iproc_clk_recalc_rate() local
633 val = readl(pll->control_base + ctrl->mdiv.offset); in iproc_clk_recalc_rate()
634 mdiv = (val >> ctrl->mdiv.shift) & bit_mask(ctrl->mdiv.width); in iproc_clk_recalc_rate()
674 u32 val; in iproc_clk_set_rate() local
687 val = readl(pll->control_base + ctrl->mdiv.offset); in iproc_clk_set_rate()
689 val &= ~(bit_mask(ctrl->mdiv.width) << ctrl->mdiv.shift); in iproc_clk_set_rate()
691 val &= ~(bit_mask(ctrl->mdiv.width) << ctrl->mdiv.shift); in iproc_clk_set_rate()
692 val |= div << ctrl->mdiv.shift; in iproc_clk_set_rate()
694 iproc_pll_write(pll, pll->control_base, ctrl->mdiv.offset, val); in iproc_clk_set_rate()
716 u32 val; in iproc_pll_sw_cfg() local
718 val = readl(pll->control_base + ctrl->sw_ctrl.offset); in iproc_pll_sw_cfg()
719 val |= BIT(ctrl->sw_ctrl.shift); in iproc_pll_sw_cfg()
721 val); in iproc_pll_sw_cfg()