Lines Matching +full:vco +full:- +full:hz

1 // SPDX-License-Identifier: GPL-2.0
7 #define pr_fmt(fmt) "clk-gemini: " fmt
15 #include <linux/clk-provider.h>
21 #include <linux/reset-controller.h>
22 #include <dt-bindings/reset/cortina,gemini-reset.h>
23 #include <dt-bindings/clock/cortina,gemini-clock.h>
53 * struct gemini_gate_data - Gemini gated clocks
67 * struct clk_gemini_pci - Gemini PCI clock
77 * struct gemini_reset - gemini reset controller
90 { 1, "security-gate", "secdiv", 0 },
91 { 2, "gmac0-gate", "ahb", 0 },
92 { 3, "gmac1-gate", "ahb", 0 },
93 { 4, "sata0-gate", "ahb", 0 },
94 { 5, "sata1-gate", "ahb", 0 },
95 { 6, "usb0-gate", "ahb", 0 },
96 { 7, "usb1-gate", "ahb", 0 },
97 { 8, "ide-gate", "ahb", 0 },
98 { 9, "pci-gate", "ahb", 0 },
103 { 10, "ddr-gate", "ahb", CLK_IS_CRITICAL },
108 { 11, "flash-gate", "ahb", CLK_IGNORE_UNUSED },
109 { 12, "tvc-gate", "ahb", 0 },
110 { 13, "boot-gate", "apb", 0 },
123 regmap_read(pciclk->map, GEMINI_GLOBAL_MISC_CONTROL, &val); in gemini_pci_recalc_rate()
144 return regmap_update_bits(pciclk->map, in gemini_pci_set_rate()
148 return regmap_update_bits(pciclk->map, in gemini_pci_set_rate()
151 return -EINVAL; in gemini_pci_set_rate()
158 regmap_update_bits(pciclk->map, GEMINI_GLOBAL_CLOCK_CONTROL, in gemini_pci_enable()
167 regmap_update_bits(pciclk->map, GEMINI_GLOBAL_CLOCK_CONTROL, in gemini_pci_disable()
176 regmap_read(pciclk->map, GEMINI_GLOBAL_CLOCK_CONTROL, &val); in gemini_pci_is_enabled()
199 return ERR_PTR(-ENOMEM); in gemini_pci_clk_setup()
206 pciclk->map = map; in gemini_pci_clk_setup()
207 pciclk->hw.init = &init; in gemini_pci_clk_setup()
209 ret = clk_hw_register(NULL, &pciclk->hw); in gemini_pci_clk_setup()
215 return &pciclk->hw; in gemini_pci_clk_setup()
219 * This is a self-deasserting reset controller.
227 return regmap_write(gr->map, in gemini_reset()
251 ret = regmap_read(gr->map, GEMINI_GLOBAL_SOFT_RESET, &val); in gemini_reset_status()
274 struct device *dev = &pdev->dev; in gemini_clk_probe()
275 struct device_node *np = dev->of_node; in gemini_clk_probe()
283 return -ENOMEM; in gemini_clk_probe()
296 gr->map = map; in gemini_clk_probe()
297 gr->rcdev.owner = THIS_MODULE; in gemini_clk_probe()
298 gr->rcdev.nr_resets = 32; in gemini_clk_probe()
299 gr->rcdev.ops = &gemini_reset_ops; in gemini_clk_probe()
300 gr->rcdev.of_node = np; in gemini_clk_probe()
302 ret = devm_reset_controller_register(dev, &gr->rcdev); in gemini_clk_probe()
308 /* RTC clock 32768 Hz */ in gemini_clk_probe()
310 gemini_clk_data->hws[GEMINI_CLK_RTC] = hw; in gemini_clk_probe()
319 gemini_clk_data->hws[GEMINI_CLK_CPU] = hw; in gemini_clk_probe()
339 gemini_clk_data->hws[GEMINI_CLK_GATES + i] = in gemini_clk_probe()
340 clk_hw_register_gate(NULL, gd->name, in gemini_clk_probe()
341 gd->parent_name, in gemini_clk_probe()
342 gd->flags, in gemini_clk_probe()
344 gd->bit_idx, in gemini_clk_probe()
350 * The TV Interface Controller has a 5-bit half divider register. in gemini_clk_probe()
360 gemini_clk_data->hws[GEMINI_CLK_TVC] = hw; in gemini_clk_probe()
364 gemini_clk_data->hws[GEMINI_CLK_PCI] = hw; in gemini_clk_probe()
368 gemini_clk_data->hws[GEMINI_CLK_UART] = hw; in gemini_clk_probe()
374 { .compatible = "cortina,gemini-syscon", },
381 .name = "gemini-clk",
403 gemini_clk_data->num = GEMINI_NUM_CLKS; in gemini_cc_init()
410 gemini_clk_data->hws[i] = ERR_PTR(-EPROBE_DEFER); in gemini_cc_init()
419 * but as this is an MMIO-backed regmap, subsequent regmap in gemini_cc_init()
440 /* VCO clock derived from the crystal */ in gemini_cc_init()
446 hw = clk_hw_register_fixed_factor(NULL, "vco", "xtal", 0, mult, div); in gemini_cc_init()
448 /* The AHB clock is always 1/3 of the VCO */ in gemini_cc_init()
449 hw = clk_hw_register_fixed_factor(NULL, "ahb", "vco", 0, 1, 3); in gemini_cc_init()
450 gemini_clk_data->hws[GEMINI_CLK_AHB] = hw; in gemini_cc_init()
454 gemini_clk_data->hws[GEMINI_CLK_APB] = hw; in gemini_cc_init()
459 CLK_OF_DECLARE_DRIVER(gemini_cc, "cortina,gemini-syscon", gemini_cc_init);