1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _INTEL_PMT_CLASS_H
3 #define _INTEL_PMT_CLASS_H
5 #include <linux/platform_device.h>
6 #include <linux/xarray.h>
7 #include <linux/types.h>
8 #include <linux/bits.h>
12 /* PMT access types */
13 #define ACCESS_BARID 2
14 #define ACCESS_LOCAL 3
16 /* PMT discovery base address/offset register layout */
17 #define GET_BIR(v) ((v) & GENMASK(2, 0))
18 #define GET_ADDRESS(v) ((v) & GENMASK(31, 3))
20 struct intel_pmt_entry {
21 struct bin_attribute pmt_bin_attr;
23 void __iomem *disc_table;
25 unsigned long base_addr;
31 struct intel_pmt_header {
38 struct intel_pmt_namespace {
41 const struct attribute_group *attr_grp;
42 int (*pmt_header_decode)(struct intel_pmt_entry *entry,
43 struct intel_pmt_header *header,
47 bool intel_pmt_is_early_client_hw(struct device *dev);
48 int intel_pmt_dev_create(struct intel_pmt_entry *entry,
49 struct intel_pmt_namespace *ns,
50 struct platform_device *pdev, int idx);
51 void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
52 struct intel_pmt_namespace *ns);