/* * If LP_DIV2_BYPASS is not set and PLLX is current parent then * PLLX/2 is the input source to CCLKLP.
*/ if ((mux->flags & TEGRA_DIVIDER_2) && !(val & SUPER_LP_DIV2_BYPASS) &&
(source == mux->pllx_index))
source = mux->div2_index;
if (mux->lock)
spin_lock_irqsave(mux->lock, flags);
val = readl_relaxed(mux->reg);
state = val & SUPER_STATE_MASK;
BUG_ON((state != super_state(SUPER_STATE_RUN)) &&
(state != super_state(SUPER_STATE_IDLE)));
shift = (state == super_state(SUPER_STATE_IDLE)) ?
super_state_to_src_shift(mux, SUPER_STATE_IDLE) :
super_state_to_src_shift(mux, SUPER_STATE_RUN);
/* * For LP mode super-clock switch between PLLX direct * and divided-by-2 outputs is allowed only when other * than PLLX clock source is current parent.
*/ if ((mux->flags & TEGRA_DIVIDER_2) && ((index == mux->div2_index) ||
(index == mux->pllx_index))) {
parent_index = clk_super_get_parent(hw); if ((parent_index == mux->div2_index) ||
(parent_index == mux->pllx_index)) {
err = -EINVAL; goto out;
}
val ^= SUPER_LP_DIV2_BYPASS;
writel_relaxed(val, mux->reg);
udelay(2);
if (index == mux->div2_index)
index = mux->pllx_index;
}
/* enable PLLP branches to CPU before selecting PLLP source */ if ((mux->flags & TEGRA210_CPU_CLK) &&
(index == CCLK_SRC_PLLP_OUT0 || index == CCLK_SRC_PLLP_OUT4))
tegra_clk_set_pllp_out_cpu(true);
val &= ~((super_state_to_src_mask(mux)) << shift);
val |= (index & (super_state_to_src_mask(mux))) << shift;
writel_relaxed(val, mux->reg);
udelay(2);
/* disable PLLP branches to CPU if not used */ if ((mux->flags & TEGRA210_CPU_CLK) &&
index != CCLK_SRC_PLLP_OUT0 && index != CCLK_SRC_PLLP_OUT4)
tegra_clk_set_pllp_out_cpu(false);
out: if (mux->lock)
spin_unlock_irqrestore(mux->lock, flags);
return err;
}
staticvoid clk_super_mux_restore_context(struct clk_hw *hw)
{ int parent_id;
parent_id = clk_hw_get_parent_index(hw); if (WARN_ON(parent_id < 0)) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.