blob: cf31cd7a30a477b7632eb8710770cd3c7638242b [file] [log] [blame]
Felix Held3c44c622022-01-10 20:57:29 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3/* TODO: Check if this is still correct */
4
Jon Murphy4f732422022-08-05 15:43:44 -06005#ifndef MENDOCINO_CHIP_H
6#define MENDOCINO_CHIP_H
Felix Held3c44c622022-01-10 20:57:29 +01007
8#include <amdblocks/chip.h>
Felix Held556d1cc2022-02-02 22:11:52 +01009#include <amdblocks/i2c.h>
Robert Ziebab3b27f72022-10-03 14:50:55 -060010#include <amdblocks/pci_clk_req.h>
Felix Held3c44c622022-01-10 20:57:29 +010011#include <gpio.h>
12#include <soc/i2c.h>
13#include <soc/southbridge.h>
14#include <drivers/i2c/designware/dw_i2c.h>
15#include <types.h>
Jon Murphy4f732422022-08-05 15:43:44 -060016#include <vendorcode/amd/fsp/mendocino/FspUsb.h>
Felix Held3c44c622022-01-10 20:57:29 +010017
Jon Murphy4f732422022-08-05 15:43:44 -060018struct soc_amd_mendocino_config {
Felix Held3c44c622022-01-10 20:57:29 +010019 struct soc_amd_common_config common_config;
20 u8 i2c_scl_reset;
21 struct dw_i2c_bus_config i2c[I2C_CTRLR_COUNT];
Felix Held556d1cc2022-02-02 22:11:52 +010022 struct i2c_pad_control i2c_pad[I2C_CTRLR_COUNT];
Felix Held3c44c622022-01-10 20:57:29 +010023
24 /* Enable S0iX support */
25 bool s0ix_enable;
26
27 enum {
28 DOWNCORE_AUTO = 0,
29 DOWNCORE_1 = 1, /* Run with 1 physical core */
30 DOWNCORE_2 = 3, /* Run with 2 physical cores */
31 DOWNCORE_3 = 4, /* Run with 3 physical cores */
32 DOWNCORE_4 = 6, /* Run with 4 physical cores */
33 DOWNCORE_5 = 8, /* Run with 5 physical cores */
34 DOWNCORE_6 = 9, /* Run with 6 physical cores */
35 DOWNCORE_7 = 10, /* Run with 7 physical cores */
36 } downcore_mode;
37 bool disable_smt; /* disable second thread on all physical cores */
38
39 uint8_t stt_control;
40 uint8_t stt_pcb_sensor_count;
41 uint16_t stt_min_limit;
42 uint16_t stt_m1;
43 uint16_t stt_m2;
44 uint16_t stt_m3;
45 uint16_t stt_m4;
46 uint16_t stt_m5;
47 uint16_t stt_m6;
48 uint16_t stt_c_apu;
49 uint16_t stt_c_gpu;
50 uint16_t stt_c_hs2;
51 uint16_t stt_alpha_apu;
52 uint16_t stt_alpha_gpu;
53 uint16_t stt_alpha_hs2;
54 uint16_t stt_skin_temp_apu;
55 uint16_t stt_skin_temp_gpu;
56 uint16_t stt_skin_temp_hs2;
57 uint16_t stt_error_coeff;
58 uint16_t stt_error_rate_coefficient;
59
Tim Van Pattenb06873f2022-09-06 09:56:52 -060060 /* Default */
Felix Held3c44c622022-01-10 20:57:29 +010061 uint8_t stapm_boost;
62 uint32_t stapm_time_constant_s;
63 uint32_t apu_only_sppt_limit;
64 uint32_t sustained_power_limit_mW;
65 uint32_t fast_ppt_limit_mW;
66 uint32_t slow_ppt_limit_mW;
67 uint32_t slow_ppt_time_constant_s;
68 uint32_t thermctl_limit_degreeC;
Tim Van Pattenb06873f2022-09-06 09:56:52 -060069 uint32_t vrm_current_limit_mA;
70 uint32_t vrm_maximum_current_limit_mA;
71 uint32_t vrm_soc_current_limit_mA;
Tim Van Patten1cf0acd2022-09-15 17:15:56 -060072 /* Throttle (e.g., Low/No Battery) */
73 uint32_t vrm_current_limit_throttle_mA;
74 uint32_t vrm_maximum_current_limit_throttle_mA;
75 uint32_t vrm_soc_current_limit_throttle_mA;
Felix Held3c44c622022-01-10 20:57:29 +010076
Chris.Wang9ac09842022-12-13 14:31:38 +080077 /* tablet mode.*/
78 uint32_t sustained_power_limit_mW_tablet;
79
EricKY Chengf7a09272022-10-17 13:10:50 +080080 /* Thermal profile B*/
81 uint32_t fast_ppt_limit_mW_B;
82 uint32_t slow_ppt_limit_mW_B;
83 uint32_t slow_ppt_time_constant_s_B;
84 uint32_t sustained_power_limit_mW_B;
85 uint16_t stt_min_limit_B;
86 uint16_t stt_m1_B;
87 uint16_t stt_m2_B;
88 uint16_t stt_c_apu_B;
89 uint16_t stt_skin_temp_apu_B;
90
91 /* Thermal profile C*/
92 uint32_t fast_ppt_limit_mW_C;
93 uint32_t slow_ppt_limit_mW_C;
94 uint32_t slow_ppt_time_constant_s_C;
95 uint32_t sustained_power_limit_mW_C;
96 uint16_t stt_min_limit_C;
97 uint16_t stt_m1_C;
98 uint16_t stt_m2_C;
99 uint16_t stt_c_apu_C;
100 uint16_t stt_skin_temp_apu_C;
101
102 /* Thermal profile D*/
103 uint32_t fast_ppt_limit_mW_D;
104 uint32_t slow_ppt_limit_mW_D;
105 uint32_t slow_ppt_time_constant_s_D;
106 uint32_t sustained_power_limit_mW_D;
107 uint16_t stt_min_limit_D;
108 uint16_t stt_m1_D;
109 uint16_t stt_m2_D;
110 uint16_t stt_c_apu_D;
111 uint16_t stt_skin_temp_apu_D;
112
113 /* Thermal profile E*/
114 uint32_t fast_ppt_limit_mW_E;
115 uint32_t slow_ppt_limit_mW_E;
116 uint32_t slow_ppt_time_constant_s_E;
117 uint32_t sustained_power_limit_mW_E;
118 uint16_t stt_min_limit_E;
119 uint16_t stt_m1_E;
120 uint16_t stt_m2_E;
121 uint16_t stt_c_apu_E;
122 uint16_t stt_skin_temp_apu_E;
123
124
125 /* Thermal profile F*/
126 uint32_t fast_ppt_limit_mW_F;
127 uint32_t slow_ppt_limit_mW_F;
128 uint32_t slow_ppt_time_constant_s_F;
129 uint32_t sustained_power_limit_mW_F;
130 uint16_t stt_min_limit_F;
131 uint16_t stt_m1_F;
132 uint16_t stt_m2_F;
133 uint16_t stt_c_apu_F;
134 uint16_t stt_skin_temp_apu_F;
135
Felix Held3c44c622022-01-10 20:57:29 +0100136 uint8_t smartshift_enable;
137
138 uint8_t system_configuration;
139
Felix Held665476d2022-08-03 22:18:18 +0200140 uint8_t cppc_ctrl;
141 uint8_t cppc_perf_limit_max_range;
142 uint8_t cppc_perf_limit_min_range;
143 uint8_t cppc_epp_max_range;
144 uint8_t cppc_epp_min_range;
145 uint8_t cppc_preferred_cores;
146
Felix Held3c44c622022-01-10 20:57:29 +0100147 /* telemetry settings */
148 uint32_t telemetry_vddcrvddfull_scale_current_mA;
149 uint32_t telemetry_vddcrvddoffset;
150 uint32_t telemetry_vddcrsocfull_scale_current_mA;
151 uint32_t telemetry_vddcrsocoffset;
152
Felix Held3c44c622022-01-10 20:57:29 +0100153 /* The array index is the general purpose PCIe clock output number. Values in here
154 aren't the values written to the register to have the default to be always on. */
Robert Ziebab3b27f72022-10-03 14:50:55 -0600155 enum gpp_clk_req gpp_clk_config[GPP_CLK_OUTPUT_AVAILABLE];
Felix Held3c44c622022-01-10 20:57:29 +0100156
157 /* performance policy for the PCIe links: power consumption vs. link speed */
158 enum {
159 DXIO_PSPP_DISABLED = 0,
160 DXIO_PSPP_PERFORMANCE,
161 DXIO_PSPP_BALANCED,
162 DXIO_PSPP_POWERSAVE,
163 } pspp_policy;
164
165 uint8_t usb_phy_custom;
166 struct usb_phy_config usb_phy;
Chris.Wangad12b4f2022-12-28 17:07:48 +0800167 /* Set for PCIe optimization w/a and a double confirming on the result of PCIe Signal
168 Integrity is highly recommended. */
169 uint8_t dxio_tx_vboost_enable;
Felix Held3c44c622022-01-10 20:57:29 +0100170};
171
Jon Murphy4f732422022-08-05 15:43:44 -0600172#endif /* MENDOCINO_CHIP_H */