summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan O'Donoghue <[email protected]>2018-01-12 12:39:55 +0000
committerStefano Babic <[email protected]>2018-01-14 17:26:30 +0100
commitadbb051f0897f5b41e9514ca4f974738396be6d6 (patch)
tree88a14e1bbb6f50cf4dd4107d440e051d80075787
parentedc57f1df8973e296e213819568ac116def0066a (diff)
arm: imx: hab: Make authenticate_image return int
Both usages of authenticate_image treat the result code as a simple binary. The command line usage of authenticate_image directly returns the result code of authenticate_image as a success/failure code. Right now when calling hab_auth_img and test the result code in a shell a passing hab_auth_img will appear to the shell as a fail. The first step in fixing this behaviour is to fix-up the result code return by authenticate_image() itself, subsequent patches fix the interpretation of authenticate_image so that zero will return CMD_RET_SUCCESS and non-zero will return CMD_RET_FAILURE. The first step is fixing the return type in authenticate_image() so do that now. Signed-off-by: Bryan O'Donoghue <[email protected]> Cc: Stefano Babic <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: Peng Fan <[email protected]> Cc: Albert Aribaud <[email protected]> Cc: Sven Ebenfeld <[email protected]> Cc: George McCollister <[email protected]> Cc: Breno Matheus Lima <[email protected]> Tested-by: Breno Lima <[email protected]> Reviewed-by: Fabio Estevam <[email protected]>
-rw-r--r--arch/arm/include/asm/mach-imx/hab.h2
-rw-r--r--arch/arm/mach-imx/hab.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/include/asm/mach-imx/hab.h b/arch/arm/include/asm/mach-imx/hab.h
index e0ff459d53f..1b7a5e44409 100644
--- a/arch/arm/include/asm/mach-imx/hab.h
+++ b/arch/arm/include/asm/mach-imx/hab.h
@@ -145,6 +145,6 @@ typedef void hapi_clock_init_t(void);
/* ----------- end of HAB API updates ------------*/
-uint32_t authenticate_image(uint32_t ddr_start, uint32_t image_size);
+int authenticate_image(uint32_t ddr_start, uint32_t image_size);
#endif
diff --git a/arch/arm/mach-imx/hab.c b/arch/arm/mach-imx/hab.c
index 02c7ae4e725..09892a68404 100644
--- a/arch/arm/mach-imx/hab.c
+++ b/arch/arm/mach-imx/hab.c
@@ -410,7 +410,7 @@ static bool is_hab_enabled(void)
return (reg & IS_HAB_ENABLED_BIT) == IS_HAB_ENABLED_BIT;
}
-uint32_t authenticate_image(uint32_t ddr_start, uint32_t image_size)
+int authenticate_image(uint32_t ddr_start, uint32_t image_size)
{
uint32_t load_addr = 0;
size_t bytes;