Lines Matching +full:opp +full:- +full:792000000

1 // SPDX-License-Identifier: GPL-2.0-only
11 #include <linux/nvmem-consumer.h>
62 struct dev_pm_opp *opp; in imx6q_set_target() local
72 opp = dev_pm_opp_find_freq_ceil(cpu_dev, &freq_hz); in imx6q_set_target()
73 if (IS_ERR(opp)) { in imx6q_set_target()
74 dev_err(cpu_dev, "failed to find OPP for %ld\n", freq_hz); in imx6q_set_target()
75 return PTR_ERR(opp); in imx6q_set_target()
78 volt = dev_pm_opp_get_voltage(opp); in imx6q_set_target()
79 dev_pm_opp_put(opp); in imx6q_set_target()
83 dev_dbg(cpu_dev, "%u MHz, %ld mV --> %u MHz, %ld mV\n", in imx6q_set_target()
116 * - Enable pll2_pfd2_396m_clk and reparent pll1_sw_clk to it in imx6q_set_target()
117 * - Reprogram pll1_sys_clk and reparent pll1_sw_clk back to it in imx6q_set_target()
118 * - Disable pll2_pfd2_396m_clk in imx6q_set_target()
169 /* PLL1 is only needed until after ARM-PODF is set. */ in imx6q_set_target()
194 policy->clk = clks[ARM].clk; in imx6q_cpufreq_init()
196 policy->suspend_freq = max_freq; in imx6q_cpufreq_init()
209 .name = "imx6q-cpufreq",
218 if (ret < 0 && ret != -ENODEV) in imx6x_disable_freq_in_opp()
219 dev_warn(dev, "failed to disable %ldMHz OPP\n", freq / 1000000); in imx6x_disable_freq_in_opp()
233 if (of_property_present(dev->of_node, "nvmem-cells")) { in imx6q_opp_check_speed_grading()
240 ocotp = syscon_regmap_lookup_by_compatible("fsl,imx6q-ocotp"); in imx6q_opp_check_speed_grading()
242 return -ENOENT; in imx6q_opp_check_speed_grading()
248 * 2b'01: 852000000Hz; -- i.MX6Q Only, exclusive with 996MHz. in imx6q_opp_check_speed_grading()
249 * 2b'00: 792000000Hz; in imx6q_opp_check_speed_grading()
282 if (of_property_present(dev->of_node, "nvmem-cells")) { in imx6ul_opp_check_speed_grading()
289 ocotp = syscon_regmap_lookup_by_compatible("fsl,imx6ul-ocotp"); in imx6ul_opp_check_speed_grading()
291 ocotp = syscon_regmap_lookup_by_compatible("fsl,imx6ull-ocotp"); in imx6ul_opp_check_speed_grading()
294 return -ENOENT; in imx6ul_opp_check_speed_grading()
303 * 2b'10: 696000000Hz on i.MX6UL, 792000000Hz on i.MX6ULL; in imx6ul_opp_check_speed_grading()
316 imx6x_disable_freq_in_opp(dev, 792000000); in imx6ul_opp_check_speed_grading()
328 struct dev_pm_opp *opp; in imx6q_cpufreq_probe() local
338 return -ENODEV; in imx6q_cpufreq_probe()
341 np = of_node_get(cpu_dev->of_node); in imx6q_cpufreq_probe()
344 return -ENOENT; in imx6q_cpufreq_probe()
360 if (PTR_ERR(arm_reg) == -EPROBE_DEFER || in imx6q_cpufreq_probe()
361 PTR_ERR(soc_reg) == -EPROBE_DEFER || in imx6q_cpufreq_probe()
362 PTR_ERR(pu_reg) == -EPROBE_DEFER) { in imx6q_cpufreq_probe()
363 ret = -EPROBE_DEFER; in imx6q_cpufreq_probe()
369 ret = -ENOENT; in imx6q_cpufreq_probe()
375 dev_err(cpu_dev, "failed to init OPP table: %d\n", ret); in imx6q_cpufreq_probe()
393 dev_err(cpu_dev, "no OPP table is found: %d\n", ret); in imx6q_cpufreq_probe()
403 /* Make imx6_soc_volt array's size same as arm opp number */ in imx6q_cpufreq_probe()
407 ret = -ENOMEM; in imx6q_cpufreq_probe()
411 prop = of_find_property(np, "fsl,soc-operating-points", NULL); in imx6q_cpufreq_probe()
412 if (!prop || !prop->value) in imx6q_cpufreq_probe()
416 * Each OPP is a set of tuples consisting of frequency and in imx6q_cpufreq_probe()
417 * voltage like <freq-kHz vol-uV>. in imx6q_cpufreq_probe()
419 nr = prop->length / sizeof(u32); in imx6q_cpufreq_probe()
424 val = prop->value; in imx6q_cpufreq_probe()
436 /* use fixed soc opp volt if no valid soc opp info found in dtb */ in imx6q_cpufreq_probe()
438 …dev_warn(cpu_dev, "can NOT find valid fsl,soc-operating-points property in dtb, use default value!… in imx6q_cpufreq_probe()
441 if (freq_table[num - 1].frequency * 1000 == FREQ_1P2_GHZ) in imx6q_cpufreq_probe()
442 imx6_soc_volt[num - 1] = PU_SOC_VOLTAGE_HIGH; in imx6q_cpufreq_probe()
445 if (of_property_read_u32(np, "clock-latency", &transition_latency)) in imx6q_cpufreq_probe()
452 ret = regulator_set_voltage_time(soc_reg, imx6_soc_volt[0], imx6_soc_volt[num - 1]); in imx6q_cpufreq_probe()
456 ret = regulator_set_voltage_time(pu_reg, imx6_soc_volt[0], imx6_soc_volt[num - 1]); in imx6q_cpufreq_probe()
462 * OPP is maintained in order of increasing frequency, and in imx6q_cpufreq_probe()
463 * freq_table initialised from OPP is therefore sorted in the in imx6q_cpufreq_probe()
466 max_freq = freq_table[--num].frequency; in imx6q_cpufreq_probe()
467 opp = dev_pm_opp_find_freq_exact(cpu_dev, in imx6q_cpufreq_probe()
469 min_volt = dev_pm_opp_get_voltage(opp); in imx6q_cpufreq_probe()
470 dev_pm_opp_put(opp); in imx6q_cpufreq_probe()
471 opp = dev_pm_opp_find_freq_exact(cpu_dev, max_freq * 1000, true); in imx6q_cpufreq_probe()
472 max_volt = dev_pm_opp_get_voltage(opp); in imx6q_cpufreq_probe()
473 dev_pm_opp_put(opp); in imx6q_cpufreq_probe()
522 .name = "imx6q-cpufreq",
529 MODULE_ALIAS("platform:imx6q-cpufreq");