summaryrefslogtreecommitdiff
path: root/drivers/tee
diff options
context:
space:
mode:
authorCedric Neveux <cedric.neveux@nxp.com>2018-12-17 11:33:10 +0100
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:35:59 +0800
commit41604a3382306b78f1038524a1018647f3cf3f52 (patch)
treed5ccdbbf12f113b3f9d822a60a09e4b7c7fc4fd8 /drivers/tee
parentc7596ecd9ba0e08280f3ce86bb6e9fbfa2a88b91 (diff)
TEE-349 RPC Busfreq High
Call request/release busfreq HIGH each time a SMC is called. This ensure that OPTEE is running in HIGH frequency mode until no more SMC running Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/tee')
-rw-r--r--drivers/tee/optee/call.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/tee/optee/call.c b/drivers/tee/optee/call.c
index f7b7b404c990..c07b654ef797 100644
--- a/drivers/tee/optee/call.c
+++ b/drivers/tee/optee/call.c
@@ -22,6 +22,11 @@
#include "optee_private.h"
#include "optee_smc.h"
+#if defined(CONFIG_SOC_IMX6) || defined(CONFIG_SOC_IMX7) \
+ || (CONFIG_HAVE_IMX8_SOC)
+#include <linux/busfreq-imx.h>
+#endif
+
struct optee_call_waiter {
struct list_head list_node;
struct completion c;
@@ -139,8 +144,19 @@ u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg)
param.a0 = OPTEE_SMC_CALL_WITH_ARG;
reg_pair_from_64(&param.a1, &param.a2, parg);
+
/* Initialize waiter */
optee_cq_wait_init(&optee->call_queue, &w);
+
+#if defined(CONFIG_SOC_IMX6) || defined(CONFIG_SOC_IMX7) \
+ || (CONFIG_HAVE_IMX8_SOC)
+ /*
+ * Request Busfreq to HIGH to prevent DDR self-refresh while
+ * executing Secure stuff
+ */
+ request_bus_freq(BUS_FREQ_HIGH);
+#endif
+
while (true) {
struct arm_smccc_res res;
@@ -166,6 +182,14 @@ u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg)
}
}
+#if defined(CONFIG_SOC_IMX6) || defined(CONFIG_SOC_IMX7) \
+ || (CONFIG_HAVE_IMX8_SOC)
+ /*
+ * Release Busfreq from HIGH
+ */
+ release_bus_freq(BUS_FREQ_HIGH);
+#endif
+
/*
* We're done with our thread in secure world, if there's any
* thread waiters wake up one.