Lines Matching refs:cpuclk
53 struct cpu_clk *cpuclk = to_cpu_clk(hwclk); in clk_cpu_recalc_rate() local
56 reg = readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_VALUE_OFFSET); in clk_cpu_recalc_rate()
57 div = (reg >> (cpuclk->cpu * 8)) & SYS_CTRL_CLK_DIVIDER_MASK; in clk_cpu_recalc_rate()
80 struct cpu_clk *cpuclk = to_cpu_clk(hwclk); in clk_cpu_off_set_rate() local
85 reg = (readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_VALUE_OFFSET) in clk_cpu_off_set_rate()
86 & (~(SYS_CTRL_CLK_DIVIDER_MASK << (cpuclk->cpu * 8)))) in clk_cpu_off_set_rate()
87 | (div << (cpuclk->cpu * 8)); in clk_cpu_off_set_rate()
88 writel(reg, cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_VALUE_OFFSET); in clk_cpu_off_set_rate()
90 reload_mask = 1 << (20 + cpuclk->cpu); in clk_cpu_off_set_rate()
92 reg = readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET) in clk_cpu_off_set_rate()
94 writel(reg, cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET); in clk_cpu_off_set_rate()
97 reg = readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET) in clk_cpu_off_set_rate()
99 writel(reg, cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET); in clk_cpu_off_set_rate()
104 writel(reg, cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET); in clk_cpu_off_set_rate()
115 struct cpu_clk *cpuclk = to_cpu_clk(hwclk); in clk_cpu_on_set_rate() local
121 if (!cpuclk->pmu_dfs) in clk_cpu_on_set_rate()
126 reg = readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL2_OFFSET); in clk_cpu_on_set_rate()
140 reg = readl(cpuclk->pmu_dfs); in clk_cpu_on_set_rate()
143 writel(reg, cpuclk->pmu_dfs); in clk_cpu_on_set_rate()
145 reg = readl(cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET); in clk_cpu_on_set_rate()
148 writel(reg, cpuclk->reg_base + SYS_CTRL_CLK_DIVIDER_CTRL_OFFSET); in clk_cpu_on_set_rate()
150 return mvebu_pmsu_dfs_request(cpuclk->cpu); in clk_cpu_on_set_rate()
170 struct cpu_clk *cpuclk; in of_cpu_clk_setup() local
189 cpuclk = kcalloc(ncpus, sizeof(*cpuclk), GFP_KERNEL); in of_cpu_clk_setup()
190 if (WARN_ON(!cpuclk)) in of_cpu_clk_setup()
212 cpuclk[cpu].parent_name = of_clk_get_parent_name(node, 0); in of_cpu_clk_setup()
213 cpuclk[cpu].clk_name = clk_name; in of_cpu_clk_setup()
214 cpuclk[cpu].cpu = cpu; in of_cpu_clk_setup()
215 cpuclk[cpu].reg_base = clock_complex_base; in of_cpu_clk_setup()
217 cpuclk[cpu].pmu_dfs = pmu_dfs_base + 4 * cpu; in of_cpu_clk_setup()
218 cpuclk[cpu].hw.init = &init; in of_cpu_clk_setup()
220 init.name = cpuclk[cpu].clk_name; in of_cpu_clk_setup()
223 init.parent_names = &cpuclk[cpu].parent_name; in of_cpu_clk_setup()
226 clk = clk_register(NULL, &cpuclk[cpu].hw); in of_cpu_clk_setup()
239 kfree(cpuclk[ncpus].clk_name); in of_cpu_clk_setup()
241 kfree(cpuclk); in of_cpu_clk_setup()