1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef MENDOCINO_CHIP_H
4 #define MENDOCINO_CHIP_H
6 #include <amdblocks/chip.h>
7 #include <amdblocks/i2c.h>
8 #include <amdblocks/pci_clk_req.h>
11 #include <soc/southbridge.h>
12 #include <drivers/i2c/designware/dw_i2c.h>
14 #include <vendorcode/amd/fsp/mendocino/FspUsb.h>
16 /* force USB3 port to gen1, bit0 - controller0 Port0, bit1 - Port1, etc */
17 union __packed usb3_force_gen1
{
19 uint8_t xhci0_port0
:1;
20 uint8_t xhci1_port0
:1;
21 uint8_t xhci1_port1
:1;
23 uint8_t usb3_port_force_gen1_en
;
26 struct soc_amd_mendocino_config
{
27 struct soc_amd_common_config common_config
;
29 struct dw_i2c_bus_config i2c
[I2C_CTRLR_COUNT
];
30 struct i2c_pad_control i2c_pad
[I2C_CTRLR_COUNT
];
32 /* Enable S0iX support */
37 DOWNCORE_1
= 1, /* Run with 1 physical core */
38 DOWNCORE_2
= 3, /* Run with 2 physical cores */
39 DOWNCORE_3
= 4, /* Run with 3 physical cores */
40 DOWNCORE_4
= 6, /* Run with 4 physical cores */
41 DOWNCORE_5
= 8, /* Run with 5 physical cores */
42 DOWNCORE_6
= 9, /* Run with 6 physical cores */
43 DOWNCORE_7
= 10, /* Run with 7 physical cores */
45 bool disable_smt
; /* disable second thread on all physical cores */
48 uint8_t stt_pcb_sensor_count
;
49 uint16_t stt_min_limit
;
59 uint16_t stt_alpha_apu
;
60 uint16_t stt_alpha_gpu
;
61 uint16_t stt_alpha_hs2
;
62 uint16_t stt_skin_temp_apu
;
63 uint16_t stt_skin_temp_gpu
;
64 uint16_t stt_skin_temp_hs2
;
65 uint16_t stt_error_coeff
;
66 uint16_t stt_error_rate_coefficient
;
70 uint32_t stapm_time_constant_s
;
71 uint32_t apu_only_sppt_limit
;
72 uint32_t sustained_power_limit_mW
;
73 uint32_t fast_ppt_limit_mW
;
74 uint32_t slow_ppt_limit_mW
;
75 uint32_t slow_ppt_time_constant_s
;
76 uint32_t thermctl_limit_degreeC
;
77 uint32_t vrm_current_limit_mA
;
78 uint32_t vrm_maximum_current_limit_mA
;
79 uint32_t vrm_soc_current_limit_mA
;
80 /* Throttle (e.g., Low/No Battery) */
81 uint32_t vrm_current_limit_throttle_mA
;
82 uint32_t vrm_maximum_current_limit_throttle_mA
;
83 uint32_t vrm_soc_current_limit_throttle_mA
;
86 uint16_t stt_m1_tablet
;
87 uint16_t stt_m2_tablet
;
88 uint16_t stt_c_apu_tablet
;
89 uint16_t stt_alpha_apu_tablet
;
91 /* Thermal profile B*/
92 uint32_t fast_ppt_limit_mW_B
;
93 uint32_t slow_ppt_limit_mW_B
;
94 uint32_t slow_ppt_time_constant_s_B
;
95 uint16_t stt_min_limit_B
;
99 uint16_t stt_skin_temp_apu_B
;
101 /* Thermal profile C*/
102 uint32_t fast_ppt_limit_mW_C
;
103 uint32_t slow_ppt_limit_mW_C
;
104 uint32_t slow_ppt_time_constant_s_C
;
105 uint16_t stt_min_limit_C
;
108 uint16_t stt_c_apu_C
;
109 uint16_t stt_skin_temp_apu_C
;
111 /* Thermal profile D*/
112 uint32_t fast_ppt_limit_mW_D
;
113 uint32_t slow_ppt_limit_mW_D
;
114 uint32_t slow_ppt_time_constant_s_D
;
115 uint16_t stt_min_limit_D
;
118 uint16_t stt_c_apu_D
;
119 uint16_t stt_skin_temp_apu_D
;
121 /* Thermal profile E*/
122 uint32_t fast_ppt_limit_mW_E
;
123 uint32_t slow_ppt_limit_mW_E
;
124 uint32_t slow_ppt_time_constant_s_E
;
125 uint16_t stt_min_limit_E
;
128 uint16_t stt_c_apu_E
;
129 uint16_t stt_skin_temp_apu_E
;
132 /* Thermal profile F*/
133 uint32_t fast_ppt_limit_mW_F
;
134 uint32_t slow_ppt_limit_mW_F
;
135 uint32_t slow_ppt_time_constant_s_F
;
136 uint16_t stt_min_limit_F
;
139 uint16_t stt_c_apu_F
;
140 uint16_t stt_skin_temp_apu_F
;
142 uint8_t smartshift_enable
;
144 uint8_t system_configuration
;
147 uint8_t cppc_perf_limit_max_range
;
148 uint8_t cppc_perf_limit_min_range
;
149 uint8_t cppc_epp_max_range
;
150 uint8_t cppc_epp_min_range
;
151 uint8_t cppc_preferred_cores
;
153 /* telemetry settings */
154 uint32_t telemetry_vddcrvddfull_scale_current_mA
;
155 uint32_t telemetry_vddcrvddoffset
;
156 uint32_t telemetry_vddcrsocfull_scale_current_mA
;
157 uint32_t telemetry_vddcrsocoffset
;
159 /* The array index is the general purpose PCIe clock output number. Values in here
160 aren't the values written to the register to have the default to be always on. */
161 enum gpp_clk_req gpp_clk_config
[GPP_CLK_OUTPUT_AVAILABLE
];
163 /* performance policy for the PCIe links: power consumption vs. link speed */
165 DXIO_PSPP_DISABLED
= 0,
166 DXIO_PSPP_PERFORMANCE
,
171 uint8_t usb_phy_custom
;
172 struct usb_phy_config usb_phy
;
173 /* Set for PCIe optimization w/a and a double confirming on the result of PCIe Signal
174 Integrity is highly recommended. */
175 uint8_t dxio_tx_vboost_enable
;
177 /* Force USB3 port to gen1, bit0 - controller0 Port0, bit1 - Port1 */
178 union usb3_force_gen1 usb3_port_force_gen1
;
180 /* Set for eDP power sequence adjustment timing T8 (from varybl to blon). */
181 uint8_t edp_panel_t8_ms
;
182 /* Set for eDP power sequence adjustment timing T9 (from bloff to varybloff). */
183 uint8_t edp_panel_t9_ms
;
187 #endif /* MENDOCINO_CHIP_H */