Commit c95b2dfa authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu
Browse files

zynqmp: pm: Added APIs for xilsecure linux support



Added SHA to calculate SHA3 hash,RSA to encrypt data with
public key and decrypt with private key and AES to do symmetric
encryption with User key or device key.
Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
parent 915d4872
...@@ -1138,3 +1138,29 @@ enum pm_ret_status pm_query_data(enum pm_query_id qid, ...@@ -1138,3 +1138,29 @@ enum pm_ret_status pm_query_data(enum pm_query_id qid,
return ret; return ret;
} }
enum pm_ret_status pm_sha_hash(uint32_t address_high,
uint32_t address_low,
uint32_t size,
uint32_t flags)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD5(payload, PM_SECURE_SHA, address_high, address_low,
size, flags);
return pm_ipi_send_sync(primary_proc, payload, NULL, 0);
}
enum pm_ret_status pm_rsa_core(uint32_t address_high,
uint32_t address_low,
uint32_t size,
uint32_t flags)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD5(payload, PM_SECURE_RSA, address_high, address_low,
size, flags);
return pm_ipi_send_sync(primary_proc, payload, NULL, 0);
}
...@@ -153,4 +153,12 @@ enum pm_ret_status pm_query_data(enum pm_query_id qid, ...@@ -153,4 +153,12 @@ enum pm_ret_status pm_query_data(enum pm_query_id qid,
unsigned int arg2, unsigned int arg2,
unsigned int arg3, unsigned int arg3,
unsigned int *data); unsigned int *data);
enum pm_ret_status pm_sha_hash(uint32_t address_high,
uint32_t address_low,
uint32_t size,
uint32_t flags);
enum pm_ret_status pm_rsa_core(uint32_t address_high,
uint32_t address_low,
uint32_t size,
uint32_t flags);
#endif /* _PM_API_SYS_H_ */ #endif /* _PM_API_SYS_H_ */
...@@ -387,6 +387,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -387,6 +387,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
ret = pm_set_suspend_mode(pm_arg[0]); ret = pm_set_suspend_mode(pm_arg[0]);
SMC_RET1(handle, (uint64_t)ret); SMC_RET1(handle, (uint64_t)ret);
case PM_SECURE_SHA:
ret = pm_sha_hash(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3]);
SMC_RET1(handle, (uint64_t)ret);
case PM_SECURE_RSA:
ret = pm_rsa_core(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3]);
SMC_RET1(handle, (uint64_t)ret);
default: default:
WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid); WARN("Unimplemented PM Service Call: 0x%x\n", smc_fid);
SMC_RET1(handle, SMC_UNK); SMC_RET1(handle, SMC_UNK);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment