Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /* Copyright (c) 2021 Intel Corporation */
0003 
0004 #ifndef __LINUX_PECI_CPU_H
0005 #define __LINUX_PECI_CPU_H
0006 
0007 #include <linux/types.h>
0008 
0009 #include "../../arch/x86/include/asm/intel-family.h"
0010 
0011 #define PECI_PCS_PKG_ID         0  /* Package Identifier Read */
0012 #define  PECI_PKG_ID_CPU_ID     0x0000  /* CPUID Info */
0013 #define  PECI_PKG_ID_PLATFORM_ID    0x0001  /* Platform ID */
0014 #define  PECI_PKG_ID_DEVICE_ID      0x0002  /* Uncore Device ID */
0015 #define  PECI_PKG_ID_MAX_THREAD_ID  0x0003  /* Max Thread ID */
0016 #define  PECI_PKG_ID_MICROCODE_REV  0x0004  /* CPU Microcode Update Revision */
0017 #define  PECI_PKG_ID_MCA_ERROR_LOG  0x0005  /* Machine Check Status */
0018 #define PECI_PCS_MODULE_TEMP        9  /* Per Core DTS Temperature Read */
0019 #define PECI_PCS_THERMAL_MARGIN     10 /* DTS thermal margin */
0020 #define PECI_PCS_DDR_DIMM_TEMP      14 /* DDR DIMM Temperature */
0021 #define PECI_PCS_TEMP_TARGET        16 /* Temperature Target Read */
0022 #define PECI_PCS_TDP_UNITS      30 /* Units for power/energy registers */
0023 
0024 struct peci_device;
0025 
0026 int peci_temp_read(struct peci_device *device, s16 *temp_raw);
0027 
0028 int peci_pcs_read(struct peci_device *device, u8 index,
0029           u16 param, u32 *data);
0030 
0031 int peci_pci_local_read(struct peci_device *device, u8 bus, u8 dev,
0032             u8 func, u16 reg, u32 *data);
0033 
0034 int peci_ep_pci_local_read(struct peci_device *device, u8 seg,
0035                u8 bus, u8 dev, u8 func, u16 reg, u32 *data);
0036 
0037 int peci_mmio_read(struct peci_device *device, u8 bar, u8 seg,
0038            u8 bus, u8 dev, u8 func, u64 address, u32 *data);
0039 
0040 #endif /* __LINUX_PECI_CPU_H */