Lines Matching +full:speed +full:- +full:grade

1 // SPDX-License-Identifier: GPL-2.0-only
3 * TI CPUFreq/OPP hw-supported driver
5 * Copyright (C) 2016-2017 Texas Instruments, Inc.
6 * Dave Gerlach <d-gerlach@ti.com>
60 * The V, U, and T speed grade numbering is out of order
110 efuse = opp_data->soc_data->efuse_fallback; in amx3_efuse_xlate()
144 /* OPP enable bit ("Speed Binned") */ in omap3_efuse_xlate()
256 .efuse_offset = OMAP34xx_ProdID_SKUID - OMAP3_SYSCON_BASE,
259 .rev_offset = OMAP3_CONTROL_IDCODE - OMAP3_SYSCON_BASE,
270 * Speed Binned = Bit 9
284 .efuse_offset = OMAP3_CONTROL_DEVICE_STATUS - OMAP3_SYSCON_BASE,
287 .rev_offset = OMAP3_CONTROL_IDCODE - OMAP3_SYSCON_BASE,
294 * high speed grade eFuse and no abb ldo
299 .efuse_offset = OMAP3_CONTROL_DEVICE_STATUS - OMAP3_SYSCON_BASE,
302 .rev_offset = OMAP3_CONTROL_IDCODE - OMAP3_SYSCON_BASE,
342 * ti_cpufreq_get_efuse() - Parse and return efuse value present on SoC
351 struct device *dev = opp_data->cpu_dev; in ti_cpufreq_get_efuse()
355 ret = regmap_read(opp_data->syscon, opp_data->soc_data->efuse_offset, in ti_cpufreq_get_efuse()
357 if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING && ret == -EIO) { in ti_cpufreq_get_efuse()
360 opp_data->soc_data->efuse_offset, 4); in ti_cpufreq_get_efuse()
363 return -ENOMEM; in ti_cpufreq_get_efuse()
374 efuse = (efuse & opp_data->soc_data->efuse_mask); in ti_cpufreq_get_efuse()
375 efuse >>= opp_data->soc_data->efuse_shift; in ti_cpufreq_get_efuse()
377 *efuse_value = opp_data->soc_data->efuse_xlate(opp_data, efuse); in ti_cpufreq_get_efuse()
383 * ti_cpufreq_get_rev() - Parse and return rev value present on SoC
392 struct device *dev = opp_data->cpu_dev; in ti_cpufreq_get_rev()
406 ret = regmap_read(opp_data->syscon, opp_data->soc_data->rev_offset, in ti_cpufreq_get_rev()
408 if (opp_data->soc_data->quirks & TI_QUIRK_SYSCON_MAY_BE_MISSING && ret == -EIO) { in ti_cpufreq_get_rev()
411 opp_data->soc_data->rev_offset, 4); in ti_cpufreq_get_rev()
414 return -ENOMEM; in ti_cpufreq_get_rev()
433 struct device *dev = opp_data->cpu_dev; in ti_cpufreq_setup_syscon_register()
434 struct device_node *np = opp_data->opp_node; in ti_cpufreq_setup_syscon_register()
436 opp_data->syscon = syscon_regmap_lookup_by_phandle(np, in ti_cpufreq_setup_syscon_register()
438 if (IS_ERR(opp_data->syscon)) { in ti_cpufreq_setup_syscon_register()
441 return PTR_ERR(opp_data->syscon); in ti_cpufreq_setup_syscon_register()
485 match = dev_get_platdata(&pdev->dev); in ti_cpufreq_probe()
487 return -ENODEV; in ti_cpufreq_probe()
489 opp_data = devm_kzalloc(&pdev->dev, sizeof(*opp_data), GFP_KERNEL); in ti_cpufreq_probe()
491 return -ENOMEM; in ti_cpufreq_probe()
493 opp_data->soc_data = match->data; in ti_cpufreq_probe()
495 opp_data->cpu_dev = get_cpu_device(0); in ti_cpufreq_probe()
496 if (!opp_data->cpu_dev) { in ti_cpufreq_probe()
498 return -ENODEV; in ti_cpufreq_probe()
501 opp_data->opp_node = dev_pm_opp_of_get_opp_desc_node(opp_data->cpu_dev); in ti_cpufreq_probe()
502 if (!opp_data->opp_node) { in ti_cpufreq_probe()
503 dev_info(opp_data->cpu_dev, in ti_cpufreq_probe()
504 "OPP-v2 not supported, cpufreq-dt will attempt to use legacy tables.\n"); in ti_cpufreq_probe()
515 * 0 - SoC Revision in ti_cpufreq_probe()
516 * 1 - eFuse value in ti_cpufreq_probe()
526 if (opp_data->soc_data->multi_regulator) { in ti_cpufreq_probe()
527 if (opp_data->soc_data->reg_names) in ti_cpufreq_probe()
528 config.regulator_names = opp_data->soc_data->reg_names; in ti_cpufreq_probe()
533 ret = dev_pm_opp_set_config(opp_data->cpu_dev, &config); in ti_cpufreq_probe()
535 dev_err_probe(opp_data->cpu_dev, ret, "Failed to set OPP config\n"); in ti_cpufreq_probe()
539 of_node_put(opp_data->opp_node); in ti_cpufreq_probe()
542 platform_device_register_simple("cpufreq-dt", -1, NULL, 0); in ti_cpufreq_probe()
547 of_node_put(opp_data->opp_node); in ti_cpufreq_probe()
559 platform_device_register_data(NULL, "ti-cpufreq", -1, match, in ti_cpufreq_init()
569 .name = "ti-cpufreq",
574 MODULE_DESCRIPTION("TI CPUFreq/OPP hw-supported driver");
575 MODULE_AUTHOR("Dave Gerlach <d-gerlach@ti.com>");