if (!strcmp(name, "main")) {
u32 ckscr = readl(base + CPG_CKSCR);
switch ((ckscr >> 28) & 3) { case 0: /* extal1 */
parent_name = of_clk_get_parent_name(np, 0); break; case 1: /* extal1 / 2 */
parent_name = of_clk_get_parent_name(np, 0);
div = 2; break; case 2: /* extal2 */
parent_name = of_clk_get_parent_name(np, 1); break; case 3: /* extal2 / 2 */
parent_name = of_clk_get_parent_name(np, 1);
div = 2; break;
}
} elseif (!strcmp(name, "pll0")) { /* PLL0/1 are configurable multiplier clocks. Register them as * fixed factor clocks for now as there's no generic multiplier * clock implementation and we currently have no need to change * the multiplier value.
*/
u32 value = readl(base + CPG_PLL0CR);
parent_name = "main";
mult = ((value >> 24) & 0x7f) + 1; if (value & BIT(20))
div = 2;
} elseif (!strcmp(name, "pll1")) {
u32 value = readl(base + CPG_PLL1CR);
num_clks = of_property_count_strings(np, "clock-output-names"); if (num_clks < 0) {
pr_err("%s: failed to count clocks\n", __func__); return;
}
cpg = kzalloc(sizeof(*cpg), GFP_KERNEL);
clks = kcalloc(num_clks, sizeof(*clks), GFP_KERNEL); if (cpg == NULL || clks == NULL) { /* We're leaking memory on purpose, there's no point in cleaning * up as the system won't boot anyway.
*/ 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.