/* * This structure describes the hardware details (bit offset and mask) * to configure one particular core divider clock. Those hardware * details may differ from one SoC to another. This structure is * therefore typically instantiated statically to describe the * hardware details.
*/ struct clk_corediv_desc { unsignedint mask; unsignedint offset; unsignedint fieldbit;
};
/* * This structure describes the hardware details to configure the core * divider clocks on a given SoC. Amongst others, it points to the * array of core divider clock descriptors for this SoC, as well as * the corresponding operations to manipulate them.
*/ struct clk_corediv_soc_desc { conststruct clk_corediv_desc *descs; unsignedint ndescs; conststruct clk_ops ops;
u32 ratio_reload;
u32 enable_bit_offset;
u32 ratio_offset;
};
/* * This structure represents one core divider clock for the clock * framework, and is dynamically allocated for each core divider clock * existing in the current SoC.
*/ struct clk_corediv { struct clk_hw hw; void __iomem *reg; conststruct clk_corediv_desc *desc; conststruct clk_corediv_soc_desc *soc_desc;
spinlock_t lock;
};
staticstruct clk_onecell_data clk_data;
/* * Description of the core divider clocks available. For now, we * support only NAND, and it is available at the same register * locations regardless of the SoC.
*/ staticconststruct clk_corediv_desc mvebu_corediv_desc[] = {
{ .mask = 0x3f, .offset = 8, .fieldbit = 1 }, /* NAND clock */
};
/* Write new divider to the divider ratio register */
reg = readl(corediv->reg + soc_desc->ratio_offset);
reg &= ~(desc->mask << desc->offset);
reg |= (div & desc->mask) << desc->offset;
writel(reg, corediv->reg + soc_desc->ratio_offset);
/* Set reload-force for this clock */
reg = readl(corediv->reg) | BIT(desc->fieldbit);
writel(reg, corediv->reg);
/* Now trigger the clock update */
reg = readl(corediv->reg) | soc_desc->ratio_reload;
writel(reg, corediv->reg);
/* * Wait for clocks to settle down, and then clear all the * ratios request and the reload request.
*/
udelay(1000);
reg &= ~(CORE_CLK_DIV_RATIO_MASK | soc_desc->ratio_reload);
writel(reg, corediv->reg);
udelay(1000);
¤ 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.0.1Bemerkung:
(vorverarbeitet)
¤
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.