coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
vr_config.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 /* VR Settings for each domain */
4 
5 #ifndef _SOC_VR_CONFIG_H_
6 #define _SOC_VR_CONFIG_H_
7 
8 #include <fsp/api.h>
9 
10 struct vr_config {
11 
12  /* The below settings will take effect when this is set to 1
13  * for that domain. */
15 
16  /* Power State X current cutoff in 1/4 Amp increments
17  * Range is 0-128A */
21 
22  /* Enable power state 3/4 for different domains */
25 
26  /* Imon slope correction. Specified in 1/100 increment
27  * values. Range is 0-200. 125 = 1.25 */
29 
30  /* Imon offset correction. Units 1/1000, Range 0-63999
31  * For an offset = 12.580, use 12580. 0 = Auto */
33 
34  /* VR Icc Max limit. 0-255A in 1/4 A units. 400 = 100A */
36 
37  /* VR Voltage Limit. Range is 0-7999mV */
39 
40  /* AC and DC Loadline in 1/100 mOhms. Range is 0-6249 */
43 
44  /* Thermal Design Current (TDC) Power Limit will take effect when
45  this is set to 0 */
47 
48  /* Thermal Design Current (TDC) Power Limit in 1/8 A units */
50 };
51 
52 #define VR_CFG_AMP(i) (uint16_t)((i) * 4)
53 #define VR_CFG_MOHMS(i) (uint16_t)((i) * 100)
54 #define VR_CFG_TDC_AMP(i) (uint16_t)((i) * 8)
55 
56 /* VrConfig Settings for 4 domains
57  * 0 = System Agent, 1 = IA Core,
58  * 2 = GT unsliced, 3 = GT sliced */
59 enum vr_domain {
65 };
66 
67 #define VR_CFG_ALL_DOMAINS_ICC(sa, ia, gt_unsl, gt_sl) \
68  { \
69  [VR_SYSTEM_AGENT] = VR_CFG_AMP(sa), \
70  [VR_IA_CORE] = VR_CFG_AMP(ia), \
71  [VR_GT_UNSLICED] = VR_CFG_AMP(gt_unsl), \
72  [VR_GT_SLICED] = VR_CFG_AMP(gt_sl), \
73  }
74 
75 #define VR_CFG_ALL_DOMAINS_LOADLINE(sa, ia, gt_unsl, gt_sl) \
76  { \
77  [VR_SYSTEM_AGENT] = VR_CFG_MOHMS(sa), \
78  [VR_IA_CORE] = VR_CFG_MOHMS(ia), \
79  [VR_GT_UNSLICED] = VR_CFG_MOHMS(gt_unsl), \
80  [VR_GT_SLICED] = VR_CFG_MOHMS(gt_sl), \
81  }
82 
83 #define VR_CFG_ALL_DOMAINS_TDC(sa, ia, gt_unsl, gt_sl) \
84  { \
85  [VR_SYSTEM_AGENT] = VR_CFG_TDC_AMP(sa), \
86  [VR_IA_CORE] = VR_CFG_TDC_AMP(ia), \
87  [VR_GT_UNSLICED] = VR_CFG_TDC_AMP(gt_unsl), \
88  [VR_GT_SLICED] = VR_CFG_TDC_AMP(gt_sl), \
89  }
90 
91 void fill_vr_domain_config(void *params,
92  int domain, const struct vr_config *cfg);
93 
94 #endif
void fill_vr_domain_config(FSP_S_CONFIG *s_cfg, int domain, const struct vr_config *cfg)
Definition: vr_config.c:113
vr_domain
Definition: vr_config.h:40
@ NUM_VR_DOMAINS
Definition: vr_config.h:43
static struct sdram_info params
Definition: sdram_configs.c:83
@ VR_GT_UNSLICED
Definition: vr_config.h:62
@ VR_GT_SLICED
Definition: vr_config.h:63
@ VR_IA_CORE
Definition: vr_config.h:61
@ VR_SYSTEM_AGENT
Definition: vr_config.h:60
unsigned short uint16_t
Definition: stdint.h:11
unsigned char uint8_t
Definition: stdint.h:8
uint8_t vr_config_enable
Definition: vr_config.h:14
uint16_t psi1threshold
Definition: vr_config.h:18
uint16_t icc_max
Definition: vr_config.h:22
uint8_t imon_slope
Definition: vr_config.h:28
uint8_t tdc_disable
Definition: vr_config.h:46
uint16_t psi3threshold
Definition: vr_config.h:20
uint16_t psi2threshold
Definition: vr_config.h:19
uint8_t psi4enable
Definition: vr_config.h:24
uint16_t ac_loadline
Definition: vr_config.h:17
uint16_t tdc_powerlimit
Definition: vr_config.h:49
uint16_t dc_loadline
Definition: vr_config.h:18
uint8_t imon_offset
Definition: vr_config.h:32
uint16_t voltage_limit
Definition: vr_config.h:38
uint8_t psi3enable
Definition: vr_config.h:23