Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | /* TODO: Check if this is still correct */ |
| 4 | |
Jon Murphy | 4f73242 | 2022-08-05 15:43:44 -0600 | [diff] [blame] | 5 | #ifndef MENDOCINO_CHIP_H |
| 6 | #define MENDOCINO_CHIP_H |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 7 | |
| 8 | #include <amdblocks/chip.h> |
Felix Held | 556d1cc | 2022-02-02 22:11:52 +0100 | [diff] [blame] | 9 | #include <amdblocks/i2c.h> |
Robert Zieba | b3b27f7 | 2022-10-03 14:50:55 -0600 | [diff] [blame] | 10 | #include <amdblocks/pci_clk_req.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 11 | #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 Murphy | 4f73242 | 2022-08-05 15:43:44 -0600 | [diff] [blame] | 16 | #include <vendorcode/amd/fsp/mendocino/FspUsb.h> |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 17 | |
Jon Murphy | 4f73242 | 2022-08-05 15:43:44 -0600 | [diff] [blame] | 18 | struct soc_amd_mendocino_config { |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 19 | struct soc_amd_common_config common_config; |
| 20 | u8 i2c_scl_reset; |
| 21 | struct dw_i2c_bus_config i2c[I2C_CTRLR_COUNT]; |
Felix Held | 556d1cc | 2022-02-02 22:11:52 +0100 | [diff] [blame] | 22 | struct i2c_pad_control i2c_pad[I2C_CTRLR_COUNT]; |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 23 | |
| 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 Patten | b06873f | 2022-09-06 09:56:52 -0600 | [diff] [blame] | 60 | /* Default */ |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 61 | 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 Patten | b06873f | 2022-09-06 09:56:52 -0600 | [diff] [blame] | 69 | uint32_t vrm_current_limit_mA; |
| 70 | uint32_t vrm_maximum_current_limit_mA; |
| 71 | uint32_t vrm_soc_current_limit_mA; |
Tim Van Patten | 1cf0acd | 2022-09-15 17:15:56 -0600 | [diff] [blame] | 72 | /* 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 Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 76 | |
Chris.Wang | 9ac0984 | 2022-12-13 14:31:38 +0800 | [diff] [blame] | 77 | /* tablet mode.*/ |
| 78 | uint32_t sustained_power_limit_mW_tablet; |
| 79 | |
EricKY Cheng | f7a0927 | 2022-10-17 13:10:50 +0800 | [diff] [blame] | 80 | /* 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 Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 136 | uint8_t smartshift_enable; |
| 137 | |
| 138 | uint8_t system_configuration; |
| 139 | |
Felix Held | 665476d | 2022-08-03 22:18:18 +0200 | [diff] [blame] | 140 | 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 Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 147 | /* 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 Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 153 | /* 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 Zieba | b3b27f7 | 2022-10-03 14:50:55 -0600 | [diff] [blame] | 155 | enum gpp_clk_req gpp_clk_config[GPP_CLK_OUTPUT_AVAILABLE]; |
Felix Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 156 | |
| 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.Wang | ad12b4f | 2022-12-28 17:07:48 +0800 | [diff] [blame^] | 167 | /* 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 Held | 3c44c62 | 2022-01-10 20:57:29 +0100 | [diff] [blame] | 170 | }; |
| 171 | |
Jon Murphy | 4f73242 | 2022-08-05 15:43:44 -0600 | [diff] [blame] | 172 | #endif /* MENDOCINO_CHIP_H */ |