Skip to content

Commit

Permalink
fixup! ta: add the support of the resource table in remoteproc TA
Browse files Browse the repository at this point in the history
- add assert in remoteproc_da_to_pa() function

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
  • Loading branch information
arnopo committed Oct 12, 2023
1 parent 6bc774a commit d97d6a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ta/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2023, STMicroelectronics
*/

#include <assert.h>
#include <elf_parser.h>
#include <remoteproc_pta.h>
#include <string.h>
Expand Down Expand Up @@ -538,6 +539,7 @@ static paddr_t remoteproc_da_to_pa(uint32_t da, size_t size,
TEE_PARAM_TYPE_VALUE_OUTPUT);
TEE_Param params[TEE_NUM_PARAMS] = { };
TEE_Result res = TEE_ERROR_GENERIC;
paddr_t pa = 0;

/*
* The ELF file contains remote processor device addresses, that refer
Expand All @@ -557,7 +559,12 @@ static paddr_t remoteproc_da_to_pa(uint32_t da, size_t size,
return 0;
}

return (paddr_t)reg_pair_to_64(params[3].value.b, params[3].value.a);
pa = (paddr_t)reg_pair_to_64(params[3].value.b, params[3].value.a);

/* On success, assert that the pa address is not 0 */
assert(res != TEE_SUCCESS || pa != 0);

return pa;
}

static TEE_Result remoteproc_parse_rsc_table(struct remoteproc_context *ctx,
Expand Down

0 comments on commit d97d6a9

Please sign in to comment.