Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef __ISST_IF_H |
| 20 | #define __ISST_IF_H |
| 21 | #include <linux/types.h> |
| 22 | struct isst_if_platform_info { |
| 23 | __u16 api_version; |
| 24 | __u16 driver_version; |
| 25 | __u16 max_cmds_per_ioctl; |
| 26 | __u8 mbox_supported; |
| 27 | __u8 mmio_supported; |
| 28 | }; |
| 29 | struct isst_if_cpu_map { |
| 30 | __u32 logical_cpu; |
| 31 | __u32 physical_cpu; |
| 32 | }; |
| 33 | struct isst_if_cpu_maps { |
| 34 | __u32 cmd_count; |
| 35 | struct isst_if_cpu_map cpu_map[1]; |
| 36 | }; |
| 37 | struct isst_if_io_reg { |
| 38 | __u32 read_write; |
| 39 | __u32 logical_cpu; |
| 40 | __u32 reg; |
| 41 | __u32 value; |
| 42 | }; |
| 43 | struct isst_if_io_regs { |
| 44 | __u32 req_count; |
| 45 | struct isst_if_io_reg io_reg[1]; |
| 46 | }; |
| 47 | struct isst_if_mbox_cmd { |
| 48 | __u32 logical_cpu; |
| 49 | __u32 parameter; |
| 50 | __u32 req_data; |
| 51 | __u32 resp_data; |
| 52 | __u16 command; |
| 53 | __u16 sub_command; |
| 54 | __u32 reserved; |
| 55 | }; |
| 56 | struct isst_if_mbox_cmds { |
| 57 | __u32 cmd_count; |
| 58 | struct isst_if_mbox_cmd mbox_cmd[1]; |
| 59 | }; |
| 60 | struct isst_if_msr_cmd { |
| 61 | __u32 read_write; |
| 62 | __u32 logical_cpu; |
| 63 | __u64 msr; |
| 64 | __u64 data; |
| 65 | }; |
| 66 | struct isst_if_msr_cmds { |
| 67 | __u32 cmd_count; |
| 68 | struct isst_if_msr_cmd msr_cmd[1]; |
| 69 | }; |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame^] | 70 | struct isst_core_power { |
| 71 | __u8 get_set; |
| 72 | __u8 socket_id; |
| 73 | __u8 power_domain_id; |
| 74 | __u8 enable; |
| 75 | __u8 supported; |
| 76 | __u8 priority_type; |
| 77 | }; |
| 78 | struct isst_clos_param { |
| 79 | __u8 get_set; |
| 80 | __u8 socket_id; |
| 81 | __u8 power_domain_id; |
| 82 | __u8 clos; |
| 83 | __u16 min_freq_mhz; |
| 84 | __u16 max_freq_mhz; |
| 85 | __u8 prop_prio; |
| 86 | }; |
| 87 | struct isst_if_clos_assoc { |
| 88 | __u8 socket_id; |
| 89 | __u8 power_domain_id; |
| 90 | __u16 logical_cpu; |
| 91 | __u16 clos; |
| 92 | }; |
| 93 | struct isst_if_clos_assoc_cmds { |
| 94 | __u16 cmd_count; |
| 95 | __u16 get_set; |
| 96 | __u16 punit_cpu_map; |
| 97 | struct isst_if_clos_assoc assoc_info[1]; |
| 98 | }; |
| 99 | struct isst_tpmi_instance_count { |
| 100 | __u8 socket_id; |
| 101 | __u8 count; |
| 102 | __u16 valid_mask; |
| 103 | }; |
| 104 | struct isst_perf_level_info { |
| 105 | __u8 socket_id; |
| 106 | __u8 power_domain_id; |
| 107 | __u8 max_level; |
| 108 | __u8 feature_rev; |
| 109 | __u8 level_mask; |
| 110 | __u8 current_level; |
| 111 | __u8 feature_state; |
| 112 | __u8 locked; |
| 113 | __u8 enabled; |
| 114 | __u8 sst_tf_support; |
| 115 | __u8 sst_bf_support; |
| 116 | }; |
| 117 | struct isst_perf_level_control { |
| 118 | __u8 socket_id; |
| 119 | __u8 power_domain_id; |
| 120 | __u8 level; |
| 121 | }; |
| 122 | struct isst_perf_feature_control { |
| 123 | __u8 socket_id; |
| 124 | __u8 power_domain_id; |
| 125 | __u8 feature; |
| 126 | }; |
| 127 | #define TRL_MAX_BUCKETS 8 |
| 128 | #define TRL_MAX_LEVELS 6 |
| 129 | struct isst_perf_level_data_info { |
| 130 | __u8 socket_id; |
| 131 | __u8 power_domain_id; |
| 132 | __u16 level; |
| 133 | __u16 tdp_ratio; |
| 134 | __u16 base_freq_mhz; |
| 135 | __u16 base_freq_avx2_mhz; |
| 136 | __u16 base_freq_avx512_mhz; |
| 137 | __u16 base_freq_amx_mhz; |
| 138 | __u16 thermal_design_power_w; |
| 139 | __u16 tjunction_max_c; |
| 140 | __u16 max_memory_freq_mhz; |
| 141 | __u16 cooling_type; |
| 142 | __u16 p0_freq_mhz; |
| 143 | __u16 p1_freq_mhz; |
| 144 | __u16 pn_freq_mhz; |
| 145 | __u16 pm_freq_mhz; |
| 146 | __u16 p0_fabric_freq_mhz; |
| 147 | __u16 p1_fabric_freq_mhz; |
| 148 | __u16 pn_fabric_freq_mhz; |
| 149 | __u16 pm_fabric_freq_mhz; |
| 150 | __u16 max_buckets; |
| 151 | __u16 max_trl_levels; |
| 152 | __u16 bucket_core_counts[TRL_MAX_BUCKETS]; |
| 153 | __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]; |
| 154 | }; |
| 155 | struct isst_perf_level_cpu_mask { |
| 156 | __u8 socket_id; |
| 157 | __u8 power_domain_id; |
| 158 | __u8 level; |
| 159 | __u8 punit_cpu_map; |
| 160 | __u64 mask; |
| 161 | __u16 cpu_buffer_size; |
| 162 | __s8 cpu_buffer[1]; |
| 163 | }; |
| 164 | struct isst_base_freq_info { |
| 165 | __u8 socket_id; |
| 166 | __u8 power_domain_id; |
| 167 | __u16 level; |
| 168 | __u16 high_base_freq_mhz; |
| 169 | __u16 low_base_freq_mhz; |
| 170 | __u16 tjunction_max_c; |
| 171 | __u16 thermal_design_power_w; |
| 172 | }; |
| 173 | struct isst_turbo_freq_info { |
| 174 | __u8 socket_id; |
| 175 | __u8 power_domain_id; |
| 176 | __u16 level; |
| 177 | __u16 max_clip_freqs; |
| 178 | __u16 max_buckets; |
| 179 | __u16 max_trl_levels; |
| 180 | __u16 lp_clip_freq_mhz[TRL_MAX_LEVELS]; |
| 181 | __u16 bucket_core_counts[TRL_MAX_BUCKETS]; |
| 182 | __u16 trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]; |
| 183 | }; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 184 | #define ISST_IF_MAGIC 0xFE |
| 185 | #define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *) |
| 186 | #define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *) |
| 187 | #define ISST_IF_IO_CMD _IOW(ISST_IF_MAGIC, 2, struct isst_if_io_regs *) |
| 188 | #define ISST_IF_MBOX_COMMAND _IOWR(ISST_IF_MAGIC, 3, struct isst_if_mbox_cmds *) |
| 189 | #define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *) |
Christopher Ferris | 37c3f3c | 2023-07-10 10:59:05 -0700 | [diff] [blame^] | 190 | #define ISST_IF_COUNT_TPMI_INSTANCES _IOR(ISST_IF_MAGIC, 5, struct isst_tpmi_instance_count *) |
| 191 | #define ISST_IF_CORE_POWER_STATE _IOWR(ISST_IF_MAGIC, 6, struct isst_core_power *) |
| 192 | #define ISST_IF_CLOS_PARAM _IOWR(ISST_IF_MAGIC, 7, struct isst_clos_param *) |
| 193 | #define ISST_IF_CLOS_ASSOC _IOWR(ISST_IF_MAGIC, 8, struct isst_if_clos_assoc_cmds *) |
| 194 | #define ISST_IF_PERF_LEVELS _IOWR(ISST_IF_MAGIC, 9, struct isst_perf_level_info *) |
| 195 | #define ISST_IF_PERF_SET_LEVEL _IOW(ISST_IF_MAGIC, 10, struct isst_perf_level_control *) |
| 196 | #define ISST_IF_PERF_SET_FEATURE _IOW(ISST_IF_MAGIC, 11, struct isst_perf_feature_control *) |
| 197 | #define ISST_IF_GET_PERF_LEVEL_INFO _IOR(ISST_IF_MAGIC, 12, struct isst_perf_level_data_info *) |
| 198 | #define ISST_IF_GET_PERF_LEVEL_CPU_MASK _IOR(ISST_IF_MAGIC, 13, struct isst_perf_level_cpu_mask *) |
| 199 | #define ISST_IF_GET_BASE_FREQ_INFO _IOR(ISST_IF_MAGIC, 14, struct isst_base_freq_info *) |
| 200 | #define ISST_IF_GET_BASE_FREQ_CPU_MASK _IOR(ISST_IF_MAGIC, 15, struct isst_perf_level_cpu_mask *) |
| 201 | #define ISST_IF_GET_TURBO_FREQ_INFO _IOR(ISST_IF_MAGIC, 16, struct isst_turbo_freq_info *) |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 202 | #endif |