]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvmem: imx-ocotp-ele: fix MAC address byte order
authorSascha Hauer <s.hauer@pengutronix.de>
Mon, 30 Dec 2024 14:18:58 +0000 (14:18 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:10:47 +0000 (04:10 -0800)
commit2c49e894389a7ae8277dc77d6d99a85ef47f71c0
tree813bad336b4c7847d6469b7d939cffebfe82e4aa
parenta0ee898a5024f12572e4ce45202df9b149dadc05
nvmem: imx-ocotp-ele: fix MAC address byte order

[ Upstream commit 391b06ecb63e6eacd054582cb4eb738dfbf5eb77 ]

According to the i.MX93 Fusemap the two MAC addresses are stored in
words 315 to 317 like this:

315 MAC1_ADDR_31_0[31:0]
316 MAC1_ADDR_47_32[47:32]
MAC2_ADDR_15_0[15:0]
317 MAC2_ADDR_47_16[31:0]

This means the MAC addresses are stored in reverse byte order. We have
to swap the bytes before passing them to the upper layers. The storage
format is consistent to the one used on i.MX6 using imx-ocotp driver
which does the same byte swapping as introduced here.

With this patch the MAC address on my i.MX93 TQ board correctly reads as
00:d0:93:6b:27:b8 instead of b8:27:6b:93:d0:00.

Fixes: 22e9e6fcfb50 ("nvmem: imx: support i.MX93 OCOTP")
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: stable <stable@kernel.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20241230141901.263976-4-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvmem/imx-ocotp-ele.c