From d97d6a9737a9448e5152f75551aa38772990669a Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Mon, 9 Oct 2023 09:58:02 +0200 Subject: [PATCH] fixup! ta: add the support of the resource table in remoteproc TA - add assert in remoteproc_da_to_pa() function Signed-off-by: Arnaud Pouliquen --- ta/remoteproc/remoteproc_core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ta/remoteproc/remoteproc_core.c b/ta/remoteproc/remoteproc_core.c index bfec5765d28..8cd7fd87a89 100644 --- a/ta/remoteproc/remoteproc_core.c +++ b/ta/remoteproc/remoteproc_core.c @@ -3,6 +3,7 @@ * Copyright (C) 2023, STMicroelectronics */ +#include #include #include #include @@ -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 @@ -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,