[PATCH 4/6] hab: pass flags to lockdown_device()
Sascha Hauer
s.hauer at pengutronix.de
Tue Feb 13 07:17:42 PST 2024
On i.MX93 there is no way to write fuses temporarily, so we have to
make sure the user really wants to write the fuses permanently. Do
this by passing flags containing IMX_SRK_HASH_WRITE_PERMANENT to the
lockdown_device hook.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/hab/hab.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/hab/hab.c b/drivers/hab/hab.c
index a85bbae6d6..d7be3c49eb 100644
--- a/drivers/hab/hab.c
+++ b/drivers/hab/hab.c
@@ -96,7 +96,7 @@ static int imx_hab_permanent_write_enable_iim(int enable)
return imx_iim_permanent_write(enable);
}
-static int imx_hab_lockdown_device_iim(void)
+static int imx_hab_lockdown_device_iim(unsigned flags)
{
return imx_iim_write_field(IMX25_IIM_HAB_TYPE, 3);
}
@@ -152,7 +152,7 @@ static int imx_hab_permanent_write_enable_ocotp(int enable)
return imx_ocotp_permanent_write(enable);
}
-static int imx6_hab_lockdown_device_ocotp(void)
+static int imx6_hab_lockdown_device_ocotp(unsigned flags)
{
int ret;
@@ -163,7 +163,7 @@ static int imx6_hab_lockdown_device_ocotp(void)
return imx_ocotp_write_field(OCOTP_SEC_CONFIG_1, 1);
}
-static int imx8m_hab_lockdown_device_ocotp(void)
+static int imx8m_hab_lockdown_device_ocotp(unsigned flags)
{
int ret;
@@ -206,7 +206,7 @@ struct imx_hab_ops {
int (*write_srk_hash)(const u8 *srk, unsigned flags);
int (*read_srk_hash)(u8 *srk);
int (*permanent_write_enable)(int enable);
- int (*lockdown_device)(void);
+ int (*lockdown_device)(unsigned flags);
int (*device_locked_down)(void);
int (*print_status)(void);
};
@@ -372,7 +372,7 @@ int imx_hab_lockdown_device(unsigned flags)
return ret;
}
- ret = ops->lockdown_device();
+ ret = ops->lockdown_device(flags);
if (flags & IMX_SRK_HASH_WRITE_PERMANENT)
ops->permanent_write_enable(0);
--
2.39.2
More information about the barebox
mailing list