2022-04-02 18:12:00 +05:00
|
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
/*
|
|
|
|
* Copyright © 2014-2019 Intel Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INTEL_HUC_H_
|
|
|
|
#define _INTEL_HUC_H_
|
|
|
|
|
2022-05-12 10:47:00 -07:00
|
|
|
#include "i915_reg_defs.h"
|
2022-04-02 18:12:00 +05:00
|
|
|
#include "intel_uc_fw.h"
|
|
|
|
#include "intel_huc_fw.h"
|
|
|
|
|
|
|
|
struct intel_huc {
|
|
|
|
/* Generic uC firmware management */
|
|
|
|
struct intel_uc_fw fw;
|
|
|
|
|
|
|
|
/* HuC-specific additions */
|
|
|
|
struct {
|
|
|
|
i915_reg_t reg;
|
|
|
|
u32 mask;
|
|
|
|
u32 value;
|
|
|
|
} status;
|
|
|
|
};
|
|
|
|
|
|
|
|
void intel_huc_init_early(struct intel_huc *huc);
|
|
|
|
int intel_huc_init(struct intel_huc *huc);
|
|
|
|
void intel_huc_fini(struct intel_huc *huc);
|
|
|
|
int intel_huc_auth(struct intel_huc *huc);
|
|
|
|
int intel_huc_check_status(struct intel_huc *huc);
|
2022-09-13 23:14:27 +05:00
|
|
|
void intel_huc_update_auth_status(struct intel_huc *huc);
|
2022-04-02 18:12:00 +05:00
|
|
|
|
|
|
|
static inline int intel_huc_sanitize(struct intel_huc *huc)
|
|
|
|
{
|
|
|
|
intel_uc_fw_sanitize(&huc->fw);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool intel_huc_is_supported(struct intel_huc *huc)
|
|
|
|
{
|
|
|
|
return intel_uc_fw_is_supported(&huc->fw);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool intel_huc_is_wanted(struct intel_huc *huc)
|
|
|
|
{
|
|
|
|
return intel_uc_fw_is_enabled(&huc->fw);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline bool intel_huc_is_used(struct intel_huc *huc)
|
|
|
|
{
|
|
|
|
GEM_BUG_ON(__intel_uc_fw_status(&huc->fw) == INTEL_UC_FIRMWARE_SELECTED);
|
|
|
|
return intel_uc_fw_is_available(&huc->fw);
|
|
|
|
}
|
|
|
|
|
2022-09-13 23:14:27 +05:00
|
|
|
static inline bool intel_huc_is_loaded_by_gsc(const struct intel_huc *huc)
|
2022-04-02 18:12:00 +05:00
|
|
|
{
|
2022-09-13 23:14:27 +05:00
|
|
|
return huc->fw.loaded_via_gsc;
|
2022-04-02 18:12:00 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p);
|
|
|
|
|
|
|
|
#endif
|