summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/abi/guc_lic_abi.h
blob: 9169644093a243919784c6970f9de20073ab6814 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2025 Intel Corporation
 */

#ifndef _ABI_GUC_LIC_ABI_H_
#define _ABI_GUC_LIC_ABI_H_

#include <linux/types.h>

/**
 * enum guc_lic_type - Log Init Config KLV IDs.
 */
enum guc_lic_type {
	/**
	 * @GUC_LIC_TYPE_GUC_SW_VERSION: GuC firmware version. Value
	 * is a 32 bit number represented by guc_sw_version.
	 */
	GUC_LIC_TYPE_GUC_SW_VERSION = 0x1,
	/**
	 * @GUC_LIC_TYPE_GUC_DEVICE_ID: GuC device id. Value is a 32
	 * bit.
	 */
	GUC_LIC_TYPE_GUC_DEVICE_ID = 0x2,
	/**
	 * @GUC_LIC_TYPE_TSC_FREQUENCY: GuC timestamp counter
	 * frequency. Value is a 32 bit number representing frequency in
	 * kHz. This timestamp is utilized in log entries, timer and
	 * for engine utilization tracking.
	 */
	GUC_LIC_TYPE_TSC_FREQUENCY = 0x3,
	/**
	 * @GUC_LIC_TYPE_GMD_ID: HW GMD ID. Value is a 32 bit number
	 * representing graphics, media and display HW architecture IDs.
	 */
	GUC_LIC_TYPE_GMD_ID = 0x4,
	/**
	 * @GUC_LIC_TYPE_BUILD_PLATFORM_ID: GuC build platform ID.
	 * Value is 32 bits.
	 */
	GUC_LIC_TYPE_BUILD_PLATFORM_ID = 0x5,
};

/**
 * struct guc_lic - GuC LIC (Log-Init-Config) structure.
 *
 * This is populated by the GUC at log init time and is located in the log
 * buffer memory allocation.
 */
struct guc_lic {
	/**
	 * @magic: A magic number set by GuC to identify that this
	 * structure contains valid information: magic = GUC_LIC_MAGIC.
	 */
	u32 magic;
#define GUC_LIC_MAGIC			0x8086900D
	/**
	 * @version: The version of the this structure.
	 * Major and minor version number are represented as bit fields.
	 */
	u32 version;
#define GUC_LIC_VERSION_MASK_MAJOR		GENMASK(31, 16)
#define GUC_LIC_VERSION_MASK_MINOR		GENMASK(15, 0)

#define GUC_LIC_VERSION_MAJOR	1u
#define GUC_LIC_VERSION_MINOR	0u

	/** @data_count: Number of dwords the `data` array contains. */
	u32 data_count;
	/**
	 * @data: Array of dwords representing a list of LIC KLVs of
	 * type guc_klv_generic with keys represented by guc_lic_type
	 */
	u32 data[] __counted_by(data_count);
} __packed;

#endif