Skip to content

Commit 0c0cdd7

Browse files
vlubartTomas Winkler
authored andcommitted
igsc: lib: send no update message at the end of firmware update
This message is sent by the SW in order to indicate that no immediate firmware update is expected and the firmware is free to move to the graphics security mode providing all other prerequisites for the transitions are met. There is no response to this message and the device may undergo additional reset. Signed-off-by: Vitaly Lubart <vitaly.lubart@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
1 parent 55d510b commit 0c0cdd7

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

lib/igsc_heci.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,17 @@ struct gsc_fwu_heci_end_resp {
268268
struct gsc_fwu_heci_response response;
269269
};
270270

271+
/**
272+
* @brief firmware no update message
273+
*
274+
* @param header @ref gsc_fwu_heci_header
275+
* @param reserved reserved
276+
*/
277+
struct gsc_fwu_heci_no_update_req {
278+
struct gsc_fwu_heci_header header;
279+
uint32_t reserved;
280+
};
281+
271282
/** @} */
272283

273284
#pragma pack()

lib/igsc_lib.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,43 @@ int gsc_tee_command(struct igsc_lib_ctx *lib_ctx,
559559
return status;
560560
}
561561

562+
static int gsc_send_no_update(struct igsc_lib_ctx *lib_ctx)
563+
{
564+
TEESTATUS tee_status;
565+
int status;
566+
size_t request_len;
567+
struct gsc_fwu_heci_no_update_req *req;
568+
569+
req = (struct gsc_fwu_heci_no_update_req *)lib_ctx->working_buffer;
570+
request_len = sizeof(*req);
571+
572+
status = gsc_fwu_buffer_validate(lib_ctx, request_len, 0);
573+
if (status != IGSC_SUCCESS)
574+
{
575+
return status;
576+
}
577+
578+
memset(req, 0, request_len);
579+
req->header.command_id = GSC_FWU_HECI_COMMAND_ID_NO_UPDATE;
580+
req->reserved = 0;
581+
582+
gsc_debug_hex_dump("Sending:", (unsigned char *)req, request_len);
583+
584+
tee_status = TeeWrite(&lib_ctx->driver_handle, req, request_len, NULL, 0);
585+
if (!TEE_IS_SUCCESS(tee_status))
586+
{
587+
gsc_error("Error in HECI write (%d)\n", tee_status);
588+
status = status_tee2fu(tee_status);
589+
goto exit;
590+
}
591+
592+
status = IGSC_SUCCESS;
593+
594+
exit:
595+
return status;
596+
597+
}
598+
562599
static int gsc_fwu_get_version(struct igsc_lib_ctx *lib_ctx,
563600
uint32_t partition,
564601
uint8_t *version, size_t version_length)
@@ -1373,6 +1410,20 @@ static int gsc_update(IN struct igsc_device_handle *handle,
13731410
if (payload_type == GSC_FWU_HECI_PAYLOAD_TYPE_GFX_FW)
13741411
{
13751412
ret = driver_reconnect(lib_ctx);
1413+
1414+
if (ret == IGSC_SUCCESS)
1415+
{
1416+
/* After the reconnect - send 'no update' message */
1417+
ret = gsc_send_no_update(lib_ctx);
1418+
if (ret != IGSC_SUCCESS)
1419+
{
1420+
gsc_error("failed to send 'no update' message after reset\n");
1421+
}
1422+
}
1423+
else
1424+
{
1425+
gsc_error("failed to reconnect to the driver after reset\n");
1426+
}
13761427
}
13771428

13781429
exit:

0 commit comments

Comments
 (0)