2023-02-01 17:07:36 -08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
|
/*
|
|
|
|
|
* intel_tpmi.h: Intel TPMI core external interface
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _INTEL_TPMI_H_
|
|
|
|
|
#define _INTEL_TPMI_H_
|
|
|
|
|
|
2023-10-03 11:49:14 -07:00
|
|
|
#include <linux/bitfield.h>
|
|
|
|
|
|
2025-07-02 19:28:25 -07:00
|
|
|
struct oobmsm_plat_info;
|
|
|
|
|
|
2023-10-03 11:49:14 -07:00
|
|
|
#define TPMI_VERSION_INVALID 0xff
|
|
|
|
|
#define TPMI_MINOR_VERSION(val) FIELD_GET(GENMASK(4, 0), val)
|
|
|
|
|
#define TPMI_MAJOR_VERSION(val) FIELD_GET(GENMASK(7, 5), val)
|
|
|
|
|
|
2023-12-04 14:17:38 -08:00
|
|
|
/*
|
|
|
|
|
* List of supported TMPI IDs.
|
|
|
|
|
* Some TMPI IDs are not used by Linux, so the numbers are not consecutive.
|
|
|
|
|
*/
|
|
|
|
|
enum intel_tpmi_id {
|
|
|
|
|
TPMI_ID_RAPL = 0, /* Running Average Power Limit */
|
|
|
|
|
TPMI_ID_PEM = 1, /* Power and Perf excursion Monitor */
|
|
|
|
|
TPMI_ID_UNCORE = 2, /* Uncore Frequency Scaling */
|
|
|
|
|
TPMI_ID_SST = 5, /* Speed Select Technology */
|
2024-05-27 16:29:33 +03:00
|
|
|
TPMI_ID_PLR = 0xc, /* Performance Limit Reasons */
|
2023-12-04 14:17:38 -08:00
|
|
|
TPMI_CONTROL_ID = 0x80, /* Special ID for getting feature status */
|
|
|
|
|
TPMI_INFO_ID = 0x81, /* Special ID for PCI BDF and Package ID information */
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-30 08:11:02 -07:00
|
|
|
#define TPMI_CORE_INIT 0
|
|
|
|
|
#define TPMI_CORE_EXIT 1
|
|
|
|
|
|
|
|
|
|
int tpmi_register_notifier(struct notifier_block *nb);
|
|
|
|
|
int tpmi_unregister_notifier(struct notifier_block *nb);
|
|
|
|
|
|
2025-07-02 19:28:25 -07:00
|
|
|
struct oobmsm_plat_info *tpmi_get_platform_data(struct auxiliary_device *auxdev);
|
2023-02-01 17:07:37 -08:00
|
|
|
struct resource *tpmi_get_resource_at_index(struct auxiliary_device *auxdev, int index);
|
|
|
|
|
int tpmi_get_resource_count(struct auxiliary_device *auxdev);
|
2023-12-04 14:17:37 -08:00
|
|
|
int tpmi_get_feature_status(struct auxiliary_device *auxdev, int feature_id, bool *read_blocked,
|
|
|
|
|
bool *write_blocked);
|
2024-05-27 16:29:34 +03:00
|
|
|
struct dentry *tpmi_get_debugfs_dir(struct auxiliary_device *auxdev);
|
2023-02-01 17:07:36 -08:00
|
|
|
#endif
|