summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-24 15:39:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-24 15:39:40 -0400
commitbaff384b0e90132be4b623a9406ba84a987ed036 (patch)
tree34445d0c0818f171f5d161b34cca4d5eea6c68b2
parentaf5a7e99cce2a24e98487e70f99c8716643cc445 (diff)
parent24a8d78a9affb63e5ced313ccde6888fe96edc6e (diff)
Merge tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86
Pull x86 platform-drivers fixes from Andy Shevchenko: - Fix compilation error of ASUS WMI driver when CONFIG_ACPI_BATTERY=n - Fix I²C multi-instantiate driver to work with several USB PD devices - Fix boot issue on Siemens SIMATIC IPC277E when PMC critical clock is being disabled - Plenty of fixes to Intel Speed-Select Technology tools * tag 'platform-drivers-x86-v5.4-2' of git://git.infradead.org/linux-platform-drivers-x86: platform/x86: i2c-multi-instantiate: Derive the device name from parent platform/x86: pmc_atom: Add Siemens SIMATIC IPC277E to critclk_systems DMI table tools/power/x86/intel-speed-select: Fix perf-profile command output tools/power/x86/intel-speed-select: Extend core-power command set tools/power/x86/intel-speed-select: Fix some debug prints tools/power/x86/intel-speed-select: Format get-assoc information tools/power/x86/intel-speed-select: Allow online/offline based on tdp tools/power/x86/intel-speed-select: Fix high priority core mask over count platform/x86: asus-wmi: Make it depend on ACPI battery API
-rw-r--r--drivers/platform/x86/Kconfig1
-rw-r--r--drivers/platform/x86/i2c-multi-instantiate.c2
-rw-r--r--drivers/platform/x86/pmc_atom.c7
-rw-r--r--tools/power/x86/intel-speed-select/isst-config.c122
-rw-r--r--tools/power/x86/intel-speed-select/isst-core.c25
-rw-r--r--tools/power/x86/intel-speed-select/isst-display.c71
-rw-r--r--tools/power/x86/intel-speed-select/isst.h10
7 files changed, 222 insertions, 16 deletions
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 1b67bb578f9f..ae21d08c65e8 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -674,6 +674,7 @@ config EEEPC_LAPTOP
674config ASUS_WMI 674config ASUS_WMI
675 tristate "ASUS WMI Driver" 675 tristate "ASUS WMI Driver"
676 depends on ACPI_WMI 676 depends on ACPI_WMI
677 depends on ACPI_BATTERY
677 depends on INPUT 678 depends on INPUT
678 depends on HWMON 679 depends on HWMON
679 depends on BACKLIGHT_CLASS_DEVICE 680 depends on BACKLIGHT_CLASS_DEVICE
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index 61fe341a85aa..ea68f6ed66ae 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -90,7 +90,7 @@ static int i2c_multi_inst_probe(struct platform_device *pdev)
90 for (i = 0; i < multi->num_clients && inst_data[i].type; i++) { 90 for (i = 0; i < multi->num_clients && inst_data[i].type; i++) {
91 memset(&board_info, 0, sizeof(board_info)); 91 memset(&board_info, 0, sizeof(board_info));
92 strlcpy(board_info.type, inst_data[i].type, I2C_NAME_SIZE); 92 strlcpy(board_info.type, inst_data[i].type, I2C_NAME_SIZE);
93 snprintf(name, sizeof(name), "%s-%s.%d", match->id, 93 snprintf(name, sizeof(name), "%s-%s.%d", dev_name(dev),
94 inst_data[i].type, i); 94 inst_data[i].type, i);
95 board_info.dev_name = name; 95 board_info.dev_name = name;
96 switch (inst_data[i].flags & IRQ_RESOURCE_TYPE) { 96 switch (inst_data[i].flags & IRQ_RESOURCE_TYPE) {
diff --git a/drivers/platform/x86/pmc_atom.c b/drivers/platform/x86/pmc_atom.c
index 9aca5e7ce6d0..07d1b911e72f 100644
--- a/drivers/platform/x86/pmc_atom.c
+++ b/drivers/platform/x86/pmc_atom.c
@@ -422,6 +422,13 @@ static const struct dmi_system_id critclk_systems[] = {
422 DMI_MATCH(DMI_PRODUCT_VERSION, "6ES7647-8B"), 422 DMI_MATCH(DMI_PRODUCT_VERSION, "6ES7647-8B"),
423 }, 423 },
424 }, 424 },
425 {
426 .ident = "SIMATIC IPC277E",
427 .matches = {
428 DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"),
429 DMI_MATCH(DMI_PRODUCT_VERSION, "6AV7882-0"),
430 },
431 },
425 { /*sentinel*/ } 432 { /*sentinel*/ }
426}; 433};
427 434
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c
index 59753b3917bb..2a9890c8395a 100644
--- a/tools/power/x86/intel-speed-select/isst-config.c
+++ b/tools/power/x86/intel-speed-select/isst-config.c
@@ -38,6 +38,7 @@ static int fact_avx = 0xFF;
38static unsigned long long fact_trl; 38static unsigned long long fact_trl;
39static int out_format_json; 39static int out_format_json;
40static int cmd_help; 40static int cmd_help;
41static int force_online_offline;
41 42
42/* clos related */ 43/* clos related */
43static int current_clos = -1; 44static int current_clos = -1;
@@ -138,14 +139,14 @@ int out_format_is_json(void)
138int get_physical_package_id(int cpu) 139int get_physical_package_id(int cpu)
139{ 140{
140 return parse_int_file( 141 return parse_int_file(
141 1, "/sys/devices/system/cpu/cpu%d/topology/physical_package_id", 142 0, "/sys/devices/system/cpu/cpu%d/topology/physical_package_id",
142 cpu); 143 cpu);
143} 144}
144 145
145int get_physical_core_id(int cpu) 146int get_physical_core_id(int cpu)
146{ 147{
147 return parse_int_file( 148 return parse_int_file(
148 1, "/sys/devices/system/cpu/cpu%d/topology/core_id", cpu); 149 0, "/sys/devices/system/cpu/cpu%d/topology/core_id", cpu);
149} 150}
150 151
151int get_physical_die_id(int cpu) 152int get_physical_die_id(int cpu)
@@ -165,6 +166,26 @@ int get_topo_max_cpus(void)
165 return topo_max_cpus; 166 return topo_max_cpus;
166} 167}
167 168
169static void set_cpu_online_offline(int cpu, int state)
170{
171 char buffer[128];
172 int fd;
173
174 snprintf(buffer, sizeof(buffer),
175 "/sys/devices/system/cpu/cpu%d/online", cpu);
176
177 fd = open(buffer, O_WRONLY);
178 if (fd < 0)
179 err(-1, "%s open failed", buffer);
180
181 if (state)
182 write(fd, "1\n", 2);
183 else
184 write(fd, "0\n", 2);
185
186 close(fd);
187}
188
168#define MAX_PACKAGE_COUNT 8 189#define MAX_PACKAGE_COUNT 8
169#define MAX_DIE_PER_PACKAGE 2 190#define MAX_DIE_PER_PACKAGE 2
170static void for_each_online_package_in_set(void (*callback)(int, void *, void *, 191static void for_each_online_package_in_set(void (*callback)(int, void *, void *,
@@ -402,6 +423,9 @@ void set_cpu_mask_from_punit_coremask(int cpu, unsigned long long core_mask,
402 int j; 423 int j;
403 424
404 for (j = 0; j < topo_max_cpus; ++j) { 425 for (j = 0; j < topo_max_cpus; ++j) {
426 if (!CPU_ISSET_S(j, present_cpumask_size, present_cpumask))
427 continue;
428
405 if (cpu_map[j].pkg_id == pkg_id && 429 if (cpu_map[j].pkg_id == pkg_id &&
406 cpu_map[j].die_id == die_id && 430 cpu_map[j].die_id == die_id &&
407 cpu_map[j].punit_cpu_core == i) { 431 cpu_map[j].punit_cpu_core == i) {
@@ -484,7 +508,7 @@ int isst_send_mbox_command(unsigned int cpu, unsigned char command,
484 int write = 0; 508 int write = 0;
485 int clos_id, core_id, ret = 0; 509 int clos_id, core_id, ret = 0;
486 510
487 debug_printf("CLOS %d\n", cpu); 511 debug_printf("CPU %d\n", cpu);
488 512
489 if (parameter & BIT(MBOX_CMD_WRITE_BIT)) { 513 if (parameter & BIT(MBOX_CMD_WRITE_BIT)) {
490 value = req_data; 514 value = req_data;
@@ -649,8 +673,8 @@ static void exec_on_get_ctdp_cpu(int cpu, void *arg1, void *arg2, void *arg3,
649 if (ret) 673 if (ret)
650 perror("get_tdp_*"); 674 perror("get_tdp_*");
651 else 675 else
652 isst_display_result(cpu, outf, "perf-profile", (char *)arg3, 676 isst_ctdp_display_core_info(cpu, outf, arg3,
653 *(unsigned int *)arg4); 677 *(unsigned int *)arg4);
654} 678}
655 679
656#define _get_tdp_level(desc, suffix, object, help) \ 680#define _get_tdp_level(desc, suffix, object, help) \
@@ -733,9 +757,34 @@ static void set_tdp_level_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
733 ret = isst_set_tdp_level(cpu, tdp_level); 757 ret = isst_set_tdp_level(cpu, tdp_level);
734 if (ret) 758 if (ret)
735 perror("set_tdp_level_for_cpu"); 759 perror("set_tdp_level_for_cpu");
736 else 760 else {
737 isst_display_result(cpu, outf, "perf-profile", "set_tdp_level", 761 isst_display_result(cpu, outf, "perf-profile", "set_tdp_level",
738 ret); 762 ret);
763 if (force_online_offline) {
764 struct isst_pkg_ctdp_level_info ctdp_level;
765 int pkg_id = get_physical_package_id(cpu);
766 int die_id = get_physical_die_id(cpu);
767
768 fprintf(stderr, "Option is set to online/offline\n");
769 ctdp_level.core_cpumask_size =
770 alloc_cpu_set(&ctdp_level.core_cpumask);
771 isst_get_coremask_info(cpu, tdp_level, &ctdp_level);
772 if (ctdp_level.cpu_count) {
773 int i, max_cpus = get_topo_max_cpus();
774 for (i = 0; i < max_cpus; ++i) {
775 if (pkg_id != get_physical_package_id(i) || die_id != get_physical_die_id(i))
776 continue;
777 if (CPU_ISSET_S(i, ctdp_level.core_cpumask_size, ctdp_level.core_cpumask)) {
778 fprintf(stderr, "online cpu %d\n", i);
779 set_cpu_online_offline(i, 1);
780 } else {
781 fprintf(stderr, "offline cpu %d\n", i);
782 set_cpu_online_offline(i, 0);
783 }
784 }
785 }
786 }
787 }
739} 788}
740 789
741static void set_tdp_level(void) 790static void set_tdp_level(void)
@@ -744,6 +793,8 @@ static void set_tdp_level(void)
744 fprintf(stderr, "Set Config TDP level\n"); 793 fprintf(stderr, "Set Config TDP level\n");
745 fprintf(stderr, 794 fprintf(stderr,
746 "\t Arguments: -l|--level : Specify tdp level\n"); 795 "\t Arguments: -l|--level : Specify tdp level\n");
796 fprintf(stderr,
797 "\t Optional Arguments: -o | online : online/offline for the tdp level\n");
747 exit(0); 798 exit(0);
748 } 799 }
749 800
@@ -1082,6 +1133,40 @@ static void dump_clos_config(void)
1082 isst_ctdp_display_information_end(outf); 1133 isst_ctdp_display_information_end(outf);
1083} 1134}
1084 1135
1136static void get_clos_info_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
1137 void *arg4)
1138{
1139 int enable, ret, prio_type;
1140
1141 ret = isst_clos_get_clos_information(cpu, &enable, &prio_type);
1142 if (ret)
1143 perror("isst_clos_get_info");
1144 else
1145 isst_clos_display_clos_information(cpu, outf, enable, prio_type);
1146}
1147
1148static void dump_clos_info(void)
1149{
1150 if (cmd_help) {
1151 fprintf(stderr,
1152 "Print Intel Speed Select Technology core power information\n");
1153 fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n");
1154 exit(0);
1155 }
1156
1157 if (!max_target_cpus) {
1158 fprintf(stderr,
1159 "Invalid target cpu. Specify with [-c|--cpu]\n");
1160 exit(0);
1161 }
1162
1163 isst_ctdp_display_information_start(outf);
1164 for_each_online_target_cpu_in_set(get_clos_info_for_cpu, NULL,
1165 NULL, NULL, NULL);
1166 isst_ctdp_display_information_end(outf);
1167
1168}
1169
1085static void set_clos_config_for_cpu(int cpu, void *arg1, void *arg2, void *arg3, 1170static void set_clos_config_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
1086 void *arg4) 1171 void *arg4)
1087{ 1172{
@@ -1198,7 +1283,7 @@ static void get_clos_assoc_for_cpu(int cpu, void *arg1, void *arg2, void *arg3,
1198 if (ret) 1283 if (ret)
1199 perror("isst_clos_get_assoc_status"); 1284 perror("isst_clos_get_assoc_status");
1200 else 1285 else
1201 isst_display_result(cpu, outf, "core-power", "get-assoc", clos); 1286 isst_clos_display_assoc_information(cpu, outf, clos);
1202} 1287}
1203 1288
1204static void get_clos_assoc(void) 1289static void get_clos_assoc(void)
@@ -1208,13 +1293,17 @@ static void get_clos_assoc(void)
1208 fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n"); 1293 fprintf(stderr, "\tSpecify targeted cpu id with [--cpu|-c]\n");
1209 exit(0); 1294 exit(0);
1210 } 1295 }
1211 if (max_target_cpus) 1296
1212 for_each_online_target_cpu_in_set(get_clos_assoc_for_cpu, NULL, 1297 if (!max_target_cpus) {
1213 NULL, NULL, NULL);
1214 else {
1215 fprintf(stderr, 1298 fprintf(stderr,
1216 "Invalid target cpu. Specify with [-c|--cpu]\n"); 1299 "Invalid target cpu. Specify with [-c|--cpu]\n");
1300 exit(0);
1217 } 1301 }
1302
1303 isst_ctdp_display_information_start(outf);
1304 for_each_online_target_cpu_in_set(get_clos_assoc_for_cpu, NULL,
1305 NULL, NULL, NULL);
1306 isst_ctdp_display_information_end(outf);
1218} 1307}
1219 1308
1220static struct process_cmd_struct isst_cmds[] = { 1309static struct process_cmd_struct isst_cmds[] = {
@@ -1231,10 +1320,11 @@ static struct process_cmd_struct isst_cmds[] = {
1231 { "turbo-freq", "info", dump_fact_config }, 1320 { "turbo-freq", "info", dump_fact_config },
1232 { "turbo-freq", "enable", set_fact_enable }, 1321 { "turbo-freq", "enable", set_fact_enable },
1233 { "turbo-freq", "disable", set_fact_disable }, 1322 { "turbo-freq", "disable", set_fact_disable },
1234 { "core-power", "info", dump_clos_config }, 1323 { "core-power", "info", dump_clos_info },
1235 { "core-power", "enable", set_clos_enable }, 1324 { "core-power", "enable", set_clos_enable },
1236 { "core-power", "disable", set_clos_disable }, 1325 { "core-power", "disable", set_clos_disable },
1237 { "core-power", "config", set_clos_config }, 1326 { "core-power", "config", set_clos_config },
1327 { "core-power", "get-config", dump_clos_config },
1238 { "core-power", "assoc", set_clos_assoc }, 1328 { "core-power", "assoc", set_clos_assoc },
1239 { "core-power", "get-assoc", get_clos_assoc }, 1329 { "core-power", "get-assoc", get_clos_assoc },
1240 { NULL, NULL, NULL } 1330 { NULL, NULL, NULL }
@@ -1316,6 +1406,7 @@ static void parse_cmd_args(int argc, int start, char **argv)
1316 static struct option long_options[] = { 1406 static struct option long_options[] = {
1317 { "bucket", required_argument, 0, 'b' }, 1407 { "bucket", required_argument, 0, 'b' },
1318 { "level", required_argument, 0, 'l' }, 1408 { "level", required_argument, 0, 'l' },
1409 { "online", required_argument, 0, 'o' },
1319 { "trl-type", required_argument, 0, 'r' }, 1410 { "trl-type", required_argument, 0, 'r' },
1320 { "trl", required_argument, 0, 't' }, 1411 { "trl", required_argument, 0, 't' },
1321 { "help", no_argument, 0, 'h' }, 1412 { "help", no_argument, 0, 'h' },
@@ -1332,7 +1423,7 @@ static void parse_cmd_args(int argc, int start, char **argv)
1332 option_index = start; 1423 option_index = start;
1333 1424
1334 optind = start + 1; 1425 optind = start + 1;
1335 while ((opt = getopt_long(argc, argv, "b:l:t:c:d:e:n:m:p:w:h", 1426 while ((opt = getopt_long(argc, argv, "b:l:t:c:d:e:n:m:p:w:ho",
1336 long_options, &option_index)) != -1) { 1427 long_options, &option_index)) != -1) {
1337 switch (opt) { 1428 switch (opt) {
1338 case 'b': 1429 case 'b':
@@ -1344,6 +1435,9 @@ static void parse_cmd_args(int argc, int start, char **argv)
1344 case 'l': 1435 case 'l':
1345 tdp_level = atoi(optarg); 1436 tdp_level = atoi(optarg);
1346 break; 1437 break;
1438 case 'o':
1439 force_online_offline = 1;
1440 break;
1347 case 't': 1441 case 't':
1348 sscanf(optarg, "0x%llx", &fact_trl); 1442 sscanf(optarg, "0x%llx", &fact_trl);
1349 break; 1443 break;
@@ -1362,7 +1456,6 @@ static void parse_cmd_args(int argc, int start, char **argv)
1362 /* CLOS related */ 1456 /* CLOS related */
1363 case 'c': 1457 case 'c':
1364 current_clos = atoi(optarg); 1458 current_clos = atoi(optarg);
1365 printf("clos %d\n", current_clos);
1366 break; 1459 break;
1367 case 'd': 1460 case 'd':
1368 clos_desired = atoi(optarg); 1461 clos_desired = atoi(optarg);
@@ -1433,6 +1526,7 @@ static void core_power_help(void)
1433 printf("\tenable\n"); 1526 printf("\tenable\n");
1434 printf("\tdisable\n"); 1527 printf("\tdisable\n");
1435 printf("\tconfig\n"); 1528 printf("\tconfig\n");
1529 printf("\tget-config\n");
1436 printf("\tassoc\n"); 1530 printf("\tassoc\n");
1437 printf("\tget-assoc\n"); 1531 printf("\tget-assoc\n");
1438} 1532}
diff --git a/tools/power/x86/intel-speed-select/isst-core.c b/tools/power/x86/intel-speed-select/isst-core.c
index 0bf341ad9697..6dee5332c9d3 100644
--- a/tools/power/x86/intel-speed-select/isst-core.c
+++ b/tools/power/x86/intel-speed-select/isst-core.c
@@ -619,6 +619,31 @@ int isst_get_process_ctdp(int cpu, int tdp_level, struct isst_pkg_ctdp *pkg_dev)
619 return 0; 619 return 0;
620} 620}
621 621
622int isst_clos_get_clos_information(int cpu, int *enable, int *type)
623{
624 unsigned int resp;
625 int ret;
626
627 ret = isst_send_mbox_command(cpu, CONFIG_CLOS, CLOS_PM_QOS_CONFIG, 0, 0,
628 &resp);
629 if (ret)
630 return ret;
631
632 debug_printf("cpu:%d CLOS_PM_QOS_CONFIG resp:%x\n", cpu, resp);
633
634 if (resp & BIT(1))
635 *enable = 1;
636 else
637 *enable = 0;
638
639 if (resp & BIT(2))
640 *type = 1;
641 else
642 *type = 0;
643
644 return 0;
645}
646
622int isst_pm_qos_config(int cpu, int enable_clos, int priority_type) 647int isst_pm_qos_config(int cpu, int enable_clos, int priority_type)
623{ 648{
624 unsigned int req, resp; 649 unsigned int req, resp;
diff --git a/tools/power/x86/intel-speed-select/isst-display.c b/tools/power/x86/intel-speed-select/isst-display.c
index df4aa99c4e92..40346d534f78 100644
--- a/tools/power/x86/intel-speed-select/isst-display.c
+++ b/tools/power/x86/intel-speed-select/isst-display.c
@@ -287,6 +287,26 @@ static void _isst_fact_display_information(int cpu, FILE *outf, int level,
287 format_and_print(outf, base_level + 2, header, value); 287 format_and_print(outf, base_level + 2, header, value);
288} 288}
289 289
290void isst_ctdp_display_core_info(int cpu, FILE *outf, char *prefix,
291 unsigned int val)
292{
293 char header[256];
294 char value[256];
295
296 snprintf(header, sizeof(header), "package-%d",
297 get_physical_package_id(cpu));
298 format_and_print(outf, 1, header, NULL);
299 snprintf(header, sizeof(header), "die-%d", get_physical_die_id(cpu));
300 format_and_print(outf, 2, header, NULL);
301 snprintf(header, sizeof(header), "cpu-%d", cpu);
302 format_and_print(outf, 3, header, NULL);
303
304 snprintf(value, sizeof(value), "%u", val);
305 format_and_print(outf, 4, prefix, value);
306
307 format_and_print(outf, 1, NULL, NULL);
308}
309
290void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level, 310void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
291 struct isst_pkg_ctdp *pkg_dev) 311 struct isst_pkg_ctdp *pkg_dev)
292{ 312{
@@ -503,6 +523,57 @@ void isst_clos_display_information(int cpu, FILE *outf, int clos,
503 format_and_print(outf, 1, NULL, NULL); 523 format_and_print(outf, 1, NULL, NULL);
504} 524}
505 525
526void isst_clos_display_clos_information(int cpu, FILE *outf,
527 int clos_enable, int type)
528{
529 char header[256];
530 char value[256];
531
532 snprintf(header, sizeof(header), "package-%d",
533 get_physical_package_id(cpu));
534 format_and_print(outf, 1, header, NULL);
535 snprintf(header, sizeof(header), "die-%d", get_physical_die_id(cpu));
536 format_and_print(outf, 2, header, NULL);
537 snprintf(header, sizeof(header), "cpu-%d", cpu);
538 format_and_print(outf, 3, header, NULL);
539
540 snprintf(header, sizeof(header), "core-power");
541 format_and_print(outf, 4, header, NULL);
542
543 snprintf(header, sizeof(header), "enable-status");
544 snprintf(value, sizeof(value), "%d", clos_enable);
545 format_and_print(outf, 5, header, value);
546
547 snprintf(header, sizeof(header), "priority-type");
548 snprintf(value, sizeof(value), "%d", type);
549 format_and_print(outf, 5, header, value);
550
551 format_and_print(outf, 1, NULL, NULL);
552}
553
554void isst_clos_display_assoc_information(int cpu, FILE *outf, int clos)
555{
556 char header[256];
557 char value[256];
558
559 snprintf(header, sizeof(header), "package-%d",
560 get_physical_package_id(cpu));
561 format_and_print(outf, 1, header, NULL);
562 snprintf(header, sizeof(header), "die-%d", get_physical_die_id(cpu));
563 format_and_print(outf, 2, header, NULL);
564 snprintf(header, sizeof(header), "cpu-%d", cpu);
565 format_and_print(outf, 3, header, NULL);
566
567 snprintf(header, sizeof(header), "get-assoc");
568 format_and_print(outf, 4, header, NULL);
569
570 snprintf(header, sizeof(header), "clos");
571 snprintf(value, sizeof(value), "%d", clos);
572 format_and_print(outf, 5, header, value);
573
574 format_and_print(outf, 1, NULL, NULL);
575}
576
506void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd, 577void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd,
507 int result) 578 int result)
508{ 579{
diff --git a/tools/power/x86/intel-speed-select/isst.h b/tools/power/x86/intel-speed-select/isst.h
index 2f7f62765eb6..d280b27d600d 100644
--- a/tools/power/x86/intel-speed-select/isst.h
+++ b/tools/power/x86/intel-speed-select/isst.h
@@ -187,12 +187,16 @@ extern int isst_send_msr_command(unsigned int cpu, unsigned int command,
187 int write, unsigned long long *req_resp); 187 int write, unsigned long long *req_resp);
188 188
189extern int isst_get_ctdp_levels(int cpu, struct isst_pkg_ctdp *pkg_dev); 189extern int isst_get_ctdp_levels(int cpu, struct isst_pkg_ctdp *pkg_dev);
190extern int isst_get_coremask_info(int cpu, int config_index,
191 struct isst_pkg_ctdp_level_info *ctdp_level);
190extern int isst_get_process_ctdp(int cpu, int tdp_level, 192extern int isst_get_process_ctdp(int cpu, int tdp_level,
191 struct isst_pkg_ctdp *pkg_dev); 193 struct isst_pkg_ctdp *pkg_dev);
192extern void isst_get_process_ctdp_complete(int cpu, 194extern void isst_get_process_ctdp_complete(int cpu,
193 struct isst_pkg_ctdp *pkg_dev); 195 struct isst_pkg_ctdp *pkg_dev);
194extern void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level, 196extern void isst_ctdp_display_information(int cpu, FILE *outf, int tdp_level,
195 struct isst_pkg_ctdp *pkg_dev); 197 struct isst_pkg_ctdp *pkg_dev);
198extern void isst_ctdp_display_core_info(int cpu, FILE *outf, char *prefix,
199 unsigned int val);
196extern void isst_ctdp_display_information_start(FILE *outf); 200extern void isst_ctdp_display_information_start(FILE *outf);
197extern void isst_ctdp_display_information_end(FILE *outf); 201extern void isst_ctdp_display_information_end(FILE *outf);
198extern void isst_pbf_display_information(int cpu, FILE *outf, int level, 202extern void isst_pbf_display_information(int cpu, FILE *outf, int level,
@@ -223,10 +227,14 @@ extern int isst_clos_associate(int cpu, int clos);
223extern int isst_clos_get_assoc_status(int cpu, int *clos_id); 227extern int isst_clos_get_assoc_status(int cpu, int *clos_id);
224extern void isst_clos_display_information(int cpu, FILE *outf, int clos, 228extern void isst_clos_display_information(int cpu, FILE *outf, int clos,
225 struct isst_clos_config *clos_config); 229 struct isst_clos_config *clos_config);
226 230extern void isst_clos_display_assoc_information(int cpu, FILE *outf, int clos);
227extern int isst_read_reg(unsigned short reg, unsigned int *val); 231extern int isst_read_reg(unsigned short reg, unsigned int *val);
228extern int isst_write_reg(int reg, unsigned int val); 232extern int isst_write_reg(int reg, unsigned int val);
229 233
230extern void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd, 234extern void isst_display_result(int cpu, FILE *outf, char *feature, char *cmd,
231 int result); 235 int result);
236
237extern int isst_clos_get_clos_information(int cpu, int *enable, int *type);
238extern void isst_clos_display_clos_information(int cpu, FILE *outf,
239 int clos_enable, int type);
232#endif 240#endif