Skip to contentSkip to conversation

nvmem: imx-ocotp: reverse MAC on imx6qdl

PATCH In review Nikolaus Voss 2 participants 2 messages Nov 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 nvmem: imx-ocotp: reverse MAC on imx6qdl

Ethernet MAC on iMX6Q/DL is stored in OTP in little-endian byte order. I suspect that this is true for all iMX flavors. If so, we could get rid of the .reverse_mac_address attribute entirely.

---
 drivers/nvmem/imx-ocotp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvmem/imx-ocotp.c +1 -0
index 14284e866f26e..a39a0defb070a 100644
@@ -496,6 +496,7 @@ static const struct ocotp_params imx6q_params = {
 	.bank_address_words = 0,
 	.set_timing = imx_ocotp_set_imx6_timing,
 	.ctrl = IMX_OCOTP_BM_CTRL_DEFAULT,
+	.reverse_mac_address = true,
 };
 
 static const struct ocotp_params imx6sl_params = {
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#1 lore raw

Hello Nikolaus,

Quoted 3 lines · Nikolaus Voss

Ethernet MAC on iMX6Q/DL is stored in OTP in little-endian byte order. I suspect that this is true for all iMX flavors. If so, we could get rid of the .reverse_mac_address attribute entirely.

I also think all i.MX flavors are similar here. The barebox driver has had a MAC address parsing function for a few years[1] and it's the same for all i.MX variants. The only different SoC is VF610, but that has a standalone driver in Linux.

[1]: https://elixir.bootlin.com/barebox/v2022.11.0/source/drivers/nvmem/ocotp.c#L551

Quoted 1 line

Cheers,
Ahmad

Quoted 16 lines
---
 drivers/nvmem/imx-ocotp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvmem/imx-ocotp.c +1 -0
index 14284e866f26e..a39a0defb070a 100644
@@ -496,6 +496,7 @@ static const struct ocotp_params imx6q_params = {
 	.bank_address_words = 0,
 	.set_timing = imx_ocotp_set_imx6_timing,
 	.ctrl = IMX_OCOTP_BM_CTRL_DEFAULT,
+	.reverse_mac_address = true,
 };
 
 static const struct ocotp_params imx6sl_params = {
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |