Part Number: AM625
Tool/software:
Hi ,
I have been trying to develop field-upgrade the KEYREV value on a secure device for the scenario where we need to invalidate the primary key.
I have created the user-land code to make the call, and that communicates with a PTA that I have created; and in turn, the PTA makes a call into the plat-k3 driver.
The 'stock' plat-k3 driver doesn't have a routine for calling the TI_SCI_MSG_WRITE_KEYREV function, so I have 'rolled my own' .
I have created the certificate as described in Run time read/write to KEYREV and SWREV — TISCI User Guide, and I have checked the parameters as best I can - but I always get an error , attaching log below.
So what am I missing, please ?
Attaching log driver fragment below,
Error log below
---------------------------------------------------------
D/TC:? 0 ti_sci_set_keyrev:494 inside ti_sci_set_keyrev
F/TC:? 0 k3_sec_proxy_send:131 Verifying the thread
F/TC:? 0 k3_sec_proxy_verify_thread:71 Check for thread corruption
F/TC:? 0 k3_sec_proxy_verify_thread:88 Check for thread direction
F/TC:? 0 k3_sec_proxy_verify_thread:100 Check for thread queue
F/TC:? 0 k3_sec_proxy_verify_thread:113 Success
F/TC:? 0 k3_sec_proxy_recv:193 Verifying thread
F/TC:? 0 k3_sec_proxy_verify_thread:71 Check for thread corruption
F/TC:? 0 k3_sec_proxy_verify_thread:88 Check for thread direction
F/TC:? 0 k3_sec_proxy_verify_thread:100 Check for thread queue
F/TC:? 0 k3_sec_proxy_verify_thread:113 Success
D/TC:? 0 ti_sci_get_response:120 Message not acknowledged
D/TC:? 0 ti_sci_set_keyrev:510 ti_sci_do_xfer failed ffff0001
D/TC:? 0 write_otp_keyrev:140 ti_sci_set_keyrev ffff0001
D/TC:? 0 tee_ta_invoke_command:788 Error: ffff0001 of 4
otpread: F/TC:? 0 plat_prng_add_jitter_entropy:72 0xB7
Invoke command failed with code 0xffff0001 origin 0x4
D/TC:? 0 tee_ta_close_session:460 csess 0x9e8958a0 id 2
D/TC:? 0 tee_ta_close_session:479 Destroy session
---------------------------------------------------->
int ti_sci_set_keyrev(uint32_t key_rev, uint32_t cert_addr_lo, uint32_t cert_addr_hi)
{
struct ti_sci_msg_req_set_keyrev req = { };
struct ti_sci_msg_resp_set_keyrev resp = { };
struct ti_sci_xfer xfer = { };
int ret = 0;
DMSG("inside ti_sci_set_keyrev");
ret = ti_sci_setup_xfer(TI_SCI_MSG_WRITE_KEYREV, 0,
&req, sizeof(req), &resp, sizeof(resp), &xfer);
if (ret) {
DMSG("ti_sci_setup_xfer failed %x", ret);
return ret;
}
req.value = key_rev;
req.cert_addr_lo = cert_addr_lo;
req.cert_addr_hi = cert_addr_hi;
ret = ti_sci_do_xfer(&xfer);
if (ret) {
DMSG("ti_sci_do_xfer failed %x", ret);
return ret;
}
memzero_explicit(&resp, sizeof(resp));
memzero_explicit(&req, sizeof(req));
return ret;
/*@rj*/
}
Regards,
-RJ