/* CPU clock derived as a fixed ratio from the AHB clock */
regmap_read(map, GEMINI_GLOBAL_STATUS, &val);
val >>= CPU_AHB_RATIO_SHIFT;
val &= CPU_AHB_RATIO_MASK;
hw = clk_hw_register_fixed_factor(NULL, "cpu", "ahb", 0,
cpu_ahb_mult[val],
cpu_ahb_div[val]);
gemini_clk_data->hws[GEMINI_CLK_CPU] = hw;
/* Security clock is 1:1 or 0.75 of APB */
regmap_read(map, GEMINI_GLOBAL_CLOCK_CONTROL, &val); if (val & SECURITY_CLK_SEL) {
mult = 1;
div = 1;
} else {
mult = 3;
div = 4;
}
hw = clk_hw_register_fixed_factor(NULL, "secdiv", "ahb", 0, mult, div);
/* *Thesearetheleafgates,atbootnoclocksaregated.
*/ for (i = 0; i < ARRAY_SIZE(gemini_gates); i++) { conststruct gemini_gate_data *gd;
/* *TheTVInterfaceControllerhasa5-bithalfdividerregister. *Thisclockissupposedtobe27MHzasthisisanexactmultiple *ofPALandNTSCfrequencies.Theregisterisundocumented:( *FIXME:figureouttheparentandhowthedividerworks.
*/
mult = 1;
div = ((val >> TVC_HALFDIV_SHIFT) & TVC_HALFDIV_MASK);
dev_dbg(dev, "TVC half divider value = %d\n", div);
div += 1;
hw = clk_hw_register_fixed_rate(NULL, "tvcdiv", "xtal", 0, 27000000);
gemini_clk_data->hws[GEMINI_CLK_TVC] = hw;
/* FIXME: very unclear what the parent is */
hw = gemini_pci_clk_setup("PCI", "xtal", map);
gemini_clk_data->hws[GEMINI_CLK_PCI] = hw;
/* FIXME: very unclear what the parent is */
hw = clk_hw_register_fixed_rate(NULL, "uart", "xtal", 0, 48000000);
gemini_clk_data->hws[GEMINI_CLK_UART] = hw;
/* *Thiswayallclockfetchedbeforetheplatformdeviceprobes, *exceptthoseweassignhereforearlyuse,willbedeferred.
*/ for (i = 0; i < GEMINI_NUM_CLKS; i++)
gemini_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER);
map = syscon_node_to_regmap(np); if (IS_ERR(map)) {
pr_err("no syscon regmap\n"); return;
} /* *Wecheckthattheregmapworksonthisveryfirstaccess, *butasthisisanMMIO-backedregmap,subsequentregmap *accessisnotgoingtofailandweskiperrorchecksfrom *thispoint.
*/
ret = regmap_read(map, GEMINI_GLOBAL_STATUS, &val); if (ret) {
pr_err("failed to read global status register\n"); return;
}
/* VCO clock derived from the crystal */
mult = 13 + ((val >> AHBSPEED_SHIFT) & AHBSPEED_MASK);
div = 2; /* If we run on 30 MHz crystal we have to multiply with two */ if (val & PLL_OSC_SEL)
mult *= 2;
hw = clk_hw_register_fixed_factor(NULL, "vco", "xtal", 0, mult, div);
/* The AHB clock is always 1/3 of the VCO */
hw = clk_hw_register_fixed_factor(NULL, "ahb", "vco", 0, 1, 3);
gemini_clk_data->hws[GEMINI_CLK_AHB] = hw;
/* The APB clock is always 1/6 of the AHB */
hw = clk_hw_register_fixed_factor(NULL, "apb", "ahb", 0, 1, 6);
gemini_clk_data->hws[GEMINI_CLK_APB] = hw;
/* Register the clocks to be accessed by the device tree */
of_clk_add_hw_provider(np, of_clk_hw_onecell_get, gemini_clk_data);
}
CLK_OF_DECLARE_DRIVER(gemini_cc, "cortina,gemini-syscon", gemini_cc_init);
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-09-27)
¤
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.