From: Adrian Alonso Date: Mon, 12 Oct 2015 18:48:14 +0000 (-0500) Subject: imx: hab: use read_fuse for secure boot settings X-Git-Tag: v2016.01-rc1~2^2~38 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fba6f9efa4e20a137f1a8121225c5deff4b17300;p=u-boot imx: hab: use read_fuse for secure boot settings Use read_fuse api fuction call to read secure boot fuse settings (enabled/disabled). Signed-off-by: Adrian Alonso --- diff --git a/arch/arm/imx-common/hab.c b/arch/arm/imx-common/hab.c index 9ee0f12a66..277c81ef67 100644 --- a/arch/arm/imx-common/hab.c +++ b/arch/arm/imx-common/hab.c @@ -5,6 +5,8 @@ */ #include +#include +#include #include #include #include @@ -260,11 +262,16 @@ uint8_t hab_engines[16] = { bool is_hab_enabled(void) { - struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; - struct fuse_bank *bank = &ocotp->bank[0]; - struct fuse_bank0_regs *fuse = - (struct fuse_bank0_regs *)bank->fuse_regs; - uint32_t reg = readl(&fuse->cfg5); + struct imx_sec_config_fuse_t *fuse = + (struct imx_sec_config_fuse_t *)&imx_sec_config_fuse; + uint32_t reg; + int ret; + + ret = fuse_read(fuse->bank, fuse->word, ®); + if (ret) { + puts("\nSecure boot fuse read error\n"); + return ret; + } return (reg & 0x2) == 0x2; }