From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH 4/9] nvmem: bsec: call barebox_set_soc_uid()
Date: Thu, 13 Nov 2025 10:34:28 +0100 [thread overview]
Message-ID: <20251113-soc-uid-v1-4-29a256e07144@pengutronix.de> (raw)
In-Reply-To: <20251113-soc-uid-v1-0-29a256e07144@pengutronix.de>
barebox_set_soc_uid() calls barebox_set_soc_uid() the same way as done
previously, but also exposes the SoC ID in the barebox environment.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/nvmem/bsec.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/nvmem/bsec.c b/drivers/nvmem/bsec.c
index b67b55addfe0ebf1546e6b382a1f65af5c3ad423..1e85d4c9fcb43e90657ebf65bde976293bfa042f 100644
--- a/drivers/nvmem/bsec.c
+++ b/drivers/nvmem/bsec.c
@@ -110,13 +110,16 @@ static void stm32_bsec_set_unique_machine_id(struct regmap *map)
{
u32 unique_id[3];
int ret;
+ char *uidstr;
ret = regmap_bulk_read(map, BSEC_OTP_SERIAL * 4,
unique_id, sizeof(unique_id) / 4);
if (ret)
return;
- machine_id_set_hashable(unique_id, sizeof(unique_id));
+ uidstr = xasprintf("%08X%08X%08X", unique_id[0], unique_id[1], unique_id[2);
+ barebox_set_soc_uid(uidstr, unique_id, sizeof(unique_id));
+ free(uidstr);
}
static int stm32_bsec_read_mac(struct bsec_priv *priv, int offset, u8 *mac)
@@ -278,8 +281,7 @@ static int stm32_bsec_probe(struct device *dev)
if (IS_ERR(nvmem))
return PTR_ERR(nvmem);
- if (IS_ENABLED(CONFIG_MACHINE_ID))
- stm32_bsec_set_unique_machine_id(map);
+ stm32_bsec_set_unique_machine_id(map);
stm32_bsec_init_dt(priv, dev, map);
--
2.47.3
next prev parent reply other threads:[~2025-11-13 9:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 9:34 [PATCH 0/9] Unify SoC UID and machine hashable data Sascha Hauer
2025-11-13 9:34 ` [PATCH 1/9] introduce SoC UID Sascha Hauer
2025-11-13 9:34 ` [PATCH 2/9] soc: imx8mp: Soc ID is 128bit Sascha Hauer
2025-11-14 16:22 ` Marco Felsch
2025-11-14 20:08 ` Sascha Hauer
2025-11-13 9:34 ` [PATCH 3/9] ARM: i.MX6: print leading zero for SoC ID Sascha Hauer
2025-11-13 9:34 ` Sascha Hauer [this message]
2025-11-13 9:34 ` [PATCH 5/9] nvmem: imx-ocotp-ele: call barebox_set_soc_uid() Sascha Hauer
2025-11-13 9:34 ` [PATCH 6/9] nvmem: ocotp: Fix SoC ID reading for i.MX8MP Sascha Hauer
2025-11-13 9:34 ` [PATCH 7/9] nvmem: imx-ocotp: call barebox_set_soc_uid() Sascha Hauer
2025-11-13 9:34 ` [PATCH 8/9] soc: imx8m: register SoC UID Sascha Hauer
2025-11-13 9:34 ` [PATCH 9/9] Documentation: migration: add i.MX8MP SoC UID change note Sascha Hauer
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=20251113-soc-uid-v1-4-29a256e07144@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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