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
78 /* Proxy init can take up to 500ms, so wait double that for safety */ in xe_gsc_wait_for_proxy_init_done()
112 struct i915_gsc_proxy_component *comp = gsc->proxy.component; in proxy_send_to_csme()
115 ret = comp->ops->send(comp->mei_dev, gsc->proxy.to_csme, size); in proxy_send_to_csme()
117 xe_gt_err(gt, "Failed to send CSME proxy message\n"); in proxy_send_to_csme()
121 ret = comp->ops->recv(comp->mei_dev, gsc->proxy.from_csme, GSC_PROXY_BUFFER_SIZE); in proxy_send_to_csme()
123 xe_gt_err(gt, "Failed to receive CSME proxy message\n"); in proxy_send_to_csme()
133 u64 addr_in = xe_bo_ggtt_addr(gsc->proxy.bo); in proxy_send_to_gsc()
137 /* the message must contain at least the gsc and proxy headers */ in proxy_send_to_gsc()
139 xe_gt_err(gt, "Invalid GSC proxy message size: %u\n", size); in proxy_send_to_gsc()
146 xe_gt_err(gt, "Failed to submit gsc proxy rq (%pe)\n", ERR_PTR(err)); in proxy_send_to_gsc()
192 "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()
224 struct xe_gsc_proxy_header *to_csme_hdr = gsc->proxy.to_csme; in proxy_query()
225 void *to_csme_payload = gsc->proxy.to_csme + PROXY_HDR_SIZE; in proxy_query()
231 wr_offset = xe_gsc_emit_header(xe, &gsc->proxy.to_gsc, 0, in proxy_query()
233 wr_offset = emit_proxy_header(xe, &gsc->proxy.to_gsc, wr_offset); in proxy_query()
242 xe_gsc_poison_header(xe, &gsc->proxy.from_gsc, 0); in proxy_query()
244 /* send proxy message to GSC */ in proxy_query()
250 ret = xe_gsc_read_out_header(xe, &gsc->proxy.from_gsc, 0, in proxy_query()
253 xe_gt_err(gt, "Invalid gsc header in proxy reply (%pe)\n", in proxy_query()
258 /* copy the proxy header reply from GSC */ in proxy_query()
259 xe_map_memcpy_from(xe, to_csme_hdr, &gsc->proxy.from_gsc, in proxy_query()
271 /* make sure the GSC-to-CSME proxy header is sane */ in proxy_query()
277 xe_gt_err(gt, "invalid GSC to CSME proxy header! (%pe)\n", in proxy_query()
284 xe_map_memcpy_from(xe, to_csme_payload, &gsc->proxy.from_gsc, in proxy_query()
292 /* reply size from CSME, including the proxy header */ in proxy_query()
295 xe_gt_err(gt, "CSME to GSC proxy msg too small: 0x%x\n", size); in proxy_query()
300 /* make sure the CSME-to-GSC proxy header is sane */ in proxy_query()
301 ret = validate_proxy_header(gt, gsc->proxy.from_csme, in proxy_query()
306 xe_gt_err(gt, "invalid CSME to GSC proxy header! %d\n", ret); in proxy_query()
311 wr_offset = xe_gsc_emit_header(xe, &gsc->proxy.to_gsc, 0, in proxy_query()
315 xe_map_memcpy_to(xe, &gsc->proxy.to_gsc, wr_offset, gsc->proxy.from_csme, size); in proxy_query()
330 if (!gsc->proxy.component_added) in xe_gsc_proxy_request_handler()
335 if (gsc->proxy.component) in xe_gsc_proxy_request_handler()
341 mutex_lock(&gsc->proxy.mutex); in xe_gsc_proxy_request_handler()
342 if (!gsc->proxy.component) { in xe_gsc_proxy_request_handler()
343 xe_gt_err(gt, "GSC proxy component not bound!\n"); in xe_gsc_proxy_request_handler()
347 * clear the pending interrupt and allow new proxy requests to in xe_gsc_proxy_request_handler()
353 mutex_unlock(&gsc->proxy.mutex); in xe_gsc_proxy_request_handler()
364 if (!gsc->proxy.component) { in xe_gsc_proxy_irq_handler()
365 xe_gt_err(gt, "GSC proxy irq received without the component being bound!\n"); in xe_gsc_proxy_irq_handler()
383 mutex_lock(&gsc->proxy.mutex); in xe_gsc_proxy_component_bind()
384 gsc->proxy.component = data; in xe_gsc_proxy_component_bind()
385 gsc->proxy.component->mei_dev = mei_kdev; in xe_gsc_proxy_component_bind()
386 mutex_unlock(&gsc->proxy.mutex); in xe_gsc_proxy_component_bind()
400 mutex_lock(&gsc->proxy.mutex); in xe_gsc_proxy_component_unbind()
401 gsc->proxy.component = NULL; in xe_gsc_proxy_component_unbind()
402 mutex_unlock(&gsc->proxy.mutex); in xe_gsc_proxy_component_unbind()
428 gsc->proxy.bo = bo; in proxy_channel_alloc()
429 gsc->proxy.to_gsc = IOSYS_MAP_INIT_OFFSET(&bo->vmap, 0); in proxy_channel_alloc()
430 gsc->proxy.from_gsc = IOSYS_MAP_INIT_OFFSET(&bo->vmap, GSC_PROXY_BUFFER_SIZE); in proxy_channel_alloc()
431 gsc->proxy.to_csme = csme; in proxy_channel_alloc()
432 gsc->proxy.from_csme = csme + GSC_PROXY_BUFFER_SIZE; in proxy_channel_alloc()
444 if (!gsc->proxy.component_added) in xe_gsc_proxy_remove()
462 gsc->proxy.component_added = false; in xe_gsc_proxy_remove()
466 * xe_gsc_proxy_init() - init objects and MEI component required by GSC proxy
478 mutex_init(&gsc->proxy.mutex); in xe_gsc_proxy_init()
481 xe_gt_info(gt, "can't init GSC proxy due to missing mei component\n"); in xe_gsc_proxy_init()
487 xe_gt_err(gt, "unexpected GSC proxy init on tile %u\n", tile->id); in xe_gsc_proxy_init()
502 gsc->proxy.component_added = true; in xe_gsc_proxy_init()
508 * xe_gsc_proxy_start() - start the proxy by submitting the first request
511 * Return: 0 if the proxy are now enabled, a negative errno otherwise.
517 /* enable the proxy interrupt in the GSC shim layer */ in xe_gsc_proxy_start()
521 * The handling of the first proxy request must be manually triggered to in xe_gsc_proxy_start()
522 * notify the GSC that we're ready to support the proxy flow. in xe_gsc_proxy_start()
529 xe_gt_err(gsc_to_gt(gsc), "GSC FW reports proxy init not completed\n"); in xe_gsc_proxy_start()