FILE
class.h
File preview with syntax highlighting.
linux-6.19.14/drivers/platform/x86/intel/pmt/class.h
1/* SPDX-License-Identifier: GPL-2.0 */ 2#ifndef _INTEL_PMT_CLASS_H 3#define _INTEL_PMT_CLASS_H 4 5#include <linux/intel_vsec.h> 6#include <linux/xarray.h> 7#include <linux/types.h> 8#include <linux/bits.h> 9#include <linux/err.h> 10#include <linux/io.h> 11 12#include "telemetry.h" 13 14/* PMT access types */ 15#define ACCESS_BARID 2 16#define ACCESS_LOCAL 3 17 18/* PMT discovery base address/offset register layout */ 19#define GET_BIR(v) ((v) & GENMASK(2, 0)) 20#define GET_ADDRESS(v) ((v) & GENMASK(31, 3)) 21 22struct pci_dev; 23extern struct class intel_pmt_class; 24 25struct telem_endpoint { 26 struct pci_dev *pcidev; 27 struct telem_header header; 28 struct pmt_callbacks *cb; 29 void __iomem *base; 30 bool present; 31 struct kref kref; 32}; 33 34struct intel_pmt_header { 35 u32 base_offset; 36 u32 size; 37 u32 guid; 38 u8 access_type; 39}; 40 41struct intel_pmt_entry { 42 struct telem_endpoint *ep; 43 struct pci_dev *pcidev; 44 struct intel_pmt_header header; 45 struct bin_attribute pmt_bin_attr; 46 const struct attribute_group *attr_grp; 47 struct kobject *kobj; 48 void __iomem *disc_table; 49 void __iomem *base; 50 struct pmt_callbacks *cb; 51 unsigned long base_addr; 52 size_t size; 53 u64 feature_flags; 54 u32 guid; 55 u32 num_rmids; /* Number of Resource Monitoring IDs */ 56 int devid; 57}; 58 59struct intel_pmt_namespace { 60 const char *name; 61 struct xarray *xa; 62 int (*pmt_header_decode)(struct intel_pmt_entry *entry, 63 struct device *dev); 64 int (*pmt_add_endpoint)(struct intel_vsec_device *ivdev, 65 struct intel_pmt_entry *entry); 66}; 67 68int pmt_telem_read_mmio(struct pci_dev *pdev, struct pmt_callbacks *cb, u32 guid, void *buf, 69 void __iomem *addr, loff_t off, u32 count); 70bool intel_pmt_is_early_client_hw(struct device *dev); 71int intel_pmt_dev_create(struct intel_pmt_entry *entry, 72 struct intel_pmt_namespace *ns, 73 struct intel_vsec_device *dev, int idx); 74void intel_pmt_dev_destroy(struct intel_pmt_entry *entry, 75 struct intel_pmt_namespace *ns); 76#if IS_ENABLED(CONFIG_INTEL_PMT_DISCOVERY) 77void intel_pmt_get_features(struct intel_pmt_entry *entry); 78#else 79static inline void intel_pmt_get_features(struct intel_pmt_entry *entry) {} 80#endif 81 82#endif
~/
Read-only file preview.