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

zynqmp: Add new API for processing secure images



This patch adds new API for processing secure images. This API
is used for authentication and decryption of secure images using
xilsecure in pmufw.
Signed-off-by: default avatarSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
parent 7dae6137
...@@ -1152,3 +1152,17 @@ enum pm_ret_status pm_rsa_core(uint32_t address_high, ...@@ -1152,3 +1152,17 @@ enum pm_ret_status pm_rsa_core(uint32_t address_high,
size, flags); size, flags);
return pm_ipi_send_sync(primary_proc, payload, NULL, 0); return pm_ipi_send_sync(primary_proc, payload, NULL, 0);
} }
enum pm_ret_status pm_secure_image(uint32_t address_low,
uint32_t address_high,
uint32_t key_lo,
uint32_t key_hi,
uint32_t *value)
{
uint32_t payload[PAYLOAD_ARG_CNT];
/* Send request to the PMU */
PM_PACK_PAYLOAD5(payload, PM_SECURE_IMAGE, address_high, address_low,
key_hi, key_lo);
return pm_ipi_send_sync(primary_proc, payload, value, 2);
}
...@@ -160,4 +160,9 @@ enum pm_ret_status pm_rsa_core(uint32_t address_high, ...@@ -160,4 +160,9 @@ enum pm_ret_status pm_rsa_core(uint32_t address_high,
uint32_t address_low, uint32_t address_low,
uint32_t size, uint32_t size,
uint32_t flags); uint32_t flags);
enum pm_ret_status pm_secure_image(uint32_t address_low,
uint32_t address_high,
uint32_t key_lo,
uint32_t key_hi,
uint32_t *value);
#endif /* _PM_API_SYS_H_ */ #endif /* _PM_API_SYS_H_ */
...@@ -88,6 +88,7 @@ enum pm_api_id { ...@@ -88,6 +88,7 @@ enum pm_api_id {
PM_CLOCK_GETRATE, PM_CLOCK_GETRATE,
PM_CLOCK_SETPARENT, PM_CLOCK_SETPARENT,
PM_CLOCK_GETPARENT, PM_CLOCK_GETPARENT,
PM_SECURE_IMAGE,
PM_API_MAX PM_API_MAX
}; };
......
...@@ -381,6 +381,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, ...@@ -381,6 +381,16 @@ uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,
pm_arg[3]); pm_arg[3]);
SMC_RET1(handle, (uint64_t)ret); SMC_RET1(handle, (uint64_t)ret);
case PM_SECURE_IMAGE:
{
uint32_t result[2];
ret = pm_secure_image(pm_arg[0], pm_arg[1], pm_arg[2],
pm_arg[3], &result[0]);
SMC_RET2(handle, (uint64_t)ret | ((uint64_t)result[0] << 32),
result[1]);
}
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