summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2024-02-13 16:17:42 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-02-16 12:57:55 +0100
commit948cf279f844afbd301ba28d452cfeeaeaeb5b4c (patch)
tree7fb4dd0829193072d0d1f473027888fcf0d9dda1
parent5b70430c3e798cf997a3fef6c5b0087a4db74821 (diff)
downloadbarebox-948cf279f844.tar.gz
barebox-948cf279f844.tar.xz
hab: pass flags to lockdown_device()
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. Link: https://lore.barebox.org/20240213151744.307958-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/hab/hab.c10
1 files 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);