mirror of
https://github.com/torvalds/linux.git
synced 2026-04-24 09:35:52 -04:00
GSC FW is loaded by submitting a dedicated command via the GSC engine.
The memory area used for loading the FW is then re-purposed as local
memory for the GSC itself, so we use a separate allocation instead of
using the one where we keep the firmware stored for reload.
The GSC is not reset as part of GT reset, so we only need to load it on
first boot and S3/S4 exit.
v2: use REG_* for register fields definitions (Rodrigo), move to WQ
immediately
v3: mark worker function as static
Bspec: 63347, 65346
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Alan Previn <alan.previn.teres.alexis@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221208200521.2928378-4-daniele.ceraolospurio@intel.com
48 lines
1.2 KiB
C
48 lines
1.2 KiB
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*/
|
|
|
|
#ifndef _INTEL_GSC_UC_H_
|
|
#define _INTEL_GSC_UC_H_
|
|
|
|
#include "intel_uc_fw.h"
|
|
|
|
struct i915_vma;
|
|
struct intel_context;
|
|
|
|
struct intel_gsc_uc {
|
|
/* Generic uC firmware management */
|
|
struct intel_uc_fw fw;
|
|
|
|
/* GSC-specific additions */
|
|
struct i915_vma *local; /* private memory for GSC usage */
|
|
struct intel_context *ce; /* for submission to GSC FW via GSC engine */
|
|
|
|
struct work_struct work; /* for delayed load */
|
|
};
|
|
|
|
void intel_gsc_uc_init_early(struct intel_gsc_uc *gsc);
|
|
int intel_gsc_uc_init(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_fini(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_suspend(struct intel_gsc_uc *gsc);
|
|
void intel_gsc_uc_load_start(struct intel_gsc_uc *gsc);
|
|
|
|
static inline bool intel_gsc_uc_is_supported(struct intel_gsc_uc *gsc)
|
|
{
|
|
return intel_uc_fw_is_supported(&gsc->fw);
|
|
}
|
|
|
|
static inline bool intel_gsc_uc_is_wanted(struct intel_gsc_uc *gsc)
|
|
{
|
|
return intel_uc_fw_is_enabled(&gsc->fw);
|
|
}
|
|
|
|
static inline bool intel_gsc_uc_is_used(struct intel_gsc_uc *gsc)
|
|
{
|
|
GEM_BUG_ON(__intel_uc_fw_status(&gsc->fw) == INTEL_UC_FIRMWARE_SELECTED);
|
|
return intel_uc_fw_is_available(&gsc->fw);
|
|
}
|
|
|
|
#endif
|