drivers/gpu/drm/xe/abi/uc_fw_abi.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/abi/uc_fw_abi.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/xe/abi/uc_fw_abi.h
Extension
.h
Size
15098 bytes
Lines
406
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct uc_css_rsa_info {
	u32 key_size_dw;
	u32 modulus_size_dw;
	u32 exponent_size_dw;
} __packed;

struct uc_css_guc_info {
	u32 time;
#define CSS_TIME_HOUR				(0xFF << 0)
#define CSS_TIME_MIN				(0xFF << 8)
#define CSS_TIME_SEC				(0xFFFF << 16)
	u32 reserved0[5];
	u32 sw_version;
#define CSS_SW_VERSION_UC_MAJOR			(0xFF << 16)
#define CSS_SW_VERSION_UC_MINOR			(0xFF << 8)
#define CSS_SW_VERSION_UC_PATCH			(0xFF << 0)
	u32 submission_version;
	u32 reserved1[11];
	u32 header_info;
#define CSS_HEADER_INFO_SVN			(0xFF)
#define CSS_HEADER_INFO_COPY_VALID		(0x1 << 31)
	u32 private_data_size;
	u32 ukernel_info;
#define CSS_UKERNEL_INFO_DEVICEID		(0xFFFF << 16)
#define CSS_UKERNEL_INFO_PRODKEY		(0xFF << 8)
#define CSS_UKERNEL_INFO_BUILDTYPE		(0x3 << 2)
#define CSS_UKERNEL_INFO_BUILDTYPE_PROD		0
#define CSS_UKERNEL_INFO_BUILDTYPE_PREPROD	1
#define CSS_UKERNEL_INFO_BUILDTYPE_DEBUG	2
#define CSS_UKERNEL_INFO_ENCSTATUS		(0x1 << 1)
#define CSS_UKERNEL_INFO_COPY_VALID		(0x1 << 0)
} __packed;

struct uc_css_header {
	u32 module_type;
	/*
	 * header_size includes all non-uCode bits, including css_header, rsa
	 * key, modulus key and exponent data.
	 */
	u32 header_size_dw;
	u32 header_version;
	u32 reserved0;
	u32 module_vendor;
	u32 date;
#define CSS_DATE_DAY				(0xFF << 0)
#define CSS_DATE_MONTH				(0xFF << 8)
#define CSS_DATE_YEAR				(0xFFFF << 16)
	u32 size_dw; /* uCode plus header_size_dw */
	union {
		u32 reserved1[3];
		struct uc_css_rsa_info rsa_info;
	};
	union {
		u32 reserved2[22];
		struct uc_css_guc_info guc_info;
	};
} __packed;
static_assert(sizeof(struct uc_css_header) == 128);

/**
 * DOC: GSC-based Firmware Layout
 *
 * The GSC-based firmware structure is used for GSC releases on all platforms
 * and for HuC releases starting from DG2/MTL. Older HuC releases use the
 * CSS-based layout instead. Differently from the CSS headers, the GSC headers
 * uses a directory + entries structure (i.e., there is array of addresses
 * pointing to specific header extensions identified by a name). Although the
 * header structures are the same, some of the entries are specific to GSC while
 * others are specific to HuC. The manifest header entry, which includes basic
 * information about the binary (like the version) is always present, but it is
 * named differently based on the binary type.
 *
 * The HuC binary starts with a Code Partition Directory (CPD) header. The
 * entries we're interested in for use in the driver are:
 *
 * 1. "HUCP.man": points to the manifest header for the HuC.
 * 2. "huc_fw": points to the FW code. On platforms that support load via DMA
 *    and 2-step HuC authentication (i.e. MTL+) this is a full CSS-based binary,
 *    while if the GSC is the one doing the load (which only happens on DG2)
 *    this section only contains the uCode.
 *
 * The GSC-based HuC firmware layout looks like this::
 *
 *	+================================================+
 *	|  CPD Header                                    |
 *	+================================================+
 *	|  CPD entries[]                                 |
 *	|      entry1                                    |
 *	|      ...                                       |
 *	|      entryX                                    |

Annotation

Implementation Notes