提交 57f65486 编写于 作者: B Bryan O'Donoghue 提交者: Stefano Babic

arm: imx: hab: Prefix authenticate_image with imx_hab

Tidy up the HAB namespace a bit by prefixing external functions with
imx_hab. All external facing functions past this point will be prefixed in
the same way to make the fact we are doing IMX HAB activities clear from
reading the code. authenticate_image() could mean anything
imx_hab_authenticate_image() is on the other hand very explicit.
Signed-off-by: NBryan O'Donoghue <bryan.odonoghue@linaro.org>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Sven Ebenfeld <sven.ebenfeld@gmail.com>
Cc: George McCollister <george.mccollister@gmail.com>
Cc: Breno Matheus Lima <brenomatheus@gmail.com>
Tested-by: NBreno Lima <breno.lima@nxp.com>
Reviewed-by: NFabio Estevam <fabio.estevam@nxp.com>
上级 58bebfb7
...@@ -185,7 +185,7 @@ typedef void hapi_clock_init_t(void); ...@@ -185,7 +185,7 @@ typedef void hapi_clock_init_t(void);
/* ----------- end of HAB API updates ------------*/ /* ----------- end of HAB API updates ------------*/
int authenticate_image(uint32_t ddr_start, uint32_t image_size, int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
uint32_t ivt_offset); uint32_t ivt_offset);
#endif #endif
...@@ -392,7 +392,7 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc, ...@@ -392,7 +392,7 @@ static int do_authenticate_image(cmd_tbl_t *cmdtp, int flag, int argc,
length = simple_strtoul(argv[2], NULL, 16); length = simple_strtoul(argv[2], NULL, 16);
ivt_offset = simple_strtoul(argv[3], NULL, 16); ivt_offset = simple_strtoul(argv[3], NULL, 16);
rcode = authenticate_image(addr, length, ivt_offset); rcode = imx_hab_authenticate_image(addr, length, ivt_offset);
if (rcode == 0) if (rcode == 0)
rcode = CMD_RET_SUCCESS; rcode = CMD_RET_SUCCESS;
else else
...@@ -435,8 +435,8 @@ static bool is_hab_enabled(void) ...@@ -435,8 +435,8 @@ static bool is_hab_enabled(void)
return (reg & IS_HAB_ENABLED_BIT) == IS_HAB_ENABLED_BIT; return (reg & IS_HAB_ENABLED_BIT) == IS_HAB_ENABLED_BIT;
} }
int authenticate_image(uint32_t ddr_start, uint32_t image_size, int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
uint32_t ivt_offset) uint32_t ivt_offset)
{ {
uint32_t load_addr = 0; uint32_t load_addr = 0;
size_t bytes; size_t bytes;
......
...@@ -199,8 +199,9 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image) ...@@ -199,8 +199,9 @@ __weak void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
/* HAB looks for the CSF at the end of the authenticated data therefore, /* HAB looks for the CSF at the end of the authenticated data therefore,
* we need to subtract the size of the CSF from the actual filesize */ * we need to subtract the size of the CSF from the actual filesize */
offset = spl_image->size - CONFIG_CSF_SIZE; offset = spl_image->size - CONFIG_CSF_SIZE;
if (!authenticate_image(spl_image->load_addr, if (!imx_hab_authenticate_image(spl_image->load_addr,
offset + IVT_SIZE + CSF_PAD_SIZE, offset)) { offset + IVT_SIZE + CSF_PAD_SIZE,
offset)) {
image_entry(); image_entry();
} else { } else {
puts("spl: ERROR: image authentication unsuccessful\n"); puts("spl: ERROR: image authentication unsuccessful\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册