Lines Matching +full:asv +full:- +full:bin

1 // SPDX-License-Identifier: GPL-2.0
12 #include <linux/soc/samsung/exynos-chipid.h>
15 #include "exynos-asv.h"
16 #include "exynos5422-asv.h"
25 * This array is a set of 4 ASV data tables, first column of each ASV table
30 * initialization. There are separate ASV tables for the big (ARM) and little
163 /* ARM bin 2 */
293 /* KFC bin 2 */
338 static int exynos5422_asv_get_group(struct exynos_asv *asv) in exynos5422_asv_get_group() argument
343 regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PKG_ID, &pkgid_reg); in exynos5422_asv_get_group()
344 regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_AUX_INFO, &auxi_reg); in exynos5422_asv_get_group()
346 if (asv->use_sg) { in exynos5422_asv_get_group()
357 return sga - sgb; in exynos5422_asv_get_group()
389 static void exynos5422_asv_offset_voltage_setup(struct exynos_asv *asv) in exynos5422_asv_offset_voltage_setup() argument
394 regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_AUX_INFO, &reg); in exynos5422_asv_offset_voltage_setup()
397 subsys = &asv->subsys[EXYNOS_ASV_SUBSYS_ID_ARM]; in exynos5422_asv_offset_voltage_setup()
399 subsys->base_volt = 1000000; in exynos5422_asv_offset_voltage_setup()
402 subsys->offset_volt_h = __asv_offset_voltage(value); in exynos5422_asv_offset_voltage_setup()
405 subsys->offset_volt_l = __asv_offset_voltage(value); in exynos5422_asv_offset_voltage_setup()
408 subsys = &asv->subsys[EXYNOS_ASV_SUBSYS_ID_KFC]; in exynos5422_asv_offset_voltage_setup()
410 subsys->base_volt = 1000000; in exynos5422_asv_offset_voltage_setup()
413 subsys->offset_volt_h = __asv_offset_voltage(value); in exynos5422_asv_offset_voltage_setup()
416 subsys->offset_volt_l = __asv_offset_voltage(value); in exynos5422_asv_offset_voltage_setup()
424 if (level >= subsys->table.num_rows) in exynos5422_asv_opp_get_voltage()
428 subsys->asv->group); in exynos5422_asv_opp_get_voltage()
430 if (volt > subsys->base_volt) in exynos5422_asv_opp_get_voltage()
431 asv_volt += subsys->offset_volt_h; in exynos5422_asv_opp_get_voltage()
433 asv_volt += subsys->offset_volt_l; in exynos5422_asv_opp_get_voltage()
453 int exynos5422_asv_init(struct exynos_asv *asv) in exynos5422_asv_init() argument
460 regmap_read(asv->chipid_regmap, EXYNOS_CHIPID_REG_PKG_ID, &pkg_id); in exynos5422_asv_init()
462 if (asv->of_bin == 2) { in exynos5422_asv_init()
464 asv->use_sg = false; in exynos5422_asv_init()
466 asv->use_sg = exynos5422_asv_parse_sg(pkg_id); in exynos5422_asv_init()
470 asv->group = exynos5422_asv_get_group(asv); in exynos5422_asv_init()
471 asv->table = exynos5422_asv_parse_table(pkg_id); in exynos5422_asv_init()
473 exynos5422_asv_offset_voltage_setup(asv); in exynos5422_asv_init()
478 if (asv->table == 2 || asv->table == 3) in exynos5422_asv_init()
479 table_index = asv->table - 1; in exynos5422_asv_init()
484 subsys = &asv->subsys[EXYNOS_ASV_SUBSYS_ID_ARM]; in exynos5422_asv_init()
485 subsys->cpu_dt_compat = "arm,cortex-a15"; in exynos5422_asv_init()
487 subsys->table.num_rows = ASV_ARM_BIN2_DVFS_NUM; in exynos5422_asv_init()
489 subsys->table.num_rows = ASV_ARM_DVFS_NUM; in exynos5422_asv_init()
490 subsys->table.num_cols = ASV_GROUPS_NUM + 1; in exynos5422_asv_init()
491 subsys->table.buf = (u32 *)asv_arm_table[table_index]; in exynos5422_asv_init()
493 subsys = &asv->subsys[EXYNOS_ASV_SUBSYS_ID_KFC]; in exynos5422_asv_init()
494 subsys->cpu_dt_compat = "arm,cortex-a7"; in exynos5422_asv_init()
496 subsys->table.num_rows = ASV_KFC_BIN2_DVFS_NUM; in exynos5422_asv_init()
498 subsys->table.num_rows = ASV_KFC_DVFS_NUM; in exynos5422_asv_init()
499 subsys->table.num_cols = ASV_GROUPS_NUM + 1; in exynos5422_asv_init()
500 subsys->table.buf = (u32 *)asv_kfc_table[table_index]; in exynos5422_asv_init()
502 asv->opp_get_voltage = exynos5422_asv_opp_get_voltage; in exynos5422_asv_init()