aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/include/intelblocks/power_limit.h
blob: 2fa25de5bece438835a95cf5566c6e2795bd1060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-License-Identifier: GPL-2.0-or-later */

#ifndef _SOC_INTEL_COMMON_BLOCK_POWER_LIMIT_H_
#define _SOC_INTEL_COMMON_BLOCK_POWER_LIMIT_H_

#define MCH_PKG_POWER_LIMIT_LO		0x59a0
#define MCH_PKG_POWER_LIMIT_HI		0x59a4
#define MCH_DDR_POWER_LIMIT_LO		0x58e0
#define MCH_DDR_POWER_LIMIT_HI		0x58e4

#define MSR_VR_CURRENT_CONFIG		0x601
#define MSR_PL3_CONTROL			0x615
#define MSR_PLATFORM_POWER_LIMIT	0x65c

/* Default power limit value in secs */
#define MOBILE_SKU_PL1_TIME_SEC		28

struct soc_power_limits_config {
	/* PL1 Override value in Watts */
	uint16_t tdp_pl1_override;
	/* PL2 Override value in Watts */
	uint16_t tdp_pl2_override;
	/* SysPL2 Value in Watts */
	uint16_t tdp_psyspl2;
	/* SysPL3 Value in Watts */
	uint16_t tdp_psyspl3;
	/* SysPL3 window size */
	uint32_t tdp_psyspl3_time;
	/* SysPL3 duty cycle */
	uint32_t tdp_psyspl3_dutycycle;
	/* PL4 Value in Watts */
	uint16_t tdp_pl4;
	/* Estimated maximum platform power in Watts */
	uint16_t psys_pmax;
};

/* Configure power limits for turbo mode */
void set_power_limits(u8 power_limit_1_time,
		struct soc_power_limits_config *config);

#endif /* _SOC_INTEL_COMMON_BLOCK_POWER_LIMIT_H_ */