Lines Matching refs:ctrl

68 	const struct iproc_pll_ctrl *ctrl;
76 const struct iproc_clk_ctrl *ctrl;
150 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
153 u32 val = readl(pll->status_base + ctrl->status.offset);
155 if (val & (1 << ctrl->status.shift))
166 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
170 if (unlikely(ctrl->flags & IPROC_CLK_NEEDS_READ_BACK &&
177 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
180 if (ctrl->flags & IPROC_CLK_PLL_ASIU) {
181 val = readl(pll->asiu_base + ctrl->asiu.offset);
182 val &= ~(1 << ctrl->asiu.en_shift);
183 iproc_pll_write(pll, pll->asiu_base, ctrl->asiu.offset, val);
186 if (ctrl->flags & IPROC_CLK_EMBED_PWRCTRL) {
187 val = readl(pll->control_base + ctrl->aon.offset);
188 val |= bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift;
189 iproc_pll_write(pll, pll->control_base, ctrl->aon.offset, val);
194 val = readl(pll->pwr_base + ctrl->aon.offset);
195 val |= 1 << ctrl->aon.iso_shift;
196 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val);
199 val &= ~(bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift);
200 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val);
206 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
209 if (ctrl->flags & IPROC_CLK_EMBED_PWRCTRL) {
210 val = readl(pll->control_base + ctrl->aon.offset);
211 val &= ~(bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift);
212 iproc_pll_write(pll, pll->control_base, ctrl->aon.offset, val);
217 val = readl(pll->pwr_base + ctrl->aon.offset);
218 val |= bit_mask(ctrl->aon.pwr_width) << ctrl->aon.pwr_shift;
219 val &= ~(1 << ctrl->aon.iso_shift);
220 iproc_pll_write(pll, pll->pwr_base, ctrl->aon.offset, val);
224 if (ctrl->flags & IPROC_CLK_PLL_ASIU) {
225 val = readl(pll->asiu_base + ctrl->asiu.offset);
226 val |= (1 << ctrl->asiu.en_shift);
227 iproc_pll_write(pll, pll->asiu_base, ctrl->asiu.offset, val);
236 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
237 const struct iproc_pll_reset_ctrl *reset = &ctrl->reset;
240 if (ctrl->flags & IPROC_CLK_PLL_RESET_ACTIVE_LOW)
251 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
252 const struct iproc_pll_reset_ctrl *reset = &ctrl->reset;
253 const struct iproc_pll_dig_filter_ctrl *dig_filter = &ctrl->dig_filter;
264 if (ctrl->flags & IPROC_CLK_PLL_RESET_ACTIVE_LOW)
279 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
285 val = readl(pll->status_base + ctrl->status.offset);
286 if ((val & (1 << ctrl->status.shift)) == 0)
289 val = readl(pll->control_base + ctrl->ndiv_int.offset);
290 ndiv_int = (val >> ctrl->ndiv_int.shift) &
291 bit_mask(ctrl->ndiv_int.width);
296 val = readl(pll->control_base + ctrl->pdiv.offset);
297 pdiv = (val >> ctrl->pdiv.shift) & bit_mask(ctrl->pdiv.width);
309 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
356 if (ctrl->flags & IPROC_CLK_PLL_HAS_NDIV_FRAC) {
357 val = readl(pll->control_base + ctrl->ndiv_frac.offset);
358 val &= ~(bit_mask(ctrl->ndiv_frac.width) <<
359 ctrl->ndiv_frac.shift);
360 val |= vco->ndiv_frac << ctrl->ndiv_frac.shift;
362 ctrl->ndiv_frac.offset, val);
371 if (ctrl->flags & IPROC_CLK_PLL_USER_MODE_ON) {
372 val = readl(pll->control_base + ctrl->macro_mode.offset);
373 val &= ~(bit_mask(ctrl->macro_mode.width) <<
374 ctrl->macro_mode.shift);
375 val |= PLL_USER_MODE << ctrl->macro_mode.shift;
377 ctrl->macro_mode.offset, val);
380 iproc_pll_write(pll, pll->control_base, ctrl->vco_ctrl.u_offset, 0);
382 val = readl(pll->control_base + ctrl->vco_ctrl.l_offset);
392 iproc_pll_write(pll, pll->control_base, ctrl->vco_ctrl.l_offset, val);
395 val = readl(pll->control_base + ctrl->ndiv_int.offset);
396 val &= ~(bit_mask(ctrl->ndiv_int.width) << ctrl->ndiv_int.shift);
397 val |= vco->ndiv_int << ctrl->ndiv_int.shift;
398 iproc_pll_write(pll, pll->control_base, ctrl->ndiv_int.offset, val);
401 if (ctrl->flags & IPROC_CLK_PLL_HAS_NDIV_FRAC) {
402 val = readl(pll->control_base + ctrl->ndiv_frac.offset);
403 val &= ~(bit_mask(ctrl->ndiv_frac.width) <<
404 ctrl->ndiv_frac.shift);
405 val |= vco->ndiv_frac << ctrl->ndiv_frac.shift;
406 iproc_pll_write(pll, pll->control_base, ctrl->ndiv_frac.offset,
411 val = readl(pll->control_base + ctrl->pdiv.offset);
412 val &= ~(bit_mask(ctrl->pdiv.width) << ctrl->pdiv.shift);
413 val |= vco->pdiv << ctrl->pdiv.shift;
414 iproc_pll_write(pll, pll->control_base, ctrl->pdiv.offset, val);
439 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
441 if (ctrl->flags & IPROC_CLK_AON)
452 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
462 val = readl(pll->status_base + ctrl->status.offset);
463 if ((val & (1 << ctrl->status.shift)) == 0)
471 val = readl(pll->control_base + ctrl->ndiv_int.offset);
472 ndiv_int = (val >> ctrl->ndiv_int.shift) &
473 bit_mask(ctrl->ndiv_int.width);
476 if (ctrl->flags & IPROC_CLK_PLL_HAS_NDIV_FRAC) {
477 val = readl(pll->control_base + ctrl->ndiv_frac.offset);
478 ndiv_frac = (val >> ctrl->ndiv_frac.shift) &
479 bit_mask(ctrl->ndiv_frac.width);
483 val = readl(pll->control_base + ctrl->pdiv.offset);
484 pdiv = (val >> ctrl->pdiv.shift) & bit_mask(ctrl->pdiv.width);
502 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
510 if (ctrl->flags & IPROC_CLK_PLL_CALC_PARAM) {
547 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
551 if (ctrl->flags & IPROC_CLK_PLL_CALC_PARAM) {
578 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
583 val = readl(pll->control_base + ctrl->enable.offset);
584 val &= ~(1 << ctrl->enable.enable_shift);
585 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val);
588 val = readl(pll->control_base + ctrl->enable.offset);
589 val &= ~(1 << ctrl->enable.hold_shift);
590 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val);
598 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
602 if (ctrl->flags & IPROC_CLK_AON)
605 val = readl(pll->control_base + ctrl->enable.offset);
606 val |= 1 << ctrl->enable.enable_shift;
607 iproc_pll_write(pll, pll->control_base, ctrl->enable.offset, val);
614 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
623 val = readl(pll->control_base + ctrl->mdiv.offset);
624 mdiv = (val >> ctrl->mdiv.shift) & bit_mask(ctrl->mdiv.width);
628 if (ctrl->flags & IPROC_CLK_MCLK_DIV_BY_2)
662 const struct iproc_clk_ctrl *ctrl = clk->ctrl;
671 if (ctrl->flags & IPROC_CLK_MCLK_DIV_BY_2)
677 val = readl(pll->control_base + ctrl->mdiv.offset);
679 val &= ~(bit_mask(ctrl->mdiv.width) << ctrl->mdiv.shift);
681 val &= ~(bit_mask(ctrl->mdiv.width) << ctrl->mdiv.shift);
682 val |= div << ctrl->mdiv.shift;
684 iproc_pll_write(pll, pll->control_base, ctrl->mdiv.offset, val);
703 const struct iproc_pll_ctrl *ctrl = pll->ctrl;
705 if (ctrl->flags & IPROC_CLK_PLL_NEEDS_SW_CFG) {
708 val = readl(pll->control_base + ctrl->sw_ctrl.offset);
709 val |= BIT(ctrl->sw_ctrl.shift);
710 iproc_pll_write(pll, pll->control_base, ctrl->sw_ctrl.offset,
772 pll->ctrl = pll_ctrl;
815 iclk->ctrl = &clk_ctrl[i];