mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-01 23:52:05 +01:00
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 <aalonso@freescale.com>
This commit is contained in:
parent
bb955146f0
commit
fba6f9efa4
@ -5,6 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <config.h>
|
||||||
|
#include <fuse.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
#include <asm/system.h>
|
#include <asm/system.h>
|
||||||
#include <asm/arch/clock.h>
|
#include <asm/arch/clock.h>
|
||||||
@ -260,11 +262,16 @@ uint8_t hab_engines[16] = {
|
|||||||
|
|
||||||
bool is_hab_enabled(void)
|
bool is_hab_enabled(void)
|
||||||
{
|
{
|
||||||
struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
|
struct imx_sec_config_fuse_t *fuse =
|
||||||
struct fuse_bank *bank = &ocotp->bank[0];
|
(struct imx_sec_config_fuse_t *)&imx_sec_config_fuse;
|
||||||
struct fuse_bank0_regs *fuse =
|
uint32_t reg;
|
||||||
(struct fuse_bank0_regs *)bank->fuse_regs;
|
int ret;
|
||||||
uint32_t reg = readl(&fuse->cfg5);
|
|
||||||
|
ret = fuse_read(fuse->bank, fuse->word, ®);
|
||||||
|
if (ret) {
|
||||||
|
puts("\nSecure boot fuse read error\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return (reg & 0x2) == 0x2;
|
return (reg & 0x2) == 0x2;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user