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  /*
13  * The below settings will take effect when this is set to 1
14  * for that domain.
15  */
17 
18  /* Power State X current cutoff in 1/4 Amp increments
19  * Range is 0-128A
20  */
24 
25  /* Enable power state 3/4 for different domains */
28 
29  /*
30  * Imon slope correction. Specified in 1/100 increment
31  * values. Range is 0-200. 125 = 1.25
32  */
34 
35  /*
36  * Imon offset correction. Units 1/4, Range 0-255.
37  * Value of 100 = 100/4 = 25 offset.
38  */
40 
41  /* VR Icc Max limit. 0-255A in 1/4 A units. 400 = 100A */
42  int icc_max;
43 
44  /* VR Voltage Limit. Range is 0-7999mV */
46 
47  /* AC and DC Loadline in 1/100 mOhms. Range is 0-6249 */
50 };
51 
52 #define VR_CFG_AMP(i) ((i) * 4)
53 #define VR_CFG_MOHMS(i) (uint16_t)((i) * 100)
54 
55 /* VrConfig Settings for 4 domains
56  * 0 = System Agent, 1 = IA Core,
57  * 2 = GT unsliced, 3 = GT sliced
58  */
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 void fill_vr_domain_config(void *params,
84  int domain, const struct vr_config *cfg);
85 #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
int psi2threshold
Definition: vr_config.h:22
int ac_loadline
Definition: vr_config.h:48
int vr_config_enable
Definition: vr_config.h:16
int imon_slope
Definition: vr_config.h:33
int dc_loadline
Definition: vr_config.h:49
int psi3threshold
Definition: vr_config.h:23
int icc_max
Definition: vr_config.h:42
int psi3enable
Definition: vr_config.h:26
int imon_offset
Definition: vr_config.h:39
int psi1threshold
Definition: vr_config.h:21
int voltage_limit
Definition: vr_config.h:45
int psi4enable
Definition: vr_config.h:27