Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f4d3e23 authored by Laura Abbott's avatar Laura Abbott Committed by Divya Sharma
Browse files

qcom: Update early random APIs to scmv8



The scm APIs need an update for v8. Update accordingly.

Change-Id: Ia848af5bafe2337718fffdd87cd6436eb0133ece
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 567dff53
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -36,14 +36,24 @@ void __init init_random_pool(void)
	struct tz_prng_data data;
	int ret;
	u32 resp;
	struct scm_desc desc;

	data.out_buf = (uint8_t *) virt_to_phys(random_buffer);
	data.out_buf_sz = SZ_512;
	desc.args[0] = (unsigned long) data.out_buf;
	desc.args[1] = data.out_buf_sz = SZ_512;
	desc.arginfo = SCM_ARGS(2, SCM_RW, SCM_VAL);

	dmac_flush_range(random_buffer, random_buffer + RANDOM_BUFFER_SIZE);

	if (!is_scm_armv8())
		ret = scm_call_noalloc(TZ_SVC_CRYPTO, PRNG_CMD_ID, &data,
				sizeof(data), &resp, sizeof(resp),
			common_scm_buf, SCM_BUFFER_SIZE(common_scm_buf));
				common_scm_buf,
				SCM_BUFFER_SIZE(common_scm_buf));
	else
		ret = scm_call2(SCM_SIP_FNID(TZ_SVC_CRYPTO, PRNG_CMD_ID),
					&desc);

	if (!ret) {
		dmac_inv_range(random_buffer, random_buffer +
						RANDOM_BUFFER_SIZE);