mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-02 23:44:15 +01:00
ipq807x: scm: Make SCM calls dcache aware
U-Boot now has dcache turned on. This requires cache flushing to be performed before executing smc instrution. There are calls which are made to TZ with huge buffer (such as kernel image for authentication). Flushing and invalidating by address for such huge buffer will have a performance impact, as the size of buffer is vastly bigger than the cache size itself. Hence performing a flush of the entire cache as opposed to performing cache flush with a start and end address. Change-Id: If90a49d240ecf021ac9714025b6de0cce3fb9fc8 Signed-off-by: Manoharan Vijaya Raghavan <mraghava@codeaurora.org>
This commit is contained in:
parent
a660845646
commit
94d2909503
2 changed files with 10 additions and 2 deletions
|
|
@ -274,9 +274,13 @@ void invalidate_dcache_all(void)
|
|||
*/
|
||||
void flush_dcache_all(void)
|
||||
{
|
||||
v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL);
|
||||
int dstatus = dcache_status();
|
||||
|
||||
v7_outer_cache_flush_all();
|
||||
if (dstatus)
|
||||
{
|
||||
v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL);
|
||||
v7_outer_cache_flush_all();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -287,12 +287,14 @@ static int scm_call_64(u32 svc_id, u32 cmd_id, struct qca_scm_desc *desc)
|
|||
|
||||
desc->ret[0] = desc->ret[1] = desc->ret[2] = 0;
|
||||
|
||||
flush_dcache_all();
|
||||
ret = __qca_scm_call_armv8_32(fn_id, desc->arginfo,
|
||||
desc->args[0], desc->args[1],
|
||||
desc->args[2], desc->x5,
|
||||
&desc->ret[0], &desc->ret[1],
|
||||
&desc->ret[2]);
|
||||
|
||||
invalidate_dcache_all();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -320,8 +322,10 @@ bool is_scm_armv8(void)
|
|||
x0 = QCA_SCM_SIP_FNID(SCM_SVC_INFO, QCA_IS_CALL_AVAIL_CMD) |
|
||||
QCA_SMC_ATOMIC_MASK;
|
||||
|
||||
flush_dcache_all();
|
||||
ret = __qca_scm_call_armv8_32(x0, QCA_SCM_ARGS(1), x0, 0, 0, 0,
|
||||
&ret1, NULL, NULL);
|
||||
invalidate_dcache_all();
|
||||
if (ret || !ret1)
|
||||
scm_version = SCM_LEGACY;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue