Lines Matching refs:reg
51 void __iomem *reg; member
59 u32 reg; in clk_pll_prepare() local
61 reg = readl(hbclk->reg); in clk_pll_prepare()
62 reg &= ~HB_PLL_RESET; in clk_pll_prepare()
63 writel(reg, hbclk->reg); in clk_pll_prepare()
65 while ((readl(hbclk->reg) & HB_PLL_LOCK) == 0) in clk_pll_prepare()
67 while ((readl(hbclk->reg) & HB_PLL_LOCK_500) == 0) in clk_pll_prepare()
76 u32 reg; in clk_pll_unprepare() local
78 reg = readl(hbclk->reg); in clk_pll_unprepare()
79 reg |= HB_PLL_RESET; in clk_pll_unprepare()
80 writel(reg, hbclk->reg); in clk_pll_unprepare()
86 u32 reg; in clk_pll_enable() local
88 reg = readl(hbclk->reg); in clk_pll_enable()
89 reg |= HB_PLL_EXT_ENA; in clk_pll_enable()
90 writel(reg, hbclk->reg); in clk_pll_enable()
98 u32 reg; in clk_pll_disable() local
100 reg = readl(hbclk->reg); in clk_pll_disable()
101 reg &= ~HB_PLL_EXT_ENA; in clk_pll_disable()
102 writel(reg, hbclk->reg); in clk_pll_disable()
109 unsigned long divf, divq, vco_freq, reg; in clk_pll_recalc_rate() local
111 reg = readl(hbclk->reg); in clk_pll_recalc_rate()
112 if (reg & HB_PLL_EXT_BYPASS) in clk_pll_recalc_rate()
115 divf = (reg & HB_PLL_DIVF_MASK) >> HB_PLL_DIVF_SHIFT; in clk_pll_recalc_rate()
116 divq = (reg & HB_PLL_DIVQ_MASK) >> HB_PLL_DIVQ_SHIFT; in clk_pll_recalc_rate()
162 u32 reg; in clk_pll_set_rate() local
166 reg = readl(hbclk->reg); in clk_pll_set_rate()
167 if (divf != ((reg & HB_PLL_DIVF_MASK) >> HB_PLL_DIVF_SHIFT)) { in clk_pll_set_rate()
169 reg |= HB_PLL_EXT_BYPASS; in clk_pll_set_rate()
170 writel(reg | HB_PLL_EXT_BYPASS, hbclk->reg); in clk_pll_set_rate()
172 writel(reg | HB_PLL_RESET, hbclk->reg); in clk_pll_set_rate()
173 reg &= ~(HB_PLL_DIVF_MASK | HB_PLL_DIVQ_MASK); in clk_pll_set_rate()
174 reg |= (divf << HB_PLL_DIVF_SHIFT) | (divq << HB_PLL_DIVQ_SHIFT); in clk_pll_set_rate()
175 writel(reg | HB_PLL_RESET, hbclk->reg); in clk_pll_set_rate()
176 writel(reg, hbclk->reg); in clk_pll_set_rate()
178 while ((readl(hbclk->reg) & HB_PLL_LOCK) == 0) in clk_pll_set_rate()
180 while ((readl(hbclk->reg) & HB_PLL_LOCK_500) == 0) in clk_pll_set_rate()
182 reg |= HB_PLL_EXT_ENA; in clk_pll_set_rate()
183 reg &= ~HB_PLL_EXT_BYPASS; in clk_pll_set_rate()
185 writel(reg | HB_PLL_EXT_BYPASS, hbclk->reg); in clk_pll_set_rate()
186 reg &= ~HB_PLL_DIVQ_MASK; in clk_pll_set_rate()
187 reg |= divq << HB_PLL_DIVQ_SHIFT; in clk_pll_set_rate()
188 writel(reg | HB_PLL_EXT_BYPASS, hbclk->reg); in clk_pll_set_rate()
190 writel(reg, hbclk->reg); in clk_pll_set_rate()
209 u32 div = (readl(hbclk->reg) & HB_A9_PCLK_DIV) ? 8 : 4; in clk_cpu_periphclk_recalc_rate()
221 u32 div = (readl(hbclk->reg) & HB_A9_BCLK_DIV_MASK) >> HB_A9_BCLK_DIV_SHIFT; in clk_cpu_a9bclk_recalc_rate()
236 div = readl(hbclk->reg) & 0x1f; in clk_periclk_recalc_rate()
265 writel(div >> 1, hbclk->reg); in clk_periclk_set_rate()
277 u32 reg; in hb_clk_init() local
285 rc = of_property_read_u32(node, "reg", ®); in hb_clk_init()
295 hb_clk->reg = of_iomap(srnp, 0); in hb_clk_init()
296 BUG_ON(!hb_clk->reg); in hb_clk_init()
297 hb_clk->reg += reg; in hb_clk_init()