Lines Matching full:gsc

40 bool intel_gsc_uc_fw_proxy_init_done(struct intel_gsc_uc *gsc, bool needs_wakeref)  in intel_gsc_uc_fw_proxy_init_done()  argument
43 gsc_uc_get_fw_status(gsc_uc_to_gt(gsc)->uncore, in intel_gsc_uc_fw_proxy_init_done()
48 int intel_gsc_uc_fw_proxy_get_status(struct intel_gsc_uc *gsc) in intel_gsc_uc_fw_proxy_get_status() argument
52 if (!intel_uc_fw_is_loadable(&gsc->fw)) in intel_gsc_uc_fw_proxy_get_status()
54 if (__intel_uc_fw_status(&gsc->fw) == INTEL_UC_FIRMWARE_LOAD_FAIL) in intel_gsc_uc_fw_proxy_get_status()
56 if (!intel_gsc_uc_fw_proxy_init_done(gsc, true)) in intel_gsc_uc_fw_proxy_get_status()
62 bool intel_gsc_uc_fw_init_done(struct intel_gsc_uc *gsc) in intel_gsc_uc_fw_init_done() argument
64 return gsc_uc_get_fw_status(gsc_uc_to_gt(gsc)->uncore, false) & in intel_gsc_uc_fw_init_done()
75 struct intel_gsc_uc *gsc = container_of(gsc_fw, struct intel_gsc_uc, fw); in intel_gsc_fw_get_binary_info() local
76 struct intel_gt *gt = gsc_uc_to_gt(gsc); in intel_gsc_fw_get_binary_info()
88 gt_err(gt, "GSC FW too small! %zu < %zu\n", size, min_size); in intel_gsc_fw_get_binary_info()
93 * The GSC binary starts with the pointer layout, which contains the in intel_gsc_fw_get_binary_info()
144 gt_err(gt, "GSC FW too small for boot section! %zu < %zu\n", in intel_gsc_fw_get_binary_info()
151 gt_err(gt, "GSC FW boot section too small for BPDT header: %u < %zu\n", in intel_gsc_fw_get_binary_info()
165 gt_err(gt, "GSC FW boot section too small for BPDT entries: %u < %zu\n", in intel_gsc_fw_get_binary_info()
182 gt_err(gt, "couldn't find CPD header in GSC binary!\n"); in intel_gsc_fw_get_binary_info()
187 gt_err(gt, "GSC FW boot section too small for CPD header: %u < %zu\n", in intel_gsc_fw_get_binary_info()
193 gt_err(gt, "invalid marker for CPD header in GSC bin: 0x%08x!\n", in intel_gsc_fw_get_binary_info()
200 gt_err(gt, "GSC FW boot section too small for CPD entries: %u < %zu\n", in intel_gsc_fw_get_binary_info()
209 intel_uc_fw_version_from_gsc_manifest(&gsc->release, in intel_gsc_fw_get_binary_info()
211 gsc->security_version = manifest->security_version; in intel_gsc_fw_get_binary_info()
220 * is found, then just don't use GSC rather than aborting the driver load. in intel_gsc_fw_get_binary_info()
221 * Note that the major number in the GSC FW version is used to indicate in intel_gsc_fw_get_binary_info()
229 if (IS_METEORLAKE(gt->i915) && gsc->release.major != 102) { in intel_gsc_fw_get_binary_info()
230 gt_info(gt, "Invalid GSC firmware for MTL/ARL, got %d.%d.%d.%d but need 102.x.x.x", in intel_gsc_fw_get_binary_info()
231 gsc->release.major, gsc->release.minor, in intel_gsc_fw_get_binary_info()
232 gsc->release.patch, gsc->release.build); in intel_gsc_fw_get_binary_info()
239 if (gsc->release.minor < min_ver.minor) { in intel_gsc_fw_get_binary_info()
241 } else if (gsc->release.minor == min_ver.minor) { in intel_gsc_fw_get_binary_info()
242 if (gsc->release.patch < min_ver.patch) { in intel_gsc_fw_get_binary_info()
244 } else if (gsc->release.patch == min_ver.patch) { in intel_gsc_fw_get_binary_info()
245 if (gsc->release.build < min_ver.build) in intel_gsc_fw_get_binary_info()
251 gt_info(gt, "GSC firmware too old for ARL, got %d.%d.%d.%d but need at least %d.%d.%d.%d", in intel_gsc_fw_get_binary_info()
252 gsc->release.major, gsc->release.minor, in intel_gsc_fw_get_binary_info()
253 gsc->release.patch, gsc->release.build, in intel_gsc_fw_get_binary_info()
263 static int emit_gsc_fw_load(struct i915_request *rq, struct intel_gsc_uc *gsc) in emit_gsc_fw_load() argument
265 u32 offset = i915_ggtt_offset(gsc->local); in emit_gsc_fw_load()
275 *cs++ = (gsc->local->size / SZ_4K) | HECI1_FW_LIMIT_VALID; in emit_gsc_fw_load()
282 static int gsc_fw_load(struct intel_gsc_uc *gsc) in gsc_fw_load() argument
284 struct intel_context *ce = gsc->ce; in gsc_fw_load()
301 err = emit_gsc_fw_load(rq, gsc); in gsc_fw_load()
321 gt_err(gsc_uc_to_gt(gsc), "Request submission for GSC load failed %pe\n", in gsc_fw_load()
327 static int gsc_fw_load_prepare(struct intel_gsc_uc *gsc) in gsc_fw_load_prepare() argument
329 struct intel_gt *gt = gsc_uc_to_gt(gsc); in gsc_fw_load_prepare()
332 if (!gsc->local) in gsc_fw_load_prepare()
335 if (gsc->local->size < gsc->fw.size) in gsc_fw_load_prepare()
338 src = i915_gem_object_pin_map_unlocked(gsc->fw.obj, in gsc_fw_load_prepare()
339 intel_gt_coherent_map_type(gt, gsc->fw.obj, true)); in gsc_fw_load_prepare()
343 memcpy_toio(gsc->local_vaddr, src, gsc->fw.size); in gsc_fw_load_prepare()
344 memset_io(gsc->local_vaddr + gsc->fw.size, 0, gsc->local->size - gsc->fw.size); in gsc_fw_load_prepare()
348 i915_gem_object_unpin_map(gsc->fw.obj); in gsc_fw_load_prepare()
389 static int gsc_fw_query_compatibility_version(struct intel_gsc_uc *gsc) in gsc_fw_query_compatibility_version() argument
391 struct intel_gt *gt = gsc_uc_to_gt(gsc); in gsc_fw_query_compatibility_version()
402 gt_err(gt, "failed to allocate vma for GSC version query\n"); in gsc_fw_query_compatibility_version()
416 err = intel_gsc_uc_heci_cmd_submit_packet(&gt->uc.gsc, in gsc_fw_query_compatibility_version()
423 "failed to submit GSC request for compatibility version: %d\n", in gsc_fw_query_compatibility_version()
429 gt_err(gt, "invalid GSC reply length %u [expected %zu], s=0x%x, f=0x%x, r=0x%x\n", in gsc_fw_query_compatibility_version()
436 gsc->fw.file_selected.ver.major = msg_out->compat_major; in gsc_fw_query_compatibility_version()
437 gsc->fw.file_selected.ver.minor = msg_out->compat_minor; in gsc_fw_query_compatibility_version()
444 int intel_gsc_uc_fw_upload(struct intel_gsc_uc *gsc) in intel_gsc_uc_fw_upload() argument
446 struct intel_gt *gt = gsc_uc_to_gt(gsc); in intel_gsc_uc_fw_upload()
447 struct intel_uc_fw *gsc_fw = &gsc->fw; in intel_gsc_uc_fw_upload()
451 if (intel_gsc_uc_fw_init_done(gsc)) { in intel_gsc_uc_fw_upload()
461 intel_uc_fw_sanitize(&gsc->fw); in intel_gsc_uc_fw_upload()
466 err = gsc_fw_load_prepare(gsc); in intel_gsc_uc_fw_upload()
471 * GSC is only killed by an FLR, so we need to trigger one on unload to in intel_gsc_uc_fw_upload()
473 * the GSC as part of the FW load , so we need to make sure it stops in intel_gsc_uc_fw_upload()
475 * this is not a problem of the unload per-se, because the GSC will not in intel_gsc_uc_fw_upload()
478 * but if we re-load the driver then the GSC might wake up and try to in intel_gsc_uc_fw_upload()
486 * GSC loaded across reloads. However, this requires us to make sure we in intel_gsc_uc_fw_upload()
493 err = gsc_fw_load(gsc); in intel_gsc_uc_fw_upload()
501 err = gsc_fw_query_compatibility_version(gsc); in intel_gsc_uc_fw_upload()
513 gt_info(gt, "Loaded GSC firmware %s (cv%u.%u, r%u.%u.%u.%u, svn %u)\n", in intel_gsc_uc_fw_upload()
516 gsc->release.major, gsc->release.minor, in intel_gsc_uc_fw_upload()
517 gsc->release.patch, gsc->release.build, in intel_gsc_uc_fw_upload()
518 gsc->security_version); in intel_gsc_uc_fw_upload()