|
@@ -225,19 +225,22 @@ void intel_huc_init_hw(struct intel_huc *huc)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * intel_guc_auth_huc() - authenticate ucode
|
|
|
- * @dev_priv: the drm_i915_device
|
|
|
+ * intel_huc_auth() - Authenticate HuC uCode
|
|
|
+ * @huc: intel_huc structure
|
|
|
+ *
|
|
|
+ * Called after HuC and GuC firmware loading during intel_uc_init_hw().
|
|
|
*
|
|
|
- * Triggers a HuC fw authentication request to the GuC via intel_guc_action_
|
|
|
- * authenticate_huc interface.
|
|
|
+ * This function pins HuC firmware image object into GGTT.
|
|
|
+ * Then it invokes GuC action to authenticate passing the offset to RSA
|
|
|
+ * signature through intel_guc_auth_huc(). It then waits for 50ms for
|
|
|
+ * firmware verification ACK and unpins the object.
|
|
|
*/
|
|
|
-void intel_guc_auth_huc(struct drm_i915_private *dev_priv)
|
|
|
+void intel_huc_auth(struct intel_huc *huc)
|
|
|
{
|
|
|
- struct intel_guc *guc = &dev_priv->guc;
|
|
|
- struct intel_huc *huc = &dev_priv->huc;
|
|
|
+ struct drm_i915_private *i915 = huc_to_i915(huc);
|
|
|
+ struct intel_guc *guc = &i915->guc;
|
|
|
struct i915_vma *vma;
|
|
|
int ret;
|
|
|
- u32 data[2];
|
|
|
|
|
|
if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
|
|
|
return;
|
|
@@ -250,23 +253,19 @@ void intel_guc_auth_huc(struct drm_i915_private *dev_priv)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- /* Specify auth action and where public signature is. */
|
|
|
- data[0] = INTEL_GUC_ACTION_AUTHENTICATE_HUC;
|
|
|
- data[1] = guc_ggtt_offset(vma) + huc->fw.rsa_offset;
|
|
|
-
|
|
|
- ret = intel_guc_send(guc, data, ARRAY_SIZE(data));
|
|
|
+ ret = intel_guc_auth_huc(guc,
|
|
|
+ guc_ggtt_offset(vma) + huc->fw.rsa_offset);
|
|
|
if (ret) {
|
|
|
DRM_ERROR("HuC: GuC did not ack Auth request %d\n", ret);
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
/* Check authentication status, it should be done by now */
|
|
|
- ret = intel_wait_for_register(dev_priv,
|
|
|
- HUC_STATUS2,
|
|
|
- HUC_FW_VERIFIED,
|
|
|
- HUC_FW_VERIFIED,
|
|
|
- 50);
|
|
|
-
|
|
|
+ ret = intel_wait_for_register(i915,
|
|
|
+ HUC_STATUS2,
|
|
|
+ HUC_FW_VERIFIED,
|
|
|
+ HUC_FW_VERIFIED,
|
|
|
+ 50);
|
|
|
if (ret) {
|
|
|
DRM_ERROR("HuC: Authentication failed %d\n", ret);
|
|
|
goto out;
|
|
@@ -275,4 +274,3 @@ void intel_guc_auth_huc(struct drm_i915_private *dev_priv)
|
|
|
out:
|
|
|
i915_vma_unpin(vma);
|
|
|
}
|
|
|
-
|