1*c1daf37fSZhanjun Dong /* SPDX-License-Identifier: MIT */ 2*c1daf37fSZhanjun Dong /* 3*c1daf37fSZhanjun Dong * Copyright © 2025 Intel Corporation 4*c1daf37fSZhanjun Dong */ 5*c1daf37fSZhanjun Dong 6*c1daf37fSZhanjun Dong #ifndef _ABI_GUC_LIC_ABI_H_ 7*c1daf37fSZhanjun Dong #define _ABI_GUC_LIC_ABI_H_ 8*c1daf37fSZhanjun Dong 9*c1daf37fSZhanjun Dong #include <linux/types.h> 10*c1daf37fSZhanjun Dong 11*c1daf37fSZhanjun Dong /** 12*c1daf37fSZhanjun Dong * enum guc_lic_type - Log Init Config KLV IDs. 13*c1daf37fSZhanjun Dong */ 14*c1daf37fSZhanjun Dong enum guc_lic_type { 15*c1daf37fSZhanjun Dong /** 16*c1daf37fSZhanjun Dong * @GUC_LIC_TYPE_GUC_SW_VERSION: GuC firmware version. Value 17*c1daf37fSZhanjun Dong * is a 32 bit number represented by guc_sw_version. 18*c1daf37fSZhanjun Dong */ 19*c1daf37fSZhanjun Dong GUC_LIC_TYPE_GUC_SW_VERSION = 0x1, 20*c1daf37fSZhanjun Dong /** 21*c1daf37fSZhanjun Dong * @GUC_LIC_TYPE_GUC_DEVICE_ID: GuC device id. Value is a 32 22*c1daf37fSZhanjun Dong * bit. 23*c1daf37fSZhanjun Dong */ 24*c1daf37fSZhanjun Dong GUC_LIC_TYPE_GUC_DEVICE_ID = 0x2, 25*c1daf37fSZhanjun Dong /** 26*c1daf37fSZhanjun Dong * @GUC_LIC_TYPE_TSC_FREQUENCY: GuC timestamp counter 27*c1daf37fSZhanjun Dong * frequency. Value is a 32 bit number representing frequency in 28*c1daf37fSZhanjun Dong * kHz. This timestamp is utilized in log entries, timer and 29*c1daf37fSZhanjun Dong * for engine utilization tracking. 30*c1daf37fSZhanjun Dong */ 31*c1daf37fSZhanjun Dong GUC_LIC_TYPE_TSC_FREQUENCY = 0x3, 32*c1daf37fSZhanjun Dong /** 33*c1daf37fSZhanjun Dong * @GUC_LIC_TYPE_GMD_ID: HW GMD ID. Value is a 32 bit number 34*c1daf37fSZhanjun Dong * representing graphics, media and display HW architecture IDs. 35*c1daf37fSZhanjun Dong */ 36*c1daf37fSZhanjun Dong GUC_LIC_TYPE_GMD_ID = 0x4, 37*c1daf37fSZhanjun Dong /** 38*c1daf37fSZhanjun Dong * @GUC_LIC_TYPE_BUILD_PLATFORM_ID: GuC build platform ID. 39*c1daf37fSZhanjun Dong * Value is 32 bits. 40*c1daf37fSZhanjun Dong */ 41*c1daf37fSZhanjun Dong GUC_LIC_TYPE_BUILD_PLATFORM_ID = 0x5, 42*c1daf37fSZhanjun Dong }; 43*c1daf37fSZhanjun Dong 44*c1daf37fSZhanjun Dong /** 45*c1daf37fSZhanjun Dong * struct guc_lic - GuC LIC (Log-Init-Config) structure. 46*c1daf37fSZhanjun Dong * 47*c1daf37fSZhanjun Dong * This is populated by the GUC at log init time and is located in the log 48*c1daf37fSZhanjun Dong * buffer memory allocation. 49*c1daf37fSZhanjun Dong */ 50*c1daf37fSZhanjun Dong struct guc_lic { 51*c1daf37fSZhanjun Dong /** 52*c1daf37fSZhanjun Dong * @magic: A magic number set by GuC to identify that this 53*c1daf37fSZhanjun Dong * structure contains valid information: magic = GUC_LIC_MAGIC. 54*c1daf37fSZhanjun Dong */ 55*c1daf37fSZhanjun Dong u32 magic; 56*c1daf37fSZhanjun Dong #define GUC_LIC_MAGIC 0x8086900D 57*c1daf37fSZhanjun Dong /** 58*c1daf37fSZhanjun Dong * @version: The version of the this structure. 59*c1daf37fSZhanjun Dong * Major and minor version number are represented as bit fields. 60*c1daf37fSZhanjun Dong */ 61*c1daf37fSZhanjun Dong u32 version; 62*c1daf37fSZhanjun Dong #define GUC_LIC_VERSION_MASK_MAJOR GENMASK(31, 16) 63*c1daf37fSZhanjun Dong #define GUC_LIC_VERSION_MASK_MINOR GENMASK(15, 0) 64*c1daf37fSZhanjun Dong 65*c1daf37fSZhanjun Dong #define GUC_LIC_VERSION_MAJOR 1u 66*c1daf37fSZhanjun Dong #define GUC_LIC_VERSION_MINOR 0u 67*c1daf37fSZhanjun Dong 68*c1daf37fSZhanjun Dong /** @data_count: Number of dwords the `data` array contains. */ 69*c1daf37fSZhanjun Dong u32 data_count; 70*c1daf37fSZhanjun Dong /** 71*c1daf37fSZhanjun Dong * @data: Array of dwords representing a list of LIC KLVs of 72*c1daf37fSZhanjun Dong * type guc_klv_generic with keys represented by guc_lic_type 73*c1daf37fSZhanjun Dong */ 74*c1daf37fSZhanjun Dong u32 data[] __counted_by(data_count); 75*c1daf37fSZhanjun Dong } __packed; 76*c1daf37fSZhanjun Dong 77*c1daf37fSZhanjun Dong #endif 78