From: Fabian Pflug <f.pflug@pengutronix.de>
To: Marco Felsch <m.felsch@pengutronix.de>,
BAREBOX <barebox@lists.infradead.org>,
Lucas Stach <l.stach@pengutronix.de>,
Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Fabian Pflug <f.pflug@pengutronix.de>
Subject: [PATCH v3 2/5] nvmem: ocotp: extend support to query the sticky bit
Date: Fri, 19 Dec 2025 11:49:00 +0100 [thread overview]
Message-ID: <20251219-v2025-11-0-topic-imx6-field-return-v3-2-690fdeb78978@pengutronix.de> (raw)
In-Reply-To: <20251219-v2025-11-0-topic-imx6-field-return-v3-0-690fdeb78978@pengutronix.de>
The i.MX* devices do have an sticky bit which indicates if the
field-return fuse can be written. Before only support for i.MX8* was
provided. Extend this for the i.MX6* series.
Since i.MX8 and i.MX6 share the same code, rename
imx8m_field_return_locked to imx_field_return_locked to not confuse the
user.
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Fabian Pflug <f.pflug@pengutronix.de>
---
drivers/nvmem/ocotp.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvmem/ocotp.c b/drivers/nvmem/ocotp.c
index 7bca275404..1f74fddb60 100644
--- a/drivers/nvmem/ocotp.c
+++ b/drivers/nvmem/ocotp.c
@@ -294,7 +294,7 @@ static void imx8m_lock_srk_revoke(struct ocotp_priv *priv)
writel(val, priv->base + OCOTP_SW_STICKY);
}
-static bool imx8m_field_return_locked(struct ocotp_priv *priv)
+static bool imx_field_return_locked(struct ocotp_priv *priv)
{
return readl(priv->base + OCOTP_SW_STICKY) & OCOTP_SW_STICKY_FIELD_RETURN_LOCK;
}
@@ -990,6 +990,7 @@ static struct imx_ocotp_data imx6q_ocotp_data = {
.fuse_blow = imx6_fuse_blow_addr,
.fuse_read = imx6_fuse_read_addr,
.ctrl = &ocotp_ctrl_reg_default,
+ .field_return_locked = imx_field_return_locked,
};
static struct imx_ocotp_data imx6sl_ocotp_data = {
@@ -1002,6 +1003,7 @@ static struct imx_ocotp_data imx6sl_ocotp_data = {
.fuse_blow = imx6_fuse_blow_addr,
.fuse_read = imx6_fuse_read_addr,
.ctrl = &ocotp_ctrl_reg_default,
+ .field_return_locked = imx_field_return_locked,
};
static struct imx_ocotp_data imx6ul_ocotp_data = {
@@ -1014,6 +1016,7 @@ static struct imx_ocotp_data imx6ul_ocotp_data = {
.fuse_blow = imx6_fuse_blow_addr,
.fuse_read = imx6_fuse_read_addr,
.ctrl = &ocotp_ctrl_reg_default,
+ .field_return_locked = imx_field_return_locked,
};
static struct imx_ocotp_data imx6ull_ocotp_data = {
@@ -1026,6 +1029,7 @@ static struct imx_ocotp_data imx6ull_ocotp_data = {
.fuse_blow = imx6_fuse_blow_addr,
.fuse_read = imx6_fuse_read_addr,
.ctrl = &ocotp_ctrl_reg_default,
+ .field_return_locked = imx_field_return_locked,
};
static struct imx_ocotp_data vf610_ocotp_data = {
@@ -1063,7 +1067,7 @@ static struct imx_ocotp_data imx8mp_ocotp_data = {
.fuse_read = imx6_fuse_read_addr,
.srk_revoke_locked = imx8m_srk_revoke_locked,
.lock_srk_revoke = imx8m_lock_srk_revoke,
- .field_return_locked = imx8m_field_return_locked,
+ .field_return_locked = imx_field_return_locked,
.ctrl = &ocotp_ctrl_reg_8mp,
};
@@ -1095,7 +1099,7 @@ static struct imx_ocotp_data imx8mm_ocotp_data = {
.fuse_read = imx6_fuse_read_addr,
.srk_revoke_locked = imx8m_srk_revoke_locked,
.lock_srk_revoke = imx8m_lock_srk_revoke,
- .field_return_locked = imx8m_field_return_locked,
+ .field_return_locked = imx_field_return_locked,
.feat = &imx8mm_featctrl_data,
.ctrl = &ocotp_ctrl_reg_default,
};
@@ -1116,7 +1120,7 @@ static struct imx_ocotp_data imx8mn_ocotp_data = {
.fuse_read = imx6_fuse_read_addr,
.srk_revoke_locked = imx8m_srk_revoke_locked,
.lock_srk_revoke = imx8m_lock_srk_revoke,
- .field_return_locked = imx8m_field_return_locked,
+ .field_return_locked = imx_field_return_locked,
.feat = &imx8mn_featctrl_data,
.ctrl = &ocotp_ctrl_reg_default,
};
--
2.47.3
next prev parent reply other threads:[~2025-12-19 10:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 10:48 [PATCH v3 0/5] i.mx: hab/ocotop: extend field return to i.MX6 Fabian Pflug
2025-12-19 10:48 ` [PATCH v3 1/5] arm: mach-imx6: use kconfig for field return Fabian Pflug
2025-12-19 10:49 ` Fabian Pflug [this message]
2025-12-19 10:49 ` [PATCH v3 3/5] i.MX: HAB: extend field_return support to imx6 Fabian Pflug
2025-12-19 10:49 ` [PATCH v3 4/5] commands: hab: extend by field_return fuse burn Fabian Pflug
2025-12-19 10:49 ` [PATCH v3 5/5] i.MX: HAB: fix field return unlock fuse uid Fabian Pflug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251219-v2025-11-0-topic-imx6-field-return-v3-2-690fdeb78978@pengutronix.de \
--to=f.pflug@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=l.stach@pengutronix.de \
--cc=m.felsch@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox