Lines Matching refs:ctrl
78 const struct iproc_pll_ctrl *ctrl;
86 const struct iproc_clk_ctrl *ctrl;
160 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
163 u32 val = readl(pll->status_base + ctrl->status.offset);
165 if (val & (1 << ctrl->status.shift))
176 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
180 if (unlikely(ctrl->flags & IPROC_CLK_NEEDS_READ_BACK &&
187 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
190 if (ctrl->flags & IPROC_CLK_PLL_ASIU) {
191 val = readl(pll->asiu_base + ctrl->asiu.offset);
192 val &= ~(1 << ctrl->asiu.en_shift);
193 iproc_pll_write(pll, pll->asiu_base, ctrl->asiu.offset, val);
196 if (ctrl->flags & IPROC_CLK_EMBED_PWRCTRL) {
197 val = readl(pll->control_base + ctrl->aon.offset);
198 val |= bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift;
199 iproc_pll_write(pll, pll->control_base, ctrl->aon.offset, val);
204 val = readl(pll->pwr_base + ctrl->aon.offset);
205 val |= 1 << ctrl->aon.iso_shift;
206 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val);
209 val &= ~(bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift);
210 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val);
216 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
219 if (ctrl->flags & IPROC_CLK_EMBED_PWRCTRL) {
220 val = readl(pll->control_base + ctrl->aon.offset);
221 val &= ~(bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift);
222 iproc_pll_write(pll, pll->control_base, ctrl->aon.offset, val);
227 val = readl(pll->pwr_base + ctrl->aon.offset);
228 val |= bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift;
229 val &= ~(1 << ctrl->aon.iso_shift);
230 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val);
234 if (ctrl->flags & IPROC_CLK_PLL_ASIU) {
235 val = readl(pll->asiu_base + ctrl->asiu.offset);
236 val |= (1 << ctrl->asiu.en_shift);
237 iproc_pll_write(pll, pll->asiu_base, ctrl->asiu.offset, val);
246 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
247 const struct iproc_pll_reset_ctrl *reset = &ctrl->reset;
250 if (ctrl->flags & IPROC_CLK_PLL_RESET_ACTIVE_LOW)
261 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
262 const struct iproc_pll_reset_ctrl *reset = &ctrl->reset;
263 const struct iproc_pll_dig_filter_ctrl *dig_filter = &ctrl->dig_filter;
274 if (ctrl->flags & IPROC_CLK_PLL_RESET_ACTIVE_LOW)
289 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
295 val = readl(pll->status_base + ctrl->status.offset);
296 if ((val & (1 << ctrl->status.shift)) == 0)
299 val = readl(pll->control_base + ctrl->ndiv_int.offset);
300 ndiv_int = (val >> ctrl->ndiv_int.shift) &
301 bit_mask(ctrl->ndiv_int.width);
306 val = readl(pll->control_base + ctrl->pdiv.offset);
307 pdiv = (val >> ctrl->pdiv.shift) & bit_mask(ctrl->pdiv.width);
319 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
366 if (ctrl->flags & IPROC_CLK_PLL_HAS_NDIV_FRAC) {
367 val = readl(pll->control_base + ctrl->ndiv_frac.offset);
368 val &= ~(bit_mask(ctrl->ndiv_frac.width) <<
369 ctrl->ndiv_frac.shift);
370 val |= vco->ndiv_frac << ctrl->ndiv_frac.shift;
372 ctrl->ndiv_frac.offset, val);
381 if (ctrl->flags & IPROC_CLK_PLL_USER_MODE_ON) {
382 val = readl(pll->control_base + ctrl->macro_mode.offset);
383 val &= ~(bit_mask(ctrl->macro_mode.width) <<
384 ctrl->macro_mode.shift);
385 val |= PLL_USER_MODE << ctrl->macro_mode.shift;
387 ctrl->macro_mode.offset, val);
390 iproc_pll_write(pll, pll->control_base, ctrl->vco_ctrl.u_offset, 0);
392 val = readl(pll->control_base + ctrl->vco_ctrl.l_offset);
402 iproc_pll_write(pll, pll->control_base, ctrl->vco_ctrl.l_offset, val);
405 val = readl(pll->control_base + ctrl->ndiv_int.offset);
406 val &= ~(bit_mask(ctrl->ndiv_int.width) << ctrl->ndiv_int.shift);
407 val |= vco->ndiv_int << ctrl->ndiv_int.shift;
408 iproc_pll_write(pll, pll->control_base, ctrl->ndiv_int.offset, val);
411 if (ctrl->flags & IPROC_CLK_PLL_HAS_NDIV_FRAC) {
412 val = readl(pll->control_base + ctrl->ndiv_frac.offset);
413 val &= ~(bit_mask(ctrl->ndiv_frac.width) <<
414 ctrl->ndiv_frac.shift);
415 val |= vco->ndiv_frac << ctrl->ndiv_frac.shift;
416 iproc_pll_write(pll, pll->control_base, ctrl->ndiv_frac.offset,
421 val = readl(pll->control_base + ctrl->pdiv.offset);
422 val &= ~(bit_mask(ctrl->pdiv.width) << ctrl->pdiv.shift);
423 val |= vco->pdiv << ctrl->pdiv.shift;
424 iproc_pll_write(pll, pll->control_base, ctrl->pdiv.offset, val);
449 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
451 if (ctrl->flags & IPROC_CLK_AON)
462 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
472 val = readl(pll->status_base + ctrl->status.offset);
473 if ((val & (1 << ctrl->status.shift)) == 0)
481 val = readl(pll->control_base + ctrl->ndiv_int.offset);
482 ndiv_int = (val >> ctrl->ndiv_int.shift) &
483 bit_mask(ctrl->ndiv_int.width);
486 if (ctrl->flags & IPROC_CLK_PLL_HAS_NDIV_FRAC) {
487 val = readl(pll->control_base + ctrl->ndiv_frac.offset);
488 ndiv_frac = (val >> ctrl->ndiv_frac.shift) &
489 bit_mask(ctrl->ndiv_frac.width);
493 val = readl(pll->control_base + ctrl->pdiv.offset);
494 pdiv = (val >> ctrl->pdiv.shift) & bit_mask(ctrl->pdiv.width);
512 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
520 if (ctrl->flags & IPROC_CLK_PLL_CALC_PARAM) {
557 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
561 if (ctrl->flags & IPROC_CLK_PLL_CALC_PARAM) {
588 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
593 val = readl(pll->control_base + ctrl->enable.offset);
594 val &= ~(1 << ctrl->enable.enable_shift);
595 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val);
598 val = readl(pll->control_base + ctrl->enable.offset);
599 val &= ~(1 << ctrl->enable.hold_shift);
600 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val);
608 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
612 if (ctrl->flags & IPROC_CLK_AON)
615 val = readl(pll->control_base + ctrl->enable.offset);
616 val |= 1 << ctrl->enable.enable_shift;
617 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val);
624 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
633 val = readl(pll->control_base + ctrl->mdiv.offset);
634 mdiv = (val >> ctrl->mdiv.shift) & bit_mask(ctrl->mdiv.width);
638 if (ctrl->flags & IPROC_CLK_MCLK_DIV_BY_2)
672 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
681 if (ctrl->flags & IPROC_CLK_MCLK_DIV_BY_2)
687 val = readl(pll->control_base + ctrl->mdiv.offset);
689 val &= ~(bit_mask(ctrl->mdiv.width) << ctrl->mdiv.shift);
691 val &= ~(bit_mask(ctrl->mdiv.width) << ctrl->mdiv.shift);
692 val |= div << ctrl->mdiv.shift;
694 iproc_pll_write(pll, pll->control_base, ctrl->mdiv.offset, val);
713 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
715 if (ctrl->flags & IPROC_CLK_PLL_NEEDS_SW_CFG) {
718 val = readl(pll->control_base + ctrl->sw_ctrl.offset);
719 val |= BIT(ctrl->sw_ctrl.shift);
720 iproc_pll_write(pll, pll->control_base, ctrl->sw_ctrl.offset,
782 pll->ctrl = pll_ctrl;
825 iclk->ctrl = &clk_ctrl[i];