linux/include/linux/peci-cpu.h

/* SPDX-License-Identifier: GPL-2.0-only */
/* Copyright (c) 2021 Intel Corporation */

#ifndef __LINUX_PECI_CPU_H
#define __LINUX_PECI_CPU_H

#include <linux/types.h>

/* Copied from x86 <asm/processor.h> */
#define X86_VENDOR_INTEL

/* Copied from x86 <asm/cpu_device_id.h> */
#define VFM_MODEL_BIT
#define VFM_FAMILY_BIT
#define VFM_VENDOR_BIT
#define VFM_RSVD_BIT

#define VFM_MODEL_MASK
#define VFM_FAMILY_MASK
#define VFM_VENDOR_MASK

#define VFM_MODEL(vfm)
#define VFM_FAMILY(vfm)
#define VFM_VENDOR(vfm)

#define VFM_MAKE(_vendor, _family, _model)
/* End of copied code */

#include "../../arch/x86/include/asm/intel-family.h"

#define PECI_PCS_PKG_ID
#define PECI_PKG_ID_CPU_ID
#define PECI_PKG_ID_PLATFORM_ID
#define PECI_PKG_ID_DEVICE_ID
#define PECI_PKG_ID_MAX_THREAD_ID
#define PECI_PKG_ID_MICROCODE_REV
#define PECI_PKG_ID_MCA_ERROR_LOG
#define PECI_PCS_MODULE_TEMP
#define PECI_PCS_THERMAL_MARGIN
#define PECI_PCS_DDR_DIMM_TEMP
#define PECI_PCS_TEMP_TARGET
#define PECI_PCS_TDP_UNITS

struct peci_device;

int peci_temp_read(struct peci_device *device, s16 *temp_raw);

int peci_pcs_read(struct peci_device *device, u8 index,
		  u16 param, u32 *data);

int peci_pci_local_read(struct peci_device *device, u8 bus, u8 dev,
			u8 func, u16 reg, u32 *data);

int peci_ep_pci_local_read(struct peci_device *device, u8 seg,
			   u8 bus, u8 dev, u8 func, u16 reg, u32 *data);

int peci_mmio_read(struct peci_device *device, u8 bar, u8 seg,
		   u8 bus, u8 dev, u8 func, u64 address, u32 *data);

#endif /* __LINUX_PECI_CPU_H */