opteed: pass device tree pointer in x2
Pass device tree pointer to OP-TEE in x2. bl2 is expected to fill in the device tree pointer in args.arg3. Passing 0 means that device tree is unavailable. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
This commit is contained in:
parent
ccdbae7198
commit
19911aa6fe
|
@ -20,7 +20,7 @@
|
||||||
void opteed_init_optee_ep_state(struct entry_point_info *optee_entry_point,
|
void opteed_init_optee_ep_state(struct entry_point_info *optee_entry_point,
|
||||||
uint32_t rw, uint64_t pc,
|
uint32_t rw, uint64_t pc,
|
||||||
uint64_t pageable_part, uint64_t mem_limit,
|
uint64_t pageable_part, uint64_t mem_limit,
|
||||||
optee_context_t *optee_ctx)
|
uint64_t dt_addr, optee_context_t *optee_ctx)
|
||||||
{
|
{
|
||||||
uint32_t ep_attr;
|
uint32_t ep_attr;
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_entry_point,
|
||||||
zeromem(&optee_entry_point->args, sizeof(optee_entry_point->args));
|
zeromem(&optee_entry_point->args, sizeof(optee_entry_point->args));
|
||||||
optee_entry_point->args.arg0 = pageable_part;
|
optee_entry_point->args.arg0 = pageable_part;
|
||||||
optee_entry_point->args.arg1 = mem_limit;
|
optee_entry_point->args.arg1 = mem_limit;
|
||||||
|
optee_entry_point->args.arg2 = dt_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
|
|
|
@ -96,6 +96,7 @@ int32_t opteed_setup(void)
|
||||||
uint32_t linear_id;
|
uint32_t linear_id;
|
||||||
uint64_t opteed_pageable_part;
|
uint64_t opteed_pageable_part;
|
||||||
uint64_t opteed_mem_limit;
|
uint64_t opteed_mem_limit;
|
||||||
|
uint64_t dt_addr;
|
||||||
|
|
||||||
linear_id = plat_my_core_pos();
|
linear_id = plat_my_core_pos();
|
||||||
|
|
||||||
|
@ -120,19 +121,17 @@ int32_t opteed_setup(void)
|
||||||
if (!optee_ep_info->pc)
|
if (!optee_ep_info->pc)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/*
|
|
||||||
* We could inspect the SP image and determine it's execution
|
|
||||||
* state i.e whether AArch32 or AArch64.
|
|
||||||
*/
|
|
||||||
opteed_rw = optee_ep_info->args.arg0;
|
opteed_rw = optee_ep_info->args.arg0;
|
||||||
opteed_pageable_part = optee_ep_info->args.arg1;
|
opteed_pageable_part = optee_ep_info->args.arg1;
|
||||||
opteed_mem_limit = optee_ep_info->args.arg2;
|
opteed_mem_limit = optee_ep_info->args.arg2;
|
||||||
|
dt_addr = optee_ep_info->args.arg3;
|
||||||
|
|
||||||
opteed_init_optee_ep_state(optee_ep_info,
|
opteed_init_optee_ep_state(optee_ep_info,
|
||||||
opteed_rw,
|
opteed_rw,
|
||||||
optee_ep_info->pc,
|
optee_ep_info->pc,
|
||||||
opteed_pageable_part,
|
opteed_pageable_part,
|
||||||
opteed_mem_limit,
|
opteed_mem_limit,
|
||||||
|
dt_addr,
|
||||||
&opteed_sp_context[linear_id]);
|
&opteed_sp_context[linear_id]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -99,7 +99,7 @@ static void opteed_cpu_on_finish_handler(uint64_t unused)
|
||||||
|
|
||||||
opteed_init_optee_ep_state(&optee_on_entrypoint, opteed_rw,
|
opteed_init_optee_ep_state(&optee_on_entrypoint, opteed_rw,
|
||||||
(uint64_t)&optee_vectors->cpu_on_entry,
|
(uint64_t)&optee_vectors->cpu_on_entry,
|
||||||
0, 0, optee_ctx);
|
0, 0, 0, optee_ctx);
|
||||||
|
|
||||||
/* Initialise this cpu's secure context */
|
/* Initialise this cpu's secure context */
|
||||||
cm_init_my_context(&optee_on_entrypoint);
|
cm_init_my_context(&optee_on_entrypoint);
|
||||||
|
|
|
@ -149,6 +149,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_ep,
|
||||||
uint64_t pc,
|
uint64_t pc,
|
||||||
uint64_t pageable_part,
|
uint64_t pageable_part,
|
||||||
uint64_t mem_limit,
|
uint64_t mem_limit,
|
||||||
|
uint64_t dt_addr,
|
||||||
optee_context_t *optee_ctx);
|
optee_context_t *optee_ctx);
|
||||||
|
|
||||||
extern optee_context_t opteed_sp_context[OPTEED_CORE_COUNT];
|
extern optee_context_t opteed_sp_context[OPTEED_CORE_COUNT];
|
||||||
|
|
Loading…
Reference in New Issue