arm: imx: hab: Make imx_hab_is_enabled global
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Fri, 12 Jan 2018 12:40:16 +0000 (12:40 +0000)
committerStefano Babic <sbabic@denx.de>
Sun, 14 Jan 2018 16:26:30 +0000 (17:26 +0100)
It will be helpful to boot commands to know if the HAB is enabled. Export
imx_hab_is_enabled() now to facilitate further work with this data-point in
a secure-boot context.

Signed-off-by: Bryan 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: Breno Lima <breno.lima@nxp.com>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
arch/arm/include/asm/mach-imx/hab.h
arch/arm/mach-imx/hab.c

index 98bc1bdc65e7011ca0162df3e7839c2329bf64d8..5c13aff1d5b1889b682c509f73edab273a883915 100644 (file)
@@ -187,5 +187,6 @@ typedef void hapi_clock_init_t(void);
 
 int imx_hab_authenticate_image(uint32_t ddr_start, uint32_t image_size,
                               uint32_t ivt_offset);
+bool imx_hab_is_enabled(void);
 
 #endif
index 3b19a7e57365bc3a7dc7196d0675888b8f962a1c..d1c5f696815cdbb519b1a40c0d95cf0c263d428f 100644 (file)
@@ -96,8 +96,6 @@ static inline enum hab_status hab_rvt_check_target_new(enum hab_target target,
        (is_soc_type(MXC_SOC_MX7ULP) ? 0x80000000 :     \
         (is_soc_type(MXC_SOC_MX7) ? 0x2000000 : 0x2))
 
-static bool imx_hab_is_enabled(void);
-
 static int ivt_header_error(const char *err_str, struct ivt_header *ivt_hdr)
 {
        printf("%s magic=0x%x length=0x%02x version=0x%x\n", err_str,
@@ -419,7 +417,7 @@ U_BOOT_CMD(
 
 #endif /* !defined(CONFIG_SPL_BUILD) */
 
-static bool imx_hab_is_enabled(void)
+bool imx_hab_is_enabled(void)
 {
        struct imx_sec_config_fuse_t *fuse =
                (struct imx_sec_config_fuse_t *)&imx_sec_config_fuse;