@@ -174,7 +174,7 @@ static void pxp_init_full(struct intel_pxp *pxp)
if (ret)
return;
- ret = intel_pxp_tee_component_init(pxp);
+ ret = intel_pxp_teelink_init(pxp);
if (ret)
goto out_context;
@@ -197,14 +197,14 @@ void intel_pxp_init(struct intel_pxp *pxp)
if (intel_pxp_supported_on_gt(pxp))
pxp_init_full(pxp);
else if (_gt_needs_teelink(gt))
- intel_pxp_tee_component_init(pxp);
+ intel_pxp_teelink_init(pxp);
}
void intel_pxp_fini(struct intel_pxp *pxp)
{
pxp->arb_is_valid = false;
- intel_pxp_tee_component_fini(pxp);
+ intel_pxp_teelink_fini(pxp);
destroy_vcs_context(pxp);
}
@@ -319,3 +319,29 @@ int intel_pxp_tee_cmd_create_arb_session(struct intel_pxp *pxp,
return ret;
}
+
+static bool gt_supports_teelink_via_mei(struct intel_gt *gt)
+{
+ return (IS_ENABLED(CONFIG_INTEL_MEI_PXP) && !HAS_ENGINE(gt, GSC0));
+}
+
+int intel_pxp_teelink_init(struct intel_pxp *pxp)
+{
+ struct intel_gt *gt = pxp_to_gt(pxp);
+ int ret = -ENOLINK;
+
+ if (!gt_supports_teelink_via_mei(gt))
+ return -ENODEV;
+
+ ret = intel_pxp_tee_component_init(pxp);
+ if (ret)
+ drm_warn(>->i915->drm, "Teelink initialization failed with %d\n", ret);
+
+ return ret;
+}
+
+void intel_pxp_teelink_fini(struct intel_pxp *pxp)
+{
+ intel_pxp_tee_component_fini(pxp);
+}
+
@@ -19,4 +19,7 @@ int intel_pxp_tee_stream_message(struct intel_pxp *pxp,
void *msg_in, size_t msg_in_len,
void *msg_out, size_t msg_out_len);
+int intel_pxp_teelink_init(struct intel_pxp *pxp);
+void intel_pxp_teelink_fini(struct intel_pxp *pxp);
+
#endif /* __INTEL_PXP_TEE_H__ */
In preparation of MTL-pxp support, add helper functions to determine if teelink is required and to determine the type of teelink for the current gt-pxp subsystem. Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com> --- drivers/gpu/drm/i915/pxp/intel_pxp.c | 6 +++--- drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 26 ++++++++++++++++++++++++ drivers/gpu/drm/i915/pxp/intel_pxp_tee.h | 3 +++ 3 files changed, 32 insertions(+), 3 deletions(-)