summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorAntonio Niño Díaz <antonio.ninodiaz@arm.com>2019-02-06 10:20:25 +0000
committerGitHub <noreply@github.com>2019-02-06 10:20:25 +0000
commit30490b15fef50900acac0f23a528651c24759e7d (patch)
treeff3f53537201d7f7324a1db26982ca7a438472bd /services
parentd636f67e60d65a0eaa5f7d5588ace3f6f3d66563 (diff)
parenta474d3d700bcf4ff2c19694521e41c960b6cc091 (diff)
Merge pull request #1785 from vwadekar/tf2.0-tegra-downstream-rebase-1.25.19
Tf2.0 tegra downstream rebase 1.25.19
Diffstat (limited to 'services')
-rw-r--r--services/spd/tlkd/tlkd_common.c1
-rw-r--r--services/spd/tlkd/tlkd_main.c15
-rw-r--r--services/spd/trusty/trusty.c28
3 files changed, 30 insertions, 14 deletions
diff --git a/services/spd/tlkd/tlkd_common.c b/services/spd/tlkd/tlkd_common.c
index 2f0194eb..dbe6c2e3 100644
--- a/services/spd/tlkd/tlkd_common.c
+++ b/services/spd/tlkd/tlkd_common.c
@@ -126,7 +126,6 @@ uint64_t tlkd_synchronous_sp_entry(tlk_context_t *tlk_ctx)
/* Passing a NULL context is a critical programming error */
assert(tlk_ctx);
- assert(tlk_ctx->c_rt_ctx == 0);
/* Apply the Secure EL1 system register context and switch to it */
assert(cm_get_context(SECURE) == &tlk_ctx->cpu_ctx);
diff --git a/services/spd/tlkd/tlkd_main.c b/services/spd/tlkd/tlkd_main.c
index b1a04776..f6f2af52 100644
--- a/services/spd/tlkd/tlkd_main.c
+++ b/services/spd/tlkd/tlkd_main.c
@@ -195,14 +195,18 @@ static uintptr_t tlkd_smc_handler(uint32_t smc_fid,
* b. register shared memory with the SP for passing args
* required for maintaining sessions with the Trusted
* Applications.
- * c. register non-secure world's memory map with the OS
- * d. open/close sessions
- * e. issue commands to the Trusted Apps
- * f. resume the preempted yielding SMC call.
+ * c. register shared persistent buffers for secure storage
+ * d. register NS DRAM ranges passed by Cboot
+ * e. register Root of Trust parameters from Cboot for Verified Boot
+ * f. open/close sessions
+ * g. issue commands to the Trusted Apps
+ * h. resume the preempted yielding SMC call.
*/
case TLK_REGISTER_LOGBUF:
case TLK_REGISTER_REQBUF:
- case TLK_REGISTER_NS_DRAM:
+ case TLK_SS_REGISTER_HANDLER:
+ case TLK_REGISTER_NS_DRAM_RANGES:
+ case TLK_SET_ROOT_OF_TRUST:
case TLK_OPEN_TA_SESSION:
case TLK_CLOSE_TA_SESSION:
case TLK_TA_LAUNCH_OP:
@@ -400,6 +404,7 @@ static uintptr_t tlkd_smc_handler(uint32_t smc_fid,
SMC_RET2(handle, TLK_VERSION_MAJOR, TLK_VERSION_MINOR);
default:
+ WARN("%s: Unhandled SMC: 0x%x\n", __func__, smc_fid);
break;
}
diff --git a/services/spd/trusty/trusty.c b/services/spd/trusty/trusty.c
index 83c14b49..b059a435 100644
--- a/services/spd/trusty/trusty.c
+++ b/services/spd/trusty/trusty.c
@@ -7,6 +7,7 @@
#include <assert.h>
#include <stdbool.h>
#include <string.h>
+#include <xlat_tables_v2.h>
#include <arch_helpers.h>
#include <bl31/bl31.h>
@@ -352,32 +353,32 @@ static void trusty_cpu_resume(uint32_t on)
}
}
-static int32_t trusty_cpu_off_handler(u_register_t unused)
+static int32_t trusty_cpu_off_handler(u_register_t max_off_lvl)
{
- trusty_cpu_suspend(1);
+ trusty_cpu_suspend(max_off_lvl);
return 0;
}
-static void trusty_cpu_on_finish_handler(u_register_t unused)
+static void trusty_cpu_on_finish_handler(u_register_t max_off_lvl)
{
struct trusty_cpu_ctx *ctx = get_trusty_ctx();
if (ctx->saved_sp == NULL) {
(void)trusty_init();
} else {
- trusty_cpu_resume(1);
+ trusty_cpu_resume(max_off_lvl);
}
}
-static void trusty_cpu_suspend_handler(u_register_t unused)
+static void trusty_cpu_suspend_handler(u_register_t max_off_lvl)
{
- trusty_cpu_suspend(0);
+ trusty_cpu_suspend(max_off_lvl);
}
-static void trusty_cpu_suspend_finish_handler(u_register_t unused)
+static void trusty_cpu_suspend_finish_handler(u_register_t max_off_lvl)
{
- trusty_cpu_resume(0);
+ trusty_cpu_resume(max_off_lvl);
}
static const spd_pm_ops_t trusty_pm = {
@@ -412,6 +413,14 @@ static int32_t trusty_setup(void)
return -1;
}
+ /* memmap first page of trusty's code memory before peeking */
+ ret = mmap_add_dynamic_region(ep_info->pc, /* PA */
+ ep_info->pc, /* VA */
+ PAGE_SIZE, /* size */
+ MT_SECURE | MT_RW_DATA); /* attrs */
+ assert(ret == 0);
+
+ /* peek into trusty's code to see if we have a 32-bit or 64-bit image */
instr = *(uint32_t *)ep_info->pc;
if (instr >> 24 == 0xeaU) {
@@ -424,6 +433,9 @@ static int32_t trusty_setup(void)
return -1;
}
+ /* unmap trusty's memory page */
+ (void)mmap_remove_dynamic_region(ep_info->pc, PAGE_SIZE);
+
SET_PARAM_HEAD(ep_info, PARAM_EP, VERSION_1, SECURE | EP_ST_ENABLE);
if (!aarch32)
ep_info->spsr = SPSR_64(MODE_EL1, MODE_SP_ELX,