* [PATCH] nvmem: imx-ocotp-ele: fix MAC2 layout
@ 2024-05-08 12:14 Sascha Hauer
2024-05-13 9:25 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2024-05-08 12:14 UTC (permalink / raw)
To: Barebox List
The MAC address layout for MAC address 2 implemented in the
imx-ocotp-ele driver matches the one described in the Security Reference
manual. This contradicts the description in the fusemap though.
According to the fusemap the layout for MAC2 is the same as for MAC1.
It's not clear which one is correct, but at least the TQMA93 board has
MAC2 programmed matching the fusemap, so change the layout accordingly.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/nvmem/imx-ocotp-ele.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/nvmem/imx-ocotp-ele.c b/drivers/nvmem/imx-ocotp-ele.c
index e4e60ed6af..58d3e62abf 100644
--- a/drivers/nvmem/imx-ocotp-ele.c
+++ b/drivers/nvmem/imx-ocotp-ele.c
@@ -116,14 +116,10 @@ static int imx_ocotp_cell_pp(void *context, const char *id, unsigned int offset,
if (id && !strcmp(id, "mac-address")) {
u8 *buf = data;
- if (offset == 0x4ec) {
+ if (offset == 0x4ec || offset == 0x4f2) {
swap(buf[0], buf[5]);
swap(buf[1], buf[4]);
swap(buf[2], buf[3]);
- } else if (offset == 0x4f2) {
- swap(buf[0], buf[1]);
- swap(buf[2], buf[5]);
- swap(buf[3], buf[4]);
} else {
return -EINVAL;
}
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-13 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-08 12:14 [PATCH] nvmem: imx-ocotp-ele: fix MAC2 layout Sascha Hauer
2024-05-13 9:25 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox