[PATCH v3 10/10] hab: lock GP5 on i.MX8MP socs
Stefan Kerkmann
s.kerkmann at pengutronix.de
Thu Jan 23 06:56:15 PST 2025
This change locks down the GP5 eFuses against modification on i.MX8MP
SoCs. To cite the i.MX8MP reference manual (Rev. 3):
The GP5_LOCK eFuse locks the upper 64 bits of the 128-bit UNIQUE_ID
(UID) eFuse field. The users must program the GP5_LOCK eFuse to b'11
(WP+OP), thereby locking the upper 64-bit UID eFuse field. For devices
shipped with date codes 2435 and later, the GP5_LOCK has been
programmed to b'11 by NXP in production. Only devices with date codes
prior to 2435 should be programmed to update the GP5_LOCK eFuse to
b'11.
Signed-off-by: Stefan Kerkmann <s.kerkmann at pengutronix.de>
---
drivers/hab/hab.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/hab/hab.c b/drivers/hab/hab.c
index 0f0c8766f069697944570290cb5796430ddae125..7fb759c152379dda2d43f139baf1aa6cf2051234 100644
--- a/drivers/hab/hab.c
+++ b/drivers/hab/hab.c
@@ -200,11 +200,15 @@ static int imx8m_hab_lockdown_device_ocotp(unsigned flags)
if (ret < 0)
return ret;
- /* Only i.MX8MQ requires fusing of DIR_BT_DIS */
- if (!cpu_is_mx8mq())
- return ret;
+ /* Lock upper 64bit of the 128bit UNIQUE_ID eFuse field on i.MX8MP */
+ if (cpu_is_mx8mp())
+ return imx_ocotp_write_field(MX8MP_OCOTP_GP5_LOCK, 0b11);
- return imx_ocotp_write_field(MX8MQ_OCOTP_DIR_BT_DIS, 1);
+ /* Only i.MX8MQ requires fusing of DIR_BT_DIS */
+ if (cpu_is_mx8mq())
+ return imx_ocotp_write_field(MX8MQ_OCOTP_DIR_BT_DIS, 1);
+
+ return 0;
}
static int imx6_hab_device_locked_down_ocotp(void)
--
2.39.5
More information about the barebox
mailing list