drivers/soc/samsung/exynos5422-asv.c

Source file repositories/reference/linux-study-clean/drivers/soc/samsung/exynos5422-asv.c

File Facts

System
Linux kernel
Corpus path
drivers/soc/samsung/exynos5422-asv.c
Extension
.c
Size
24423 bytes
Lines
507
Domain
Driver Families
Bucket
drivers/soc
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
 *	      http://www.samsung.com/
 *
 * Samsung Exynos 5422 SoC Adaptive Supply Voltage support
 */

#include <linux/bitrev.h>
#include <linux/errno.h>
#include <linux/regmap.h>
#include <linux/soc/samsung/exynos-chipid.h>
#include <linux/slab.h>

#include "exynos-asv.h"
#include "exynos5422-asv.h"

#define ASV_GROUPS_NUM		14
#define ASV_ARM_DVFS_NUM	20
#define ASV_ARM_BIN2_DVFS_NUM	17
#define ASV_KFC_DVFS_NUM	14
#define ASV_KFC_BIN2_DVFS_NUM	12

/*
 * This array is a set of 4 ASV data tables, first column of each ASV table
 * contains frequency value in MHz and subsequent columns contain the CPU
 * cluster's supply voltage values in uV.
 * In order to create a set of OPPs for specific SoC revision one of the voltage
 * columns (1...14) from one of the tables (0...3) is selected during
 * initialization. There are separate ASV tables for the big (ARM) and little
 * (KFC) CPU cluster. Only OPPs which are already defined in devicetree
 * will be updated.
 */

static const u32 asv_arm_table[][ASV_ARM_DVFS_NUM][ASV_GROUPS_NUM + 1] = {
{
	/* ARM 0, 1 */
	{ 2100,    1362500, 1362500, 1350000, 1337500, 1325000, 1312500, 1300000,
	  1275000, 1262500, 1250000, 1237500, 1225000, 1212500, 1200000 },
	{ 2000,    1312500, 1312500, 1300000, 1287500, 1275000, 1262500, 1250000,
	  1237500, 1225000, 1237500, 1225000, 1212500, 1200000, 1187500 },
	{ 1900,    1250000, 1237500, 1225000, 1212500, 1200000, 1187500, 1175000,
	  1162500, 1150000, 1162500, 1150000, 1137500, 1125000, 1112500 },
	{ 1800,    1200000, 1187500, 1175000, 1162500, 1150000, 1137500, 1125000,
	  1112500, 1100000, 1112500, 1100000, 1087500, 1075000, 1062500 },
	{ 1700,    1162500, 1150000, 1137500, 1125000, 1112500, 1100000, 1087500,
	  1075000, 1062500, 1075000, 1062500, 1050000, 1037500, 1025000 },
	{ 1600,    1125000, 1112500, 1100000, 1087500, 1075000, 1062500, 1050000,
	  1037500, 1025000, 1037500, 1025000, 1012500, 1000000, 987500 },
	{ 1500,    1087500, 1075000, 1062500, 1050000, 1037500, 1025000, 1012500,
	  1000000, 987500,  1000000, 987500,  975000,  962500,  950000 },
	{ 1400,    1062500, 1050000, 1037500, 1025000, 1012500, 1000000, 987500,
	  975000,  962500,  975000,  962500,  950000,  937500,  925000 },
	{ 1300,    1050000, 1037500, 1025000, 1012500, 1000000, 987500,  975000,
	  962500,  950000,  962500,  950000,  937500,  925000,  912500 },
	{ 1200,    1025000, 1012500, 1000000, 987500,  975000,  962500,  950000,
	  937500,  925000,  937500,  925000,  912500,  900000,  900000 },
	{ 1100,    1000000, 987500,  975000,  962500,  950000,  937500,  925000,
	  912500,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 1000,    975000,  962500,  950000,  937500,  925000,  912500,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 900,     950000,  937500,  925000,  912500,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 800,     925000,  912500,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 700,     900000,  900000,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 600,     900000,  900000,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 500,     900000,  900000,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 400,     900000,  900000,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 300,     900000,  900000,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
	{ 200,     900000,  900000,  900000,  900000,  900000,  900000,  900000,
	  900000,  900000,  900000,  900000,  900000,  900000,  900000 },
}, {
	/* ARM 2 */
	{ 2100,    1362500, 1362500, 1350000, 1337500, 1325000, 1312500, 1300000,
	  1275000, 1262500, 1250000, 1237500, 1225000, 1212500, 1200000 },
	{ 2000,    1312500, 1312500, 1312500, 1300000, 1275000, 1262500, 1250000,
	  1237500, 1225000, 1237500, 1225000, 1212500, 1200000, 1187500 },
	{ 1900,    1262500, 1250000, 1250000, 1237500, 1212500, 1200000, 1187500,
	  1175000, 1162500, 1175000, 1162500, 1150000, 1137500, 1125000 },
	{ 1800,    1212500, 1200000, 1187500, 1175000, 1162500, 1150000, 1137500,
	  1125000, 1112500, 1125000, 1112500, 1100000, 1087500, 1075000 },
	{ 1700,    1175000, 1162500, 1150000, 1137500, 1125000, 1112500, 1100000,
	  1087500, 1075000, 1087500, 1075000, 1062500, 1050000, 1037500 },
	{ 1600,    1137500, 1125000, 1112500, 1100000, 1087500, 1075000, 1062500,

Annotation

Implementation Notes