History

platform/x86: ISST: Add SST-CP support via TPMI

Intel Speed Select Technology Core Power (SST-CP) is an interface that allows users to define per core priority. This defines a mechanism to distribute power among cores when there is a power constrained scenario. This defines a class of service (CLOS) configuration. Three new IOCTLs are added: ISST_IF_CORE_POWER_STATE : Enable/Disable SST-CP ISST_IF_CLOS_PARAM : Configure CLOS parameters ISST_IF_CLOS_ASSOC : Associate CPUs to a CLOS To associate CPUs to CLOS, either Linux CPU numbering or PUNIT numbering scheme can be used, using parameter punit_cpu_map (1: for PUNIT numbering 0 for Linux CPU number). There is no change to IOCTL to get PUNIT CPU number for a CPU. Introduce get_instance() function, which is used by majority of IOCTLs processing to convert a socket and power domain to tpmi_per_power_domain_info * instance. This instance has all the MMIO offsets stored to read a particular field. Once an instance is identified, read or write from correct MMIO offset for a given field as defined in the specification. For details on SST CP operations using intel-speed-selet utility, refer to: Documentation/admin-guide/pm/intel-speed-select.rst under the kernel documentation

Srinivas Pandruvada committed 3 years ago

Commit 12a7d2c1 parent 0ab147b2 files · +343 −0Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/isst_if.h+79−0
@@ -163,6 +163,82 @@ struct isst_if_msr_cmds { · 162 unmodified lines
163 struct isst_if_msr_cmd msr_cmd[1];163 struct isst_if_msr_cmd msr_cmd[1];
164};164};
165 165
166/**
167 * struct isst_core_power - Structure to get/set core_power feature
168 * @get_set: 0: Get, 1: Set
169 * @socket_id: Socket/package id
170 * @power_domain: Power Domain id
171 * @enable: Feature enable status
172 * @priority_type: Priority type for the feature (ordered/proportional)
173 *
174 * Structure to get/set core_power feature state using IOCTL
175 * ISST_IF_CORE_POWER_STATE.
176 */
177struct isst_core_power {
178 __u8 get_set;
179 __u8 socket_id;
180 __u8 power_domain_id;
181 __u8 enable;
182 __u8 supported;
183 __u8 priority_type;
184};
185
186/**
187 * struct isst_clos_param - Structure to get/set clos praram
188 * @get_set: 0: Get, 1: Set
189 * @socket_id: Socket/package id
190 * @power_domain: Power Domain id
191 * clos: Clos ID for the parameters
192 * min_freq_mhz: Minimum frequency in MHz
193 * max_freq_mhz: Maximum frequency in MHz
194 * prop_prio: Proportional priority from 0-15
195 *
196 * Structure to get/set per clos property using IOCTL
197 * ISST_IF_CLOS_PARAM.
198 */
199struct isst_clos_param {
200 __u8 get_set;
201 __u8 socket_id;
202 __u8 power_domain_id;
203 __u8 clos;
204 __u16 min_freq_mhz;
205 __u16 max_freq_mhz;
206 __u8 prop_prio;
207};
208
209/**
210 * struct isst_if_clos_assoc - Structure to assign clos to a CPU
211 * @socket_id: Socket/package id
212 * @power_domain: Power Domain id
213 * @logical_cpu: CPU number
214 * @clos: Clos ID to assign to the logical CPU
215 *
216 * Structure to get/set core_power feature.
217 */
218struct isst_if_clos_assoc {
219 __u8 socket_id;
220 __u8 power_domain_id;
221 __u16 logical_cpu;
222 __u16 clos;
223};
224
225/**
226 * struct isst_if_clos_assoc_cmds - Structure to assign clos to CPUs
227 * @cmd_count: Number of cmds (cpus) in this request
228 * @get_set: Request is for get or set
229 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not
230 * Linux CPU number
231 *
232 * Structure used to get/set associate CPUs to clos using IOCTL
233 * ISST_IF_CLOS_ASSOC.
234 */
235struct isst_if_clos_assoc_cmds {
236 __u16 cmd_count;
237 __u16 get_set;
238 __u16 punit_cpu_map;
239 struct isst_if_clos_assoc assoc_info[1];
240};
241
166/**242/**
167 * struct isst_tpmi_instance_count - Get number of TPMI instances per socket243 * struct isst_tpmi_instance_count - Get number of TPMI instances per socket
168 * @socket_id: Socket/package id244 * @socket_id: Socket/package id
@@ -186,5 +262,8 @@ struct isst_tpmi_instance_count { · 17 unmodified lines
186#define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *)262#define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *)
187 263
188#define ISST_IF_COUNT_TPMI_INSTANCES _IOR(ISST_IF_MAGIC, 5, struct isst_tpmi_instance_count *)264#define ISST_IF_COUNT_TPMI_INSTANCES _IOR(ISST_IF_MAGIC, 5, struct isst_tpmi_instance_count *)
265#define ISST_IF_CORE_POWER_STATE _IOWR(ISST_IF_MAGIC, 6, struct isst_core_power *)
266#define ISST_IF_CLOS_PARAM _IOWR(ISST_IF_MAGIC, 7, struct isst_clos_param *)
267#define ISST_IF_CLOS_ASSOC _IOWR(ISST_IF_MAGIC, 8, struct isst_if_clos_assoc_cmds *)
189 268
190#endif269#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t