[PATCH] nvmem: imx-ocotp-ele: fix MAC2 layout
Sascha Hauer
s.hauer at pengutronix.de
Wed May 8 05:14:45 PDT 2024
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 at 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
More information about the barebox
mailing list