1 /* 2 * This file is auto-generated. Modifications will be lost. 3 * 4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ 5 * for more information. 6 */ 7 #ifndef _UAPI_ASM_X86_AMD_HSMP_H_ 8 #define _UAPI_ASM_X86_AMD_HSMP_H_ 9 #include <linux/types.h> 10 #pragma pack(4) 11 #define HSMP_MAX_MSG_LEN 8 12 enum hsmp_message_ids { 13 HSMP_TEST = 1, 14 HSMP_GET_SMU_VER, 15 HSMP_GET_PROTO_VER, 16 HSMP_GET_SOCKET_POWER, 17 HSMP_SET_SOCKET_POWER_LIMIT, 18 HSMP_GET_SOCKET_POWER_LIMIT, 19 HSMP_GET_SOCKET_POWER_LIMIT_MAX, 20 HSMP_SET_BOOST_LIMIT, 21 HSMP_SET_BOOST_LIMIT_SOCKET, 22 HSMP_GET_BOOST_LIMIT, 23 HSMP_GET_PROC_HOT, 24 HSMP_SET_XGMI_LINK_WIDTH, 25 HSMP_SET_DF_PSTATE, 26 HSMP_SET_AUTO_DF_PSTATE, 27 HSMP_GET_FCLK_MCLK, 28 HSMP_GET_CCLK_THROTTLE_LIMIT, 29 HSMP_GET_C0_PERCENT, 30 HSMP_SET_NBIO_DPM_LEVEL, 31 HSMP_GET_NBIO_DPM_LEVEL, 32 HSMP_GET_DDR_BANDWIDTH, 33 HSMP_GET_TEMP_MONITOR, 34 HSMP_GET_DIMM_TEMP_RANGE, 35 HSMP_GET_DIMM_POWER, 36 HSMP_GET_DIMM_THERMAL, 37 HSMP_GET_SOCKET_FREQ_LIMIT, 38 HSMP_GET_CCLK_CORE_LIMIT, 39 HSMP_GET_RAILS_SVI, 40 HSMP_GET_SOCKET_FMAX_FMIN, 41 HSMP_GET_IOLINK_BANDWITH, 42 HSMP_GET_XGMI_BANDWITH, 43 HSMP_SET_GMI3_WIDTH, 44 HSMP_SET_PCI_RATE, 45 HSMP_SET_POWER_MODE, 46 HSMP_SET_PSTATE_MAX_MIN, 47 HSMP_GET_METRIC_TABLE_VER, 48 HSMP_GET_METRIC_TABLE, 49 HSMP_GET_METRIC_TABLE_DRAM_ADDR, 50 HSMP_MSG_ID_MAX, 51 }; 52 struct hsmp_message { 53 __u32 msg_id; 54 __u16 num_args; 55 __u16 response_sz; 56 __u32 args[HSMP_MAX_MSG_LEN]; 57 __u16 sock_ind; 58 }; 59 enum hsmp_msg_type { 60 HSMP_RSVD = - 1, 61 HSMP_SET = 0, 62 HSMP_GET = 1, 63 }; 64 enum hsmp_proto_versions { 65 HSMP_PROTO_VER2 = 2, 66 HSMP_PROTO_VER3, 67 HSMP_PROTO_VER4, 68 HSMP_PROTO_VER5, 69 HSMP_PROTO_VER6 70 }; 71 struct hsmp_msg_desc { 72 int num_args; 73 int response_sz; 74 enum hsmp_msg_type type; 75 }; 76 static const struct hsmp_msg_desc hsmp_msg_desc_table[] = { 77 { 78 0, 0, HSMP_RSVD 79 } 80 , { 81 1, 1, HSMP_GET 82 } 83 , { 84 0, 1, HSMP_GET 85 } 86 , { 87 0, 1, HSMP_GET 88 } 89 , { 90 0, 1, HSMP_GET 91 } 92 , { 93 1, 0, HSMP_SET 94 } 95 , { 96 0, 1, HSMP_GET 97 } 98 , { 99 0, 1, HSMP_GET 100 } 101 , { 102 1, 0, HSMP_SET 103 } 104 , { 105 1, 0, HSMP_SET 106 } 107 , { 108 1, 1, HSMP_GET 109 } 110 , { 111 0, 1, HSMP_GET 112 } 113 , { 114 1, 0, HSMP_SET 115 } 116 , { 117 1, 0, HSMP_SET 118 } 119 , { 120 0, 0, HSMP_SET 121 } 122 , { 123 0, 2, HSMP_GET 124 } 125 , { 126 0, 1, HSMP_GET 127 } 128 , { 129 0, 1, HSMP_GET 130 } 131 , { 132 1, 0, HSMP_SET 133 } 134 , { 135 1, 1, HSMP_GET 136 } 137 , { 138 0, 1, HSMP_GET 139 } 140 , { 141 0, 1, HSMP_GET 142 } 143 , { 144 1, 1, HSMP_GET 145 } 146 , { 147 1, 1, HSMP_GET 148 } 149 , { 150 1, 1, HSMP_GET 151 } 152 , { 153 0, 1, HSMP_GET 154 } 155 , { 156 1, 1, HSMP_GET 157 } 158 , { 159 0, 1, HSMP_GET 160 } 161 , { 162 0, 1, HSMP_GET 163 } 164 , { 165 1, 1, HSMP_GET 166 } 167 , { 168 1, 1, HSMP_GET 169 } 170 , { 171 1, 0, HSMP_SET 172 } 173 , { 174 1, 1, HSMP_SET 175 } 176 , { 177 1, 0, HSMP_SET 178 } 179 , { 180 1, 0, HSMP_SET 181 } 182 , { 183 0, 1, HSMP_GET 184 } 185 , { 186 0, 0, HSMP_GET 187 } 188 , { 189 0, 2, HSMP_GET 190 } 191 , 192 }; 193 struct hsmp_metric_table { 194 __u32 accumulation_counter; 195 __u32 max_socket_temperature; 196 __u32 max_vr_temperature; 197 __u32 max_hbm_temperature; 198 __u64 max_socket_temperature_acc; 199 __u64 max_vr_temperature_acc; 200 __u64 max_hbm_temperature_acc; 201 __u32 socket_power_limit; 202 __u32 max_socket_power_limit; 203 __u32 socket_power; 204 __u64 timestamp; 205 __u64 socket_energy_acc; 206 __u64 ccd_energy_acc; 207 __u64 xcd_energy_acc; 208 __u64 aid_energy_acc; 209 __u64 hbm_energy_acc; 210 __u32 cclk_frequency_limit; 211 __u32 gfxclk_frequency_limit; 212 __u32 fclk_frequency; 213 __u32 uclk_frequency; 214 __u32 socclk_frequency[4]; 215 __u32 vclk_frequency[4]; 216 __u32 dclk_frequency[4]; 217 __u32 lclk_frequency[4]; 218 __u64 gfxclk_frequency_acc[8]; 219 __u64 cclk_frequency_acc[96]; 220 __u32 max_cclk_frequency; 221 __u32 min_cclk_frequency; 222 __u32 max_gfxclk_frequency; 223 __u32 min_gfxclk_frequency; 224 __u32 fclk_frequency_table[4]; 225 __u32 uclk_frequency_table[4]; 226 __u32 socclk_frequency_table[4]; 227 __u32 vclk_frequency_table[4]; 228 __u32 dclk_frequency_table[4]; 229 __u32 lclk_frequency_table[4]; 230 __u32 max_lclk_dpm_range; 231 __u32 min_lclk_dpm_range; 232 __u32 xgmi_width; 233 __u32 xgmi_bitrate; 234 __u64 xgmi_read_bandwidth_acc[8]; 235 __u64 xgmi_write_bandwidth_acc[8]; 236 __u32 socket_c0_residency; 237 __u32 socket_gfx_busy; 238 __u32 dram_bandwidth_utilization; 239 __u64 socket_c0_residency_acc; 240 __u64 socket_gfx_busy_acc; 241 __u64 dram_bandwidth_acc; 242 __u32 max_dram_bandwidth; 243 __u64 dram_bandwidth_utilization_acc; 244 __u64 pcie_bandwidth_acc[4]; 245 __u32 prochot_residency_acc; 246 __u32 ppt_residency_acc; 247 __u32 socket_thm_residency_acc; 248 __u32 vr_thm_residency_acc; 249 __u32 hbm_thm_residency_acc; 250 __u32 spare; 251 __u32 gfxclk_frequency[8]; 252 }; 253 #pragma pack() 254 #define HSMP_BASE_IOCTL_NR 0xF8 255 #define HSMP_IOCTL_CMD _IOWR(HSMP_BASE_IOCTL_NR, 0, struct hsmp_message) 256 #endif 257