Commit b0013e03 authored by Chen Yu's avatar Chen Yu Committed by Rafael J. Wysocki

ACPI: Introduce Platform Firmware Runtime Telemetry driver

This driver allows user space to fetch telemetry data from the
firmware with the help of the Platform Firmware Runtime Telemetry
interface.

Both PFRU and PFRT are based on ACPI _DSM interfaces located under
special device objects in the ACPI Namespace, but these interfaces
are different from each other, so it is better to provide a separate
driver from each of them, even though they share some common
definitions and naming conventions.
Tested-by: default avatarHongyu Ning <hongyu.ning@intel.com>
Signed-off-by: default avatarChen Yu <yu.c.chen@intel.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0db89fa2
......@@ -532,8 +532,12 @@ config ACPI_PFRUT
The existing firmware code can be modified (driver update) or
extended by adding new code to the firmware (code injection).
To compile this driver as module, choose M here:
the module will be called pfr_update.
Besides, the telemetry driver allows user space to fetch telemetry
data from the firmware with the help of the Platform Firmware Runtime
Telemetry interface.
To compile the drivers as modules, choose M here:
the modules will be called pfr_update and pfr_telemetry.
if ARM64
source "drivers/acpi/arm64/Kconfig"
......
......@@ -102,7 +102,7 @@ obj-$(CONFIG_ACPI_CPPC_LIB) += cppc_acpi.o
obj-$(CONFIG_ACPI_SPCR_TABLE) += spcr.o
obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
obj-$(CONFIG_ACPI_PPTT) += pptt.o
obj-$(CONFIG_ACPI_PFRUT) += pfr_update.o
obj-$(CONFIG_ACPI_PFRUT) += pfr_update.o pfr_telemetry.o
# processor has its own "processor." module_param namespace
processor-y := processor_driver.o
......
This diff is collapsed.
......@@ -171,4 +171,92 @@ struct pfru_updated_result {
__u64 high_exec_time;
};
/**
* struct pfrt_log_data_info - Log Data from telemetry service.
* @status: Indicator of whether this update succeed.
* @ext_status: Implementation specific update result.
* @chunk1_addr_lo: Low 32bit physical address of the telemetry data chunk1
* starting address.
* @chunk1_addr_hi: High 32bit physical address of the telemetry data chunk1
* starting address.
* @chunk2_addr_lo: Low 32bit physical address of the telemetry data chunk2
* starting address.
* @chunk2_addr_hi: High 32bit physical address of the telemetry data chunk2
* starting address.
* @max_data_size: Maximum supported size of data of all data chunks combined.
* @chunk1_size: Data size in bytes of the telemetry data chunk1 buffer.
* @chunk2_size: Data size in bytes of the telemetry data chunk2 buffer.
* @rollover_cnt: Number of times telemetry data buffer is overwritten
* since telemetry buffer reset.
* @reset_cnt: Number of times telemetry services resets that results in
* rollover count and data chunk buffers are reset.
*/
struct pfrt_log_data_info {
__u32 status;
__u32 ext_status;
__u64 chunk1_addr_lo;
__u64 chunk1_addr_hi;
__u64 chunk2_addr_lo;
__u64 chunk2_addr_hi;
__u32 max_data_size;
__u32 chunk1_size;
__u32 chunk2_size;
__u32 rollover_cnt;
__u32 reset_cnt;
};
/**
* struct pfrt_log_info - Telemetry log information.
* @log_level: The telemetry log level.
* @log_type: The telemetry log type(history and execution).
* @log_revid: The telemetry log revision id.
*/
struct pfrt_log_info {
__u32 log_level;
__u32 log_type;
__u32 log_revid;
};
/**
* PFRT_LOG_IOC_SET_INFO - _IOW(PFRUT_IOCTL_MAGIC, 0x06,
* struct pfrt_log_info)
*
* Return:
* * 0 - success
* * -EFAULT - fail to get the setting parameter
* * -EINVAL - fail to set the log level
*
* Set the PFRT log level and log type. The input information is
* a struct pfrt_log_info.
*/
#define PFRT_LOG_IOC_SET_INFO _IOW(PFRUT_IOCTL_MAGIC, 0x06, struct pfrt_log_info)
/**
* PFRT_LOG_IOC_GET_INFO - _IOR(PFRUT_IOCTL_MAGIC, 0x07,
* struct pfrt_log_info)
*
* Return:
* * 0 - success
* * -EINVAL - fail to get the log level
* * -EFAULT - fail to copy the result back to userspace
*
* Retrieve log level and log type of the telemetry. The information is
* a struct pfrt_log_info.
*/
#define PFRT_LOG_IOC_GET_INFO _IOR(PFRUT_IOCTL_MAGIC, 0x07, struct pfrt_log_info)
/**
* PFRT_LOG_IOC_GET_DATA_INFO - _IOR(PFRUT_IOCTL_MAGIC, 0x08,
* struct pfrt_log_data_info)
*
* Return:
* * 0 - success
* * -EINVAL - fail to get the log buffer information
* * -EFAULT - fail to copy the log buffer information to userspace
*
* Retrieve data information about the telemetry. The information
* is a struct pfrt_log_data_info.
*/
#define PFRT_LOG_IOC_GET_DATA_INFO _IOR(PFRUT_IOCTL_MAGIC, 0x08, struct pfrt_log_data_info)
#endif /* __PFRUT_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment