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 int intel_pmt_dev_create(struct intel_pmt_entry
*entry
,
48 struct intel_pmt_namespace
*ns
,
49 struct platform_device
*pdev
, int idx
);
50 void intel_pmt_dev_destroy(struct intel_pmt_entry
*entry
,
51 struct intel_pmt_namespace
*ns
);