aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel_telemetry_debugfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/intel_telemetry_debugfs.c')
-rw-r--r--drivers/platform/x86/intel_telemetry_debugfs.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
index cee08f236292..40bce560eb30 100644
--- a/drivers/platform/x86/intel_telemetry_debugfs.c
+++ b/drivers/platform/x86/intel_telemetry_debugfs.c
@@ -1,17 +1,9 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Intel SOC Telemetry debugfs Driver: Currently supports APL 3 * Intel SOC Telemetry debugfs Driver: Currently supports APL
3 * Copyright (c) 2015, Intel Corporation. 4 * Copyright (c) 2015, Intel Corporation.
4 * All Rights Reserved. 5 * All Rights Reserved.
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * This file provides the debugfs interfaces for telemetry. 7 * This file provides the debugfs interfaces for telemetry.
16 * /sys/kernel/debug/telemetry/pss_info: Shows Primary Control Sub-Sys Counters 8 * /sys/kernel/debug/telemetry/pss_info: Shows Primary Control Sub-Sys Counters
17 * /sys/kernel/debug/telemetry/ioss_info: Shows IO Sub-System Counters 9 * /sys/kernel/debug/telemetry/ioss_info: Shows IO Sub-System Counters
@@ -72,9 +64,6 @@
72#define TELEM_IOSS_DX_D0IX_EVTS 25 64#define TELEM_IOSS_DX_D0IX_EVTS 25
73#define TELEM_IOSS_PG_EVTS 30 65#define TELEM_IOSS_PG_EVTS 30
74 66
75#define TELEM_DEBUGFS_CPU(model, data) \
76 { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&data}
77
78#define TELEM_CHECK_AND_PARSE_EVTS(EVTID, EVTNUM, BUF, EVTLOG, EVTDAT, MASK) { \ 67#define TELEM_CHECK_AND_PARSE_EVTS(EVTID, EVTNUM, BUF, EVTLOG, EVTDAT, MASK) { \
79 if (evtlog[index].telem_evtid == (EVTID)) { \ 68 if (evtlog[index].telem_evtid == (EVTID)) { \
80 for (idx = 0; idx < (EVTNUM); idx++) \ 69 for (idx = 0; idx < (EVTNUM); idx++) \
@@ -319,8 +308,8 @@ static struct telemetry_debugfs_conf telem_apl_debugfs_conf = {
319}; 308};
320 309
321static const struct x86_cpu_id telemetry_debugfs_cpu_ids[] = { 310static const struct x86_cpu_id telemetry_debugfs_cpu_ids[] = {
322 TELEM_DEBUGFS_CPU(INTEL_FAM6_ATOM_GOLDMONT, telem_apl_debugfs_conf), 311 INTEL_CPU_FAM6(ATOM_GOLDMONT, telem_apl_debugfs_conf),
323 TELEM_DEBUGFS_CPU(INTEL_FAM6_ATOM_GOLDMONT_PLUS, telem_apl_debugfs_conf), 312 INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, telem_apl_debugfs_conf),
324 {} 313 {}
325}; 314};
326 315
@@ -951,12 +940,16 @@ static int __init telemetry_debugfs_init(void)
951 debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data; 940 debugfs_conf = (struct telemetry_debugfs_conf *)id->driver_data;
952 941
953 err = telemetry_pltconfig_valid(); 942 err = telemetry_pltconfig_valid();
954 if (err < 0) 943 if (err < 0) {
944 pr_info("Invalid pltconfig, ensure IPC1 device is enabled in BIOS\n");
955 return -ENODEV; 945 return -ENODEV;
946 }
956 947
957 err = telemetry_debugfs_check_evts(); 948 err = telemetry_debugfs_check_evts();
958 if (err < 0) 949 if (err < 0) {
950 pr_info("telemetry_debugfs_check_evts failed\n");
959 return -EINVAL; 951 return -EINVAL;
952 }
960 953
961 register_pm_notifier(&pm_notifier); 954 register_pm_notifier(&pm_notifier);
962 955
@@ -1037,4 +1030,4 @@ module_exit(telemetry_debugfs_exit);
1037MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>"); 1030MODULE_AUTHOR("Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>");
1038MODULE_DESCRIPTION("Intel SoC Telemetry debugfs Interface"); 1031MODULE_DESCRIPTION("Intel SoC Telemetry debugfs Interface");
1039MODULE_VERSION(DRIVER_VERSION); 1032MODULE_VERSION(DRIVER_VERSION);
1040MODULE_LICENSE("GPL"); 1033MODULE_LICENSE("GPL v2");