Lines Matching full:pxp
27 is_fw_err_platform_config(struct intel_pxp *pxp, u32 type) in is_fw_err_platform_config() argument
33 pxp->platform_cfg_is_bad = true; in is_fw_err_platform_config()
58 static int intel_pxp_tee_io_message(struct intel_pxp *pxp, in intel_pxp_tee_io_message() argument
63 struct drm_i915_private *i915 = pxp->ctrl_gt->i915; in intel_pxp_tee_io_message()
64 struct i915_pxp_component *pxp_component = pxp->pxp_component; in intel_pxp_tee_io_message()
67 mutex_lock(&pxp->tee_mutex); in intel_pxp_tee_io_message()
81 drm_err(&i915->drm, "Failed to send PXP TEE message\n"); in intel_pxp_tee_io_message()
88 drm_err(&i915->drm, "Failed to receive PXP TEE message\n"); in intel_pxp_tee_io_message()
94 "Failed to receive PXP TEE message due to unexpected output size\n"); in intel_pxp_tee_io_message()
104 mutex_unlock(&pxp->tee_mutex); in intel_pxp_tee_io_message()
108 int intel_pxp_tee_stream_message(struct intel_pxp *pxp, in intel_pxp_tee_stream_message() argument
115 struct drm_i915_private *i915 = pxp->ctrl_gt->i915; in intel_pxp_tee_stream_message()
116 struct i915_pxp_component *pxp_component = pxp->pxp_component; in intel_pxp_tee_stream_message()
124 mutex_lock(&pxp->tee_mutex); in intel_pxp_tee_stream_message()
131 GEM_BUG_ON(!pxp->stream_cmd.obj); in intel_pxp_tee_stream_message()
133 sg = i915_gem_object_get_sg_dma(pxp->stream_cmd.obj, 0, &offset); in intel_pxp_tee_stream_message()
135 memcpy(pxp->stream_cmd.vaddr, msg_in, msg_in_len); in intel_pxp_tee_stream_message()
140 drm_err(&i915->drm, "Failed to send PXP TEE gsc command\n"); in intel_pxp_tee_stream_message()
142 memcpy(msg_out, pxp->stream_cmd.vaddr, msg_out_len); in intel_pxp_tee_stream_message()
145 mutex_unlock(&pxp->tee_mutex); in intel_pxp_tee_stream_message()
163 struct intel_pxp *pxp = i915->pxp; in i915_pxp_tee_component_bind() local
164 struct intel_gt *gt = pxp->ctrl_gt; in i915_pxp_tee_component_bind()
170 pxp->dev_link = device_link_add(i915_kdev, tee_kdev, DL_FLAG_STATELESS); in i915_pxp_tee_component_bind()
171 if (drm_WARN_ON(&i915->drm, !pxp->dev_link)) in i915_pxp_tee_component_bind()
175 mutex_lock(&pxp->tee_mutex); in i915_pxp_tee_component_bind()
176 pxp->pxp_component = data; in i915_pxp_tee_component_bind()
177 pxp->pxp_component->tee_dev = tee_kdev; in i915_pxp_tee_component_bind()
178 mutex_unlock(&pxp->tee_mutex); in i915_pxp_tee_component_bind()
182 /* load huc via pxp */ in i915_pxp_tee_component_bind()
194 /* the component is required to fully start the PXP HW */ in i915_pxp_tee_component_bind()
195 if (intel_pxp_is_enabled(pxp)) in i915_pxp_tee_component_bind()
196 intel_pxp_init_hw(pxp); in i915_pxp_tee_component_bind()
207 struct intel_pxp *pxp = i915->pxp; in i915_pxp_tee_component_unbind() local
210 if (intel_pxp_is_enabled(pxp)) in i915_pxp_tee_component_unbind()
212 intel_pxp_fini_hw(pxp); in i915_pxp_tee_component_unbind()
214 mutex_lock(&pxp->tee_mutex); in i915_pxp_tee_component_unbind()
215 pxp->pxp_component = NULL; in i915_pxp_tee_component_unbind()
216 mutex_unlock(&pxp->tee_mutex); in i915_pxp_tee_component_unbind()
218 if (pxp->dev_link) { in i915_pxp_tee_component_unbind()
219 device_link_del(pxp->dev_link); in i915_pxp_tee_component_unbind()
220 pxp->dev_link = NULL; in i915_pxp_tee_component_unbind()
229 static int alloc_streaming_command(struct intel_pxp *pxp) in alloc_streaming_command() argument
231 struct drm_i915_private *i915 = pxp->ctrl_gt->i915; in alloc_streaming_command()
236 pxp->stream_cmd.obj = NULL; in alloc_streaming_command()
237 pxp->stream_cmd.vaddr = NULL; in alloc_streaming_command()
242 /* allocate lmem object of one page for PXP command memory and store it */ in alloc_streaming_command()
245 drm_err(&i915->drm, "Failed to allocate pxp streaming command!\n"); in alloc_streaming_command()
257 intel_gt_coherent_map_type(pxp->ctrl_gt, in alloc_streaming_command()
267 pxp->stream_cmd.obj = obj; in alloc_streaming_command()
268 pxp->stream_cmd.vaddr = cmd; in alloc_streaming_command()
279 static void free_streaming_command(struct intel_pxp *pxp) in free_streaming_command() argument
281 struct drm_i915_gem_object *obj = fetch_and_zero(&pxp->stream_cmd.obj); in free_streaming_command()
291 int intel_pxp_tee_component_init(struct intel_pxp *pxp) in intel_pxp_tee_component_init() argument
294 struct intel_gt *gt = pxp->ctrl_gt; in intel_pxp_tee_component_init()
297 ret = alloc_streaming_command(pxp); in intel_pxp_tee_component_init()
304 drm_err(&i915->drm, "Failed to add PXP component (%d)\n", ret); in intel_pxp_tee_component_init()
308 pxp->pxp_component_added = true; in intel_pxp_tee_component_init()
313 free_streaming_command(pxp); in intel_pxp_tee_component_init()
317 void intel_pxp_tee_component_fini(struct intel_pxp *pxp) in intel_pxp_tee_component_fini() argument
319 struct drm_i915_private *i915 = pxp->ctrl_gt->i915; in intel_pxp_tee_component_fini()
321 if (!pxp->pxp_component_added) in intel_pxp_tee_component_fini()
325 pxp->pxp_component_added = false; in intel_pxp_tee_component_fini()
327 free_streaming_command(pxp); in intel_pxp_tee_component_fini()
330 int intel_pxp_tee_cmd_create_arb_session(struct intel_pxp *pxp, in intel_pxp_tee_cmd_create_arb_session() argument
333 struct drm_i915_private *i915 = pxp->ctrl_gt->i915; in intel_pxp_tee_cmd_create_arb_session()
344 ret = intel_pxp_tee_io_message(pxp, in intel_pxp_tee_cmd_create_arb_session()
352 if (is_fw_err_platform_config(pxp, msg_out.header.status)) { in intel_pxp_tee_cmd_create_arb_session()
354 "PXP init-arb-session-%d failed due to BIOS/SOC:0x%08x:%s\n", in intel_pxp_tee_cmd_create_arb_session()
358 drm_dbg(&i915->drm, "PXP init-arb-session--%d failed 0x%08x:%st:\n", in intel_pxp_tee_cmd_create_arb_session()
369 void intel_pxp_tee_end_arb_fw_session(struct intel_pxp *pxp, u32 session_id) in intel_pxp_tee_end_arb_fw_session() argument
371 struct drm_i915_private *i915 = pxp->ctrl_gt->i915; in intel_pxp_tee_end_arb_fw_session()
387 ret = intel_pxp_tee_io_message(pxp, in intel_pxp_tee_end_arb_fw_session()
400 if (is_fw_err_platform_config(pxp, msg_out.header.status)) { in intel_pxp_tee_end_arb_fw_session()
402 "PXP inv-stream-key-%u failed due to BIOS/SOC :0x%08x:%s\n", in intel_pxp_tee_end_arb_fw_session()
406 drm_dbg(&i915->drm, "PXP inv-stream-key-%u failed 0x%08x:%s:\n", in intel_pxp_tee_end_arb_fw_session()