Lines Matching full:proxy

28  * GSC proxy:
32 * GSC to CSME and back. The proxy flow must be manually started after the GSC
36 * The proxy flow is as follow:
38 * 2 - GSC replies with the proxy header + payload for CSME
39 * 3 - Xe sends the reply from GSC as-is to CSME via the mei proxy component
40 * 4 - CSME replies with the proxy header + payload for GSC
101 struct i915_gsc_proxy_component *comp = gsc->proxy.component; in proxy_send_to_csme()
104 ret = comp->ops->send(comp->mei_dev, gsc->proxy.to_csme, size); in proxy_send_to_csme()
106 xe_gt_err(gt, "Failed to send CSME proxy message\n"); in proxy_send_to_csme()
110 ret = comp->ops->recv(comp->mei_dev, gsc->proxy.from_csme, GSC_PROXY_BUFFER_SIZE); in proxy_send_to_csme()
112 xe_gt_err(gt, "Failed to receive CSME proxy message\n"); in proxy_send_to_csme()
122 u64 addr_in = xe_bo_ggtt_addr(gsc->proxy.bo); in proxy_send_to_gsc()
126 /* the message must contain at least the gsc and proxy headers */ in proxy_send_to_gsc()
128 xe_gt_err(gt, "Invalid GSC proxy message size: %u\n", size); in proxy_send_to_gsc()
135 xe_gt_err(gt, "Failed to submit gsc proxy rq (%pe)\n", ERR_PTR(err)); in proxy_send_to_gsc()
181 "GSC proxy error: s=0x%x[0x%x], d=0x%x[0x%x], t=%u, l=0x%x, st=0x%x\n", in validate_proxy_header()
213 struct xe_gsc_proxy_header *to_csme_hdr = gsc->proxy.to_csme; in proxy_query()
214 void *to_csme_payload = gsc->proxy.to_csme + PROXY_HDR_SIZE; in proxy_query()
220 wr_offset = xe_gsc_emit_header(xe, &gsc->proxy.to_gsc, 0, in proxy_query()
222 wr_offset = emit_proxy_header(xe, &gsc->proxy.to_gsc, wr_offset); in proxy_query()
231 xe_gsc_poison_header(xe, &gsc->proxy.from_gsc, 0); in proxy_query()
233 /* send proxy message to GSC */ in proxy_query()
239 ret = xe_gsc_read_out_header(xe, &gsc->proxy.from_gsc, 0, in proxy_query()
242 xe_gt_err(gt, "Invalid gsc header in proxy reply (%pe)\n", in proxy_query()
247 /* copy the proxy header reply from GSC */ in proxy_query()
248 xe_map_memcpy_from(xe, to_csme_hdr, &gsc->proxy.from_gsc, in proxy_query()
260 /* make sure the GSC-to-CSME proxy header is sane */ in proxy_query()
266 xe_gt_err(gt, "invalid GSC to CSME proxy header! (%pe)\n", in proxy_query()
273 xe_map_memcpy_from(xe, to_csme_payload, &gsc->proxy.from_gsc, in proxy_query()
281 /* reply size from CSME, including the proxy header */ in proxy_query()
284 xe_gt_err(gt, "CSME to GSC proxy msg too small: 0x%x\n", size); in proxy_query()
289 /* make sure the CSME-to-GSC proxy header is sane */ in proxy_query()
290 ret = validate_proxy_header(gt, gsc->proxy.from_csme, in proxy_query()
295 xe_gt_err(gt, "invalid CSME to GSC proxy header! %d\n", ret); in proxy_query()
300 wr_offset = xe_gsc_emit_header(xe, &gsc->proxy.to_gsc, 0, in proxy_query()
304 xe_map_memcpy_to(xe, &gsc->proxy.to_gsc, wr_offset, gsc->proxy.from_csme, size); in proxy_query()
319 if (!gsc->proxy.component_added) in xe_gsc_proxy_request_handler()
324 if (gsc->proxy.component) in xe_gsc_proxy_request_handler()
330 mutex_lock(&gsc->proxy.mutex); in xe_gsc_proxy_request_handler()
331 if (!gsc->proxy.component) { in xe_gsc_proxy_request_handler()
332 xe_gt_err(gt, "GSC proxy component not bound!\n"); in xe_gsc_proxy_request_handler()
336 * clear the pending interrupt and allow new proxy requests to in xe_gsc_proxy_request_handler()
342 mutex_unlock(&gsc->proxy.mutex); in xe_gsc_proxy_request_handler()
353 if (!gsc->proxy.component) { in xe_gsc_proxy_irq_handler()
354 xe_gt_err(gt, "GSC proxy irq received without the component being bound!\n"); in xe_gsc_proxy_irq_handler()
372 mutex_lock(&gsc->proxy.mutex); in xe_gsc_proxy_component_bind()
373 gsc->proxy.component = data; in xe_gsc_proxy_component_bind()
374 gsc->proxy.component->mei_dev = mei_kdev; in xe_gsc_proxy_component_bind()
375 mutex_unlock(&gsc->proxy.mutex); in xe_gsc_proxy_component_bind()
389 mutex_lock(&gsc->proxy.mutex); in xe_gsc_proxy_component_unbind()
390 gsc->proxy.component = NULL; in xe_gsc_proxy_component_unbind()
391 mutex_unlock(&gsc->proxy.mutex); in xe_gsc_proxy_component_unbind()
417 gsc->proxy.bo = bo; in proxy_channel_alloc()
418 gsc->proxy.to_gsc = IOSYS_MAP_INIT_OFFSET(&bo->vmap, 0); in proxy_channel_alloc()
419 gsc->proxy.from_gsc = IOSYS_MAP_INIT_OFFSET(&bo->vmap, GSC_PROXY_BUFFER_SIZE); in proxy_channel_alloc()
420 gsc->proxy.to_csme = csme; in proxy_channel_alloc()
421 gsc->proxy.from_csme = csme + GSC_PROXY_BUFFER_SIZE; in proxy_channel_alloc()
427 * xe_gsc_proxy_init() - init objects and MEI component required by GSC proxy
439 mutex_init(&gsc->proxy.mutex); in xe_gsc_proxy_init()
442 xe_gt_info(gt, "can't init GSC proxy due to missing mei component\n"); in xe_gsc_proxy_init()
448 xe_gt_err(gt, "unexpected GSC proxy init on tile %u\n", tile->id); in xe_gsc_proxy_init()
463 gsc->proxy.component_added = true; in xe_gsc_proxy_init()
471 * xe_gsc_proxy_remove() - remove the GSC proxy MEI component
480 if (!gsc->proxy.component_added) in xe_gsc_proxy_remove()
498 gsc->proxy.component_added = false; in xe_gsc_proxy_remove()
502 * xe_gsc_proxy_start() - start the proxy by submitting the first request
505 * Return: 0 if the proxy are now enabled, a negative errno otherwise.
511 /* enable the proxy interrupt in the GSC shim layer */ in xe_gsc_proxy_start()
515 * The handling of the first proxy request must be manually triggered to in xe_gsc_proxy_start()
516 * notify the GSC that we're ready to support the proxy flow. in xe_gsc_proxy_start()
523 xe_gt_err(gsc_to_gt(gsc), "GSC FW reports proxy init not completed\n"); in xe_gsc_proxy_start()