#include <linux/bitfield.h>
#include <linux/firmware.h>
#include <linux/highmem.h>
#include <drm/drm_cache.h>
#include <drm/drm_print.h>
#include "gem/i915_gem_lmem.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_print.h"
#include "intel_gsc_binary_headers.h"
#include "intel_gsc_fw.h"
#include "intel_uc_fw.h"
#include "intel_uc_fw_abi.h"
#include "i915_drv.h"
#include "i915_reg.h"
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
#define UNEXPECTED …
#else
#define UNEXPECTED …
#endif
static inline struct intel_gt *
____uc_fw_to_gt(struct intel_uc_fw *uc_fw, enum intel_uc_fw_type type)
{ … }
static inline struct intel_gt *__uc_fw_to_gt(struct intel_uc_fw *uc_fw)
{ … }
#ifdef CONFIG_DRM_I915_DEBUG_GUC
void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_status status)
{ … }
#endif
#define INTEL_GUC_FIRMWARE_DEFS(fw_def, guc_maj, guc_mmp) …
#define INTEL_HUC_FIRMWARE_DEFS(fw_def, huc_raw, huc_mmp, huc_gsc) …
#define INTEL_GSC_FIRMWARE_DEFS(fw_def, gsc_def) …
#define __MAKE_UC_FW_PATH_BLANK(prefix_, name_) …
#define __MAKE_UC_FW_PATH_MAJOR(prefix_, name_, major_) …
#define __MAKE_UC_FW_PATH_MMP(prefix_, name_, major_, minor_, patch_) …
#define MAKE_GUC_FW_PATH_MAJOR(prefix_, major_, minor_, patch_) …
#define MAKE_GUC_FW_PATH_MMP(prefix_, major_, minor_, patch_) …
#define MAKE_HUC_FW_PATH_BLANK(prefix_) …
#define MAKE_HUC_FW_PATH_GSC(prefix_) …
#define MAKE_HUC_FW_PATH_MMP(prefix_, major_, minor_, patch_) …
#define MAKE_GSC_FW_PATH(prefix_, major_, minor_) …
#define INTEL_UC_MODULE_FW(platform_, revid_, uc_) …
INTEL_GUC_FIRMWARE_DEFS(…)
INTEL_HUC_FIRMWARE_DEFS(…)
INTEL_GSC_FIRMWARE_DEFS(…)
struct __packed uc_fw_blob { … };
#define UC_FW_BLOB_BASE(major_, minor_, patch_, path_) …
#define UC_FW_BLOB_NEW(major_, minor_, patch_, gsc_, path_) …
#define UC_FW_BLOB_OLD(major_, minor_, patch_, path_) …
#define GUC_FW_BLOB(prefix_, major_, minor_, patch_) …
#define GUC_FW_BLOB_MMP(prefix_, major_, minor_, patch_) …
#define HUC_FW_BLOB(prefix_) …
#define HUC_FW_BLOB_MMP(prefix_, major_, minor_, patch_) …
#define HUC_FW_BLOB_GSC(prefix_) …
#define GSC_FW_BLOB(prefix_, major_, minor_) …
struct __packed uc_fw_platform_requirement { … };
#define MAKE_FW_LIST(platform_, revid_, uc_) …
struct fw_blobs_by_type { … };
static const struct uc_fw_platform_requirement blobs_guc[] = …;
static const struct uc_fw_platform_requirement blobs_huc[] = …;
static const struct uc_fw_platform_requirement blobs_gsc[] = …;
static const struct fw_blobs_by_type blobs_all[INTEL_UC_FW_NUM_TYPES] = …;
static void
__uc_fw_auto_select(struct drm_i915_private *i915, struct intel_uc_fw *uc_fw)
{ … }
static bool validate_fw_table_type(struct drm_i915_private *i915, enum intel_uc_fw_type type)
{ … }
static const char *__override_guc_firmware_path(struct drm_i915_private *i915)
{ … }
static const char *__override_huc_firmware_path(struct drm_i915_private *i915)
{ … }
static const char *__override_gsc_firmware_path(struct drm_i915_private *i915)
{ … }
static void __uc_fw_user_override(struct drm_i915_private *i915, struct intel_uc_fw *uc_fw)
{ … }
void intel_uc_fw_version_from_gsc_manifest(struct intel_uc_fw_ver *ver,
const void *data)
{ … }
void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_type type,
bool needs_ggtt_mapping)
{ … }
static void __force_fw_fetch_failures(struct intel_uc_fw *uc_fw, int e)
{ … }
static void uc_unpack_css_version(struct intel_uc_fw_ver *ver, u32 css_value)
{ … }
static void guc_read_css_info(struct intel_uc_fw *uc_fw, struct uc_css_header *css)
{ … }
static int __check_ccs_header(struct intel_gt *gt,
const void *fw_data, size_t fw_size,
struct intel_uc_fw *uc_fw)
{ … }
static int check_gsc_manifest(struct intel_gt *gt,
const struct firmware *fw,
struct intel_uc_fw *uc_fw)
{ … }
static int check_ccs_header(struct intel_gt *gt,
const struct firmware *fw,
struct intel_uc_fw *uc_fw)
{ … }
static bool is_ver_8bit(struct intel_uc_fw_ver *ver)
{ … }
static int guc_check_version_range(struct intel_uc_fw *uc_fw)
{ … }
static int check_fw_header(struct intel_gt *gt,
const struct firmware *fw,
struct intel_uc_fw *uc_fw)
{ … }
static int try_firmware_load(struct intel_uc_fw *uc_fw, const struct firmware **fw)
{ … }
static int check_mtl_huc_guc_compatibility(struct intel_gt *gt,
struct intel_uc_fw_file *huc_selected)
{ … }
int intel_uc_check_file_version(struct intel_uc_fw *uc_fw, bool *old_ver)
{ … }
int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw)
{ … }
static u32 uc_fw_ggtt_offset(struct intel_uc_fw *uc_fw)
{ … }
static void uc_fw_bind_ggtt(struct intel_uc_fw *uc_fw)
{ … }
static void uc_fw_unbind_ggtt(struct intel_uc_fw *uc_fw)
{ … }
static int uc_fw_xfer(struct intel_uc_fw *uc_fw, u32 dst_offset, u32 dma_flags)
{ … }
int intel_uc_fw_mark_load_failed(struct intel_uc_fw *uc_fw, int err)
{ … }
int intel_uc_fw_upload(struct intel_uc_fw *uc_fw, u32 dst_offset, u32 dma_flags)
{ … }
static inline bool uc_fw_need_rsa_in_memory(struct intel_uc_fw *uc_fw)
{ … }
static int uc_fw_rsa_data_create(struct intel_uc_fw *uc_fw)
{ … }
static void uc_fw_rsa_data_destroy(struct intel_uc_fw *uc_fw)
{ … }
int intel_uc_fw_init(struct intel_uc_fw *uc_fw)
{ … }
void intel_uc_fw_fini(struct intel_uc_fw *uc_fw)
{ … }
void intel_uc_fw_resume_mapping(struct intel_uc_fw *uc_fw)
{ … }
void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw)
{ … }
size_t intel_uc_fw_copy_rsa(struct intel_uc_fw *uc_fw, void *dst, u32 max_len)
{ … }
void intel_uc_fw_dump(const struct intel_uc_fw *uc_fw, struct drm_printer *p)
{ … }