• Home
  • Raw
  • Download

Lines Matching +full:hb +full:- +full:pll +full:- +full:clock

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright 2011-2012 Calxeda, Inc.
9 #include <linux/clk-provider.h>
49 reg = readl(hbclk->reg); in clk_pll_prepare()
51 writel(reg, hbclk->reg); in clk_pll_prepare()
53 while ((readl(hbclk->reg) & HB_PLL_LOCK) == 0) in clk_pll_prepare()
55 while ((readl(hbclk->reg) & HB_PLL_LOCK_500) == 0) in clk_pll_prepare()
66 reg = readl(hbclk->reg); in clk_pll_unprepare()
68 writel(reg, hbclk->reg); in clk_pll_unprepare()
76 reg = readl(hbclk->reg); in clk_pll_enable()
78 writel(reg, hbclk->reg); in clk_pll_enable()
88 reg = readl(hbclk->reg); in clk_pll_disable()
90 writel(reg, hbclk->reg); in clk_pll_disable()
99 reg = readl(hbclk->reg); in clk_pll_recalc_rate()
128 divf--; in clk_pll_calc()
154 reg = readl(hbclk->reg); in clk_pll_set_rate()
156 /* Need to re-lock PLL, so put it into bypass mode */ in clk_pll_set_rate()
158 writel(reg | HB_PLL_EXT_BYPASS, hbclk->reg); in clk_pll_set_rate()
160 writel(reg | HB_PLL_RESET, hbclk->reg); in clk_pll_set_rate()
163 writel(reg | HB_PLL_RESET, hbclk->reg); in clk_pll_set_rate()
164 writel(reg, hbclk->reg); in clk_pll_set_rate()
166 while ((readl(hbclk->reg) & HB_PLL_LOCK) == 0) in clk_pll_set_rate()
168 while ((readl(hbclk->reg) & HB_PLL_LOCK_500) == 0) in clk_pll_set_rate()
173 writel(reg | HB_PLL_EXT_BYPASS, hbclk->reg); in clk_pll_set_rate()
176 writel(reg | HB_PLL_EXT_BYPASS, hbclk->reg); in clk_pll_set_rate()
178 writel(reg, hbclk->reg); in clk_pll_set_rate()
197 u32 div = (readl(hbclk->reg) & HB_A9_PCLK_DIV) ? 8 : 4; in clk_cpu_periphclk_recalc_rate()
209 u32 div = (readl(hbclk->reg) & HB_A9_BCLK_DIV_MASK) >> HB_A9_BCLK_DIV_SHIFT; in clk_cpu_a9bclk_recalc_rate()
224 div = readl(hbclk->reg) & 0x1f; in clk_periclk_recalc_rate()
251 return -EINVAL; in clk_periclk_set_rate()
253 writel(div >> 1, hbclk->reg); in clk_periclk_set_rate()
267 const char *clk_name = node->name; in hb_clk_init()
282 srnp = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs"); in hb_clk_init()
283 hb_clk->reg = of_iomap(srnp, 0); in hb_clk_init()
285 BUG_ON(!hb_clk->reg); in hb_clk_init()
286 hb_clk->reg += reg; in hb_clk_init()
288 of_property_read_string(node, "clock-output-names", &clk_name); in hb_clk_init()
297 hb_clk->hw.init = &init; in hb_clk_init()
299 rc = clk_hw_register(NULL, &hb_clk->hw); in hb_clk_init()
304 of_clk_add_hw_provider(node, of_clk_hw_simple_get, &hb_clk->hw); in hb_clk_init()
311 CLK_OF_DECLARE(hb_pll, "calxeda,hb-pll-clock", hb_pll_init);
317 CLK_OF_DECLARE(hb_a9periph, "calxeda,hb-a9periph-clock", hb_a9periph_init);
323 CLK_OF_DECLARE(hb_a9bus, "calxeda,hb-a9bus-clock", hb_a9bus_init);
329 CLK_OF_DECLARE(hb_emmc, "calxeda,hb-emmc-clock", hb_emmc_init);