xref: /linux/include/linux/intel_tpmi.h (revision 9669b2499ea377764f8320dd562dd6cd4ea80a5d)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * intel_tpmi.h: Intel TPMI core external interface
4  */
5 
6 #ifndef _INTEL_TPMI_H_
7 #define _INTEL_TPMI_H_
8 
9 #include <linux/bitfield.h>
10 
11 struct oobmsm_plat_info;
12 
13 #define TPMI_VERSION_INVALID	0xff
14 #define TPMI_MINOR_VERSION(val)	FIELD_GET(GENMASK(4, 0), val)
15 #define TPMI_MAJOR_VERSION(val)	FIELD_GET(GENMASK(7, 5), val)
16 
17 /*
18  * List of supported TMPI IDs.
19  * Some TMPI IDs are not used by Linux, so the numbers are not consecutive.
20  */
21 enum intel_tpmi_id {
22 	TPMI_ID_RAPL = 0,	/* Running Average Power Limit */
23 	TPMI_ID_PEM = 1,	/* Power and Perf excursion Monitor */
24 	TPMI_ID_UNCORE = 2,	/* Uncore Frequency Scaling */
25 	TPMI_ID_SST = 5,	/* Speed Select Technology */
26 	TPMI_ID_PLR = 0xc,	/* Performance Limit Reasons */
27 	TPMI_CONTROL_ID = 0x80,	/* Special ID for getting feature status */
28 	TPMI_INFO_ID = 0x81,	/* Special ID for PCI BDF and Package ID information */
29 };
30 
31 struct oobmsm_plat_info *tpmi_get_platform_data(struct auxiliary_device *auxdev);
32 struct resource *tpmi_get_resource_at_index(struct auxiliary_device *auxdev, int index);
33 int tpmi_get_resource_count(struct auxiliary_device *auxdev);
34 int tpmi_get_feature_status(struct auxiliary_device *auxdev, int feature_id, bool *read_blocked,
35 			    bool *write_blocked);
36 struct dentry *tpmi_get_debugfs_dir(struct auxiliary_device *auxdev);
37 #endif
38