qseecom: Vote for CE clk before loading image

Add support for setting the Crypto HW to operate in
high bandwidth mode before issuing a request to load
image.

This is needed for better performance when using crypto
HW to authenticate the image before loading it.

Change-Id: Ib976d8227e605b9aad8191c6fe8f1dcc5d28e90e
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
This commit is contained in:
Mona Hossain 2012-11-05 13:51:50 -08:00 committed by Iliyan Malchev
parent 2a59c6fb52
commit 5e5949c4f1

View file

@ -1318,6 +1318,15 @@ static int __qseecom_load_fw(struct qseecom_dev_handle *data, char *appname)
/* Populate the remaining parameters */
load_req.qsee_cmd_id = QSEOS_APP_START_COMMAND;
memcpy(load_req.app_name, appname, MAX_APP_NAME_SIZE);
mutex_lock(&app_access_lock);
ret = qsee_vote_for_clock(CLK_SFPB);
if (ret) {
kzfree(img_data);
pr_warning("Unable to vote for SFPB clock");
mutex_unlock(&app_access_lock);
return -EIO;
}
/* SCM_CALL to load the image */
ret = scm_call(SCM_SVC_TZSCHEDULER, 1, &load_req,
sizeof(struct qseecom_load_app_ireq),
@ -1325,6 +1334,8 @@ static int __qseecom_load_fw(struct qseecom_dev_handle *data, char *appname)
kzfree(img_data);
if (ret) {
pr_err("scm_call to load failed : ret %d\n", ret);
qsee_disable_clock_vote(CLK_SFPB);
mutex_unlock(&app_access_lock);
return -EIO;
}
@ -1347,6 +1358,9 @@ static int __qseecom_load_fw(struct qseecom_dev_handle *data, char *appname)
ret = -EINVAL;
break;
}
qsee_disable_clock_vote(CLK_SFPB);
mutex_unlock(&app_access_lock);
return ret;
}