[Intel-xe] [PATCH 12/12] drm/xe/gsc: Define GSC FW for MTL

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Mon Nov 13 21:33:11 UTC 2023



On 11/13/2023 12:26 PM, John Harrison wrote:
> On 10/27/2023 15:29, Daniele Ceraolo Spurio wrote:
>> We track GSC FW based on its compatibility version, which is what
>> determines the interface it supports.
>> Also add a modparam override like the ones for GuC and HuC.
>>
>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
>> Cc: Alan Previn <alan.previn.teres.alexis at intel.com>
>> ---
>>   drivers/gpu/drm/xe/xe_module.c |  5 +++++
>>   drivers/gpu/drm/xe/xe_module.h |  1 +
>>   drivers/gpu/drm/xe/xe_uc_fw.c  | 20 ++++++++++++--------
>>   3 files changed, 18 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_module.c 
>> b/drivers/gpu/drm/xe/xe_module.c
>> index 7194595e7f31..8df7aea64ad5 100644
>> --- a/drivers/gpu/drm/xe/xe_module.c
>> +++ b/drivers/gpu/drm/xe/xe_module.c
>> @@ -41,6 +41,11 @@ module_param_named_unsafe(huc_firmware_path, 
>> xe_huc_firmware_path, charp, 0400);
>>   MODULE_PARM_DESC(huc_firmware_path,
>>            "HuC firmware path to use instead of the default one - 
>> empty string disables");
>>   +char *xe_gsc_firmware_path;
>> +module_param_named_unsafe(gsc_firmware_path, xe_gsc_firmware_path, 
>> charp, 0400);
>> +MODULE_PARM_DESC(huc_firmware_path,
> s/huc/gsc/;

D'oh! Thanks for spotting this.

Daniele

>
> John.
>
>> +         "GSC firmware path to use instead of the default one - 
>> empty string disables");
>> +
>>   char *xe_param_force_probe = CONFIG_DRM_XE_FORCE_PROBE;
>>   module_param_named_unsafe(force_probe, xe_param_force_probe, charp, 
>> 0400);
>>   MODULE_PARM_DESC(force_probe,
>> diff --git a/drivers/gpu/drm/xe/xe_module.h 
>> b/drivers/gpu/drm/xe/xe_module.h
>> index e1da1e9ca5cb..7f49f95630d5 100644
>> --- a/drivers/gpu/drm/xe/xe_module.h
>> +++ b/drivers/gpu/drm/xe/xe_module.h
>> @@ -12,4 +12,5 @@ extern u32 xe_force_vram_bar_size;
>>   extern int xe_guc_log_level;
>>   extern char *xe_guc_firmware_path;
>>   extern char *xe_huc_firmware_path;
>> +extern char *xe_gsc_firmware_path;
>>   extern char *xe_param_force_probe;
>> diff --git a/drivers/gpu/drm/xe/xe_uc_fw.c 
>> b/drivers/gpu/drm/xe/xe_uc_fw.c
>> index f57476f57de9..c9360d918b96 100644
>> --- a/drivers/gpu/drm/xe/xe_uc_fw.c
>> +++ b/drivers/gpu/drm/xe/xe_uc_fw.c
>> @@ -121,6 +121,10 @@ struct fw_blobs_by_type {
>>       fw_def(ROCKETLAKE,    no_ver(i915,    huc, tgl))        \
>>       fw_def(TIGERLAKE,    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(METEORLAKE,    major_ver(i915,    gsc,    mtl,    1, 0))
>> +
>>   #define MAKE_FW_PATH(dir__, uc__, shortname__, version__)            \
>>       __stringify(dir__) "/" __stringify(shortname__) "_" 
>> __stringify(uc__) version__ ".bin"
>>   @@ -155,6 +159,7 @@ XE_GUC_FIRMWARE_DEFS(XE_UC_MODULE_FIRMWARE,
>>                fw_filename_mmp_ver, fw_filename_major_ver)
>>   XE_HUC_FIRMWARE_DEFS(XE_UC_MODULE_FIRMWARE,
>>                fw_filename_mmp_ver, fw_filename_no_ver)
>> +XE_GSC_FIRMWARE_DEFS(XE_UC_MODULE_FIRMWARE, fw_filename_major_ver)
>>     static struct xe_gt *
>>   __uc_fw_to_gt(struct xe_uc_fw *uc_fw, enum xe_uc_fw_type type)
>> @@ -196,23 +201,19 @@ uc_fw_auto_select(struct xe_device *xe, struct 
>> xe_uc_fw *uc_fw)
>>                        uc_fw_entry_mmp_ver,
>>                        uc_fw_entry_no_ver)
>>       };
>> +    static const struct uc_fw_entry entries_gsc[] = {
>> +        XE_GSC_FIRMWARE_DEFS(XE_UC_FW_ENTRY, uc_fw_entry_major_ver)
>> +    };
>>       static const struct fw_blobs_by_type 
>> blobs_all[XE_UC_FW_NUM_TYPES] = {
>>           [XE_UC_FW_TYPE_GUC] = { entries_guc, 
>> ARRAY_SIZE(entries_guc) },
>>           [XE_UC_FW_TYPE_HUC] = { entries_huc, 
>> ARRAY_SIZE(entries_huc) },
>> +        [XE_UC_FW_TYPE_GSC] = { entries_gsc, ARRAY_SIZE(entries_gsc) },
>>       };
>>       static const struct uc_fw_entry *entries;
>>       enum xe_platform p = xe->info.platform;
>>       u32 count;
>>       int i;
>>   -    /*
>> -     * GSC FW support is still not fully in place, so we're not 
>> defining
>> -     * the FW blob yet because we don't want the driver to attempt 
>> to load
>> -     * it until we're ready for it.
>> -     */
>> -    if (uc_fw->type == XE_UC_FW_TYPE_GSC)
>> -        return;
>> -
>>       xe_assert(xe, uc_fw->type < ARRAY_SIZE(blobs_all));
>>       entries = blobs_all[uc_fw->type].entries;
>>       count = blobs_all[uc_fw->type].count;
>> @@ -248,6 +249,9 @@ uc_fw_override(struct xe_uc_fw *uc_fw)
>>       case XE_UC_FW_TYPE_HUC:
>>           path_override = xe_huc_firmware_path;
>>           break;
>> +    case XE_UC_FW_TYPE_GSC:
>> +        path_override = xe_gsc_firmware_path;
>> +        break;
>>       default:
>>           break;
>>       }
>



More information about the Intel-xe mailing list