drivers/gpu/drm/xe/xe_uc_fw.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_uc_fw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_uc_fw.c- Extension
.c- Size
- 29877 bytes
- Lines
- 973
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/fault-inject.hlinux/firmware.hdrm/drm_managed.hregs/xe_guc_regs.hxe_bo.hxe_device_types.hxe_force_wake.hxe_gsc.hxe_gt_printk.hxe_gt_sriov_vf.hxe_gt_types.hxe_guc.hxe_map.hxe_mmio.hxe_module.hxe_sriov.hxe_uc_fw.h
Detected Declarations
struct uc_fw_entrystruct fw_blobs_by_typefunction __uc_fw_to_gtfunction xe_uc_fw_change_statusfunction uc_fw_auto_selectfunction uc_fw_overridefunction xe_uc_fw_copy_rsafunction uc_fw_finifunction guc_read_css_infofunction xe_uc_fw_check_version_requirementsfunction parse_css_headerfunction is_cpd_headerfunction entry_offsetfunction parse_cpd_headerfunction parse_gsc_layoutfunction parse_headersfunction uc_fw_vf_overridefunction uc_fw_requestfunction uc_fw_releasefunction uc_fw_copyfunction xe_uc_fw_initfunction uc_fw_ggtt_offsetfunction uc_fw_xferfunction xe_uc_fw_uploadfunction xe_uc_fw_print
Annotated Snippet
struct uc_fw_entry {
enum xe_platform platform;
enum xe_gt_type gt_type;
struct {
const char *path;
u16 major;
u16 minor;
u16 patch;
bool full_ver_required;
};
};
struct fw_blobs_by_type {
const struct uc_fw_entry *entries;
u32 count;
};
/*
* Add an "ANY" define just to convey the meaning it's given here.
*/
#define XE_GT_TYPE_ANY XE_GT_TYPE_UNINITIALIZED
#define XE_GUC_FIRMWARE_DEFS(fw_def, mmp_ver, major_ver) \
fw_def(PANTHERLAKE, GT_TYPE_ANY, major_ver(xe, guc, ptl, 70, 54, 0)) \
fw_def(BATTLEMAGE, GT_TYPE_ANY, major_ver(xe, guc, bmg, 70, 54, 0)) \
fw_def(LUNARLAKE, GT_TYPE_ANY, major_ver(xe, guc, lnl, 70, 53, 0)) \
fw_def(METEORLAKE, GT_TYPE_ANY, major_ver(i915, guc, mtl, 70, 53, 0)) \
fw_def(DG2, GT_TYPE_ANY, major_ver(i915, guc, dg2, 70, 53, 0)) \
fw_def(DG1, GT_TYPE_ANY, major_ver(i915, guc, dg1, 70, 44, 1)) \
fw_def(ALDERLAKE_N, GT_TYPE_ANY, major_ver(i915, guc, tgl, 70, 44, 1)) \
fw_def(ALDERLAKE_P, GT_TYPE_ANY, major_ver(i915, guc, adlp, 70, 44, 1)) \
fw_def(ALDERLAKE_S, GT_TYPE_ANY, major_ver(i915, guc, tgl, 70, 44, 1)) \
fw_def(ROCKETLAKE, GT_TYPE_ANY, major_ver(i915, guc, tgl, 70, 44, 1)) \
fw_def(TIGERLAKE, GT_TYPE_ANY, major_ver(i915, guc, tgl, 70, 44, 1))
#define XE_HUC_FIRMWARE_DEFS(fw_def, mmp_ver, no_ver) \
fw_def(PANTHERLAKE, GT_TYPE_ANY, no_ver(xe, huc, ptl)) \
fw_def(BATTLEMAGE, GT_TYPE_ANY, no_ver(xe, huc, bmg)) \
fw_def(LUNARLAKE, GT_TYPE_ANY, no_ver(xe, huc, lnl)) \
fw_def(METEORLAKE, GT_TYPE_ANY, no_ver(i915, huc_gsc, mtl)) \
fw_def(DG1, GT_TYPE_ANY, no_ver(i915, huc, dg1)) \
fw_def(ALDERLAKE_P, GT_TYPE_ANY, no_ver(i915, huc, tgl)) \
fw_def(ALDERLAKE_S, GT_TYPE_ANY, no_ver(i915, huc, tgl)) \
fw_def(ROCKETLAKE, GT_TYPE_ANY, no_ver(i915, huc, tgl)) \
fw_def(TIGERLAKE, GT_TYPE_ANY, no_ver(i915, huc, tgl))
/* for the GSC FW we match the compatibility version and not the release one */
#define XE_GSC_FIRMWARE_DEFS(fw_def, major_ver) \
fw_def(PANTHERLAKE, GT_TYPE_ANY, major_ver(xe, gsc, ptl, 105, 1, 0)) \
fw_def(LUNARLAKE, GT_TYPE_ANY, major_ver(xe, gsc, lnl, 104, 1, 0)) \
fw_def(METEORLAKE, GT_TYPE_ANY, major_ver(i915, gsc, mtl, 102, 1, 0))
#define MAKE_FW_PATH(dir__, uc__, shortname__, version__) \
__stringify(dir__) "/" __stringify(shortname__) "_" __stringify(uc__) version__ ".bin"
#define fw_filename_mmp_ver(dir_, uc_, shortname_, a, b, c) \
MAKE_FW_PATH(dir_, uc_, shortname_, "_" __stringify(a ## . ## b ## . ## c))
#define fw_filename_major_ver(dir_, uc_, shortname_, a, b, c) \
MAKE_FW_PATH(dir_, uc_, shortname_, "_" __stringify(a))
#define fw_filename_no_ver(dir_, uc_, shortname_) \
MAKE_FW_PATH(dir_, uc_, shortname_, "")
#define fw_filename_gsc(dir_, uc_, shortname_, a, b, c) \
MAKE_FW_PATH(dir_, uc_, shortname_, "_" __stringify(b))
#define uc_fw_entry_mmp_ver(dir_, uc_, shortname_, a, b, c) \
{ fw_filename_mmp_ver(dir_, uc_, shortname_, a, b, c), \
a, b, c, true }
#define uc_fw_entry_major_ver(dir_, uc_, shortname_, a, b, c) \
{ fw_filename_major_ver(dir_, uc_, shortname_, a, b, c), \
a, b, c }
#define uc_fw_entry_no_ver(dir_, uc_, shortname_) \
{ fw_filename_no_ver(dir_, uc_, shortname_), \
0, 0 }
#define uc_fw_entry_gsc(dir_, uc_, shortname_, a, b, c) \
{ fw_filename_gsc(dir_, uc_, shortname_, a, b, c), \
a, b, c }
/* All blobs need to be declared via MODULE_FIRMWARE() */
#define XE_UC_MODULE_FIRMWARE(platform__, gt_type__, fw_filename) \
MODULE_FIRMWARE(fw_filename);
#define XE_UC_FW_ENTRY(platform__, gt_type__, entry__) \
{ \
.platform = XE_ ## platform__, \
.gt_type = XE_ ## gt_type__, \
entry__, \
},
XE_GUC_FIRMWARE_DEFS(XE_UC_MODULE_FIRMWARE,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/fault-inject.h`, `linux/firmware.h`, `drm/drm_managed.h`, `regs/xe_guc_regs.h`, `xe_bo.h`, `xe_device_types.h`, `xe_force_wake.h`.
- Detected declarations: `struct uc_fw_entry`, `struct fw_blobs_by_type`, `function __uc_fw_to_gt`, `function xe_uc_fw_change_status`, `function uc_fw_auto_select`, `function uc_fw_override`, `function xe_uc_fw_copy_rsa`, `function uc_fw_fini`, `function guc_read_css_info`, `function xe_uc_fw_check_version_requirements`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.