/* SPDX-License-Identifier: MIT */ /* * Copyright © 2021 Intel Corporation */ #ifndef _GUC_ACTIONS_SLPC_ABI_H_ #define _GUC_ACTIONS_SLPC_ABI_H_ #include <linux/types.h> /** * DOC: SLPC SHARED DATA STRUCTURE * * +----+------+--------------------------------------------------------------+ * | CL | Bytes| Description | * +====+======+==============================================================+ * | 1 | 0-3 | SHARED DATA SIZE | * | +------+--------------------------------------------------------------+ * | | 4-7 | GLOBAL STATE | * | +------+--------------------------------------------------------------+ * | | 8-11 | DISPLAY DATA ADDRESS | * | +------+--------------------------------------------------------------+ * | | 12:63| PADDING | * +----+------+--------------------------------------------------------------+ * | | 0:63 | PADDING(PLATFORM INFO) | * +----+------+--------------------------------------------------------------+ * | 3 | 0-3 | TASK STATE DATA | * + +------+--------------------------------------------------------------+ * | | 4:63 | PADDING | * +----+------+--------------------------------------------------------------+ * |4-21|0:1087| OVERRIDE PARAMS AND BIT FIELDS | * +----+------+--------------------------------------------------------------+ * | | | PADDING + EXTRA RESERVED PAGE | * +----+------+--------------------------------------------------------------+ */ /* * SLPC exposes certain parameters for global configuration by the host. * These are referred to as override parameters, because in most cases * the host will not need to modify the default values used by SLPC. * SLPC remembers the default values which allows the host to easily restore * them by simply unsetting the override. The host can set or unset override * parameters during SLPC (re-)initialization using the SLPC Reset event. * The host can also set or unset override parameters on the fly using the * Parameter Set and Parameter Unset events */ #define SLPC_MAX_OVERRIDE_PARAMETERS … #define SLPC_OVERRIDE_BITFIELD_SIZE … #define SLPC_PAGE_SIZE_BYTES … #define SLPC_CACHELINE_SIZE_BYTES … #define SLPC_SHARED_DATA_SIZE_BYTE_HEADER … #define SLPC_SHARED_DATA_SIZE_BYTE_PLATFORM_INFO … #define SLPC_SHARED_DATA_SIZE_BYTE_TASK_STATE … #define SLPC_SHARED_DATA_MODE_DEFN_TABLE_SIZE … #define SLPC_SHARED_DATA_SIZE_BYTE_MAX … /* * Cacheline size aligned (Total size needed for * SLPM_KMD_MAX_OVERRIDE_PARAMETERS=256 is 1088 bytes) */ #define SLPC_OVERRIDE_PARAMS_TOTAL_BYTES … #define SLPC_SHARED_DATA_SIZE_BYTE_OTHER … enum slpc_task_enable { … }; enum slpc_global_state { … }; enum slpc_param_id { … }; enum slpc_media_ratio_mode { … }; enum slpc_gucrc_mode { … }; enum slpc_event_id { … }; struct slpc_task_state_data { … } __packed; struct slpc_shared_data_header { … } __packed; struct slpc_override_params { … } __packed; struct slpc_shared_data { … } __packed; /** * DOC: SLPC H2G MESSAGE FORMAT * * +---+-------+--------------------------------------------------------------+ * | | Bits | Description | * +===+=======+==============================================================+ * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | * | +-------+--------------------------------------------------------------+ * | | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ | * | +-------+--------------------------------------------------------------+ * | | 27:16 | DATA0 = MBZ | * | +-------+--------------------------------------------------------------+ * | | 15:0 | ACTION = _`GUC_ACTION_HOST2GUC_PC_SLPM_REQUEST` = 0x3003 | * +---+-------+--------------------------------------------------------------+ * | 1 | 31:8 | **EVENT_ID** | * + +-------+--------------------------------------------------------------+ * | | 7:0 | **EVENT_ARGC** - number of data arguments | * +---+-------+--------------------------------------------------------------+ * | 2 | 31:0 | **EVENT_DATA1** | * +---+-------+--------------------------------------------------------------+ * |...| 31:0 | ... | * +---+-------+--------------------------------------------------------------+ * |2+n| 31:0 | **EVENT_DATAn** | * +---+-------+--------------------------------------------------------------+ */ #define GUC_ACTION_HOST2GUC_PC_SLPC_REQUEST … #define HOST2GUC_PC_SLPC_REQUEST_MSG_MIN_LEN … #define HOST2GUC_PC_SLPC_EVENT_MAX_INPUT_ARGS … #define HOST2GUC_PC_SLPC_REQUEST_MSG_MAX_LEN … #define HOST2GUC_PC_SLPC_REQUEST_MSG_0_MBZ … #define HOST2GUC_PC_SLPC_REQUEST_MSG_1_EVENT_ID … #define HOST2GUC_PC_SLPC_REQUEST_MSG_1_EVENT_ARGC … #define HOST2GUC_PC_SLPC_REQUEST_MSG_N_EVENT_DATA_N … /** * DOC: SETUP_PC_GUCRC * * +---+-------+--------------------------------------------------------------+ * | | Bits | Description | * +===+=======+==============================================================+ * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | * | +-------+--------------------------------------------------------------+ * | | 30:28 | TYPE = GUC_HXG_TYPE_FAST_REQUEST_ | * | +-------+--------------------------------------------------------------+ * | | 27:16 | DATA0 = MBZ | * | +-------+--------------------------------------------------------------+ * | | 15:0 | ACTION = _`GUC_ACTION_HOST2GUC_SETUP_PC_GUCRC` = 0x3004 | * +---+-------+--------------------------------------------------------------+ * | 1 | 31:0 | **MODE** = GUCRC_HOST_CONTROL(0), GUCRC_FIRMWARE_CONTROL(1) | * +---+-------+--------------------------------------------------------------+ */ #define GUC_ACTION_HOST2GUC_SETUP_PC_GUCRC … #define GUCRC_HOST_CONTROL … #define GUCRC_FIRMWARE_CONTROL … #endif