linux/drivers/nvmem
Sascha Hauer 2c49e89438 nvmem: imx-ocotp-ele: fix MAC address byte order
[ Upstream commit 391b06ecb6 ]

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: 22e9e6fcfb ("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>
History 2025-02-27 04:10:47 -08:00
..
layouts nvmem: Simplify the ->add_cells() hook 2025-02-27 04:10:47 -08:00
apple-efuses.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
bcm-ocotp.c nvmem: Explicitly include correct DT includes 2023-08-23 16:34:01 +02:00
brcm_nvram.c nvmem: brcm_nvram: store a copy of NVRAM content 2024-01-01 12:42:44 +00:00
core.c nvmem: Move and rename ->fixup_cell_info() 2025-02-27 04:10:47 -08:00
imx-iim.c nvmem: Explicitly include correct DT includes 2023-08-23 16:34:01 +02:00
imx-ocotp-ele.c nvmem: imx-ocotp-ele: fix MAC address byte order 2025-02-27 04:10:47 -08:00
imx-ocotp-scu.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
imx-ocotp.c nvmem: Move and rename ->fixup_cell_info() 2025-02-27 04:10:47 -08:00
internals.h nvmem: Move and rename ->fixup_cell_info() 2025-02-27 04:10:47 -08:00
jz4780-efuse.c nvmem: jz4780-efuse: Use PTR_ERR_OR_ZERO() to simplify code 2020-05-15 16:20:02 +02:00
Kconfig nvmem: sec-qfprom: Add Qualcomm secure QFPROM support 2023-08-23 16:34:01 +02:00
lan9662-otpc.c nvmem: lan9662-otp: Change return type of lan9662_otp_wait_flag_clear() 2022-11-22 18:22:05 +01:00
layerscape-sfp.c nvmem: sfp: Add support for TA 2.1 devices 2022-05-09 15:46:29 +02:00
lpc18xx_eeprom.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lpc18xx_otp.c nvmem: Explicitly include correct DT includes 2023-08-23 16:34:01 +02:00
Makefile nvmem: sec-qfprom: Add Qualcomm secure QFPROM support 2023-08-23 16:34:01 +02:00
meson-efuse.c nvmem: meson-efuse: Fix return value of nvmem callbacks 2024-07-18 13:21:21 +02:00
meson-mx-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
microchip-otpc.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
mtk-efuse.c nvmem: Move and rename ->fixup_cell_info() 2025-02-27 04:10:47 -08:00
mxs-ocotp.c nvmem: mxs-ocotp: Use devm_add_action_or_reset() for cleanup 2020-03-23 20:05:23 +01:00
nintendo-otp.c nvmem: nintendo-otp: Use devm_platform_ioremap_resource() 2023-04-05 19:41:12 +02:00
qcom-spmi-sdam.c nvmem: qcom-spmi-sdam: Set size in struct nvmem_config 2025-02-17 09:40:35 +01:00
qfprom.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
qoriq-efuse.c nvmem: add new NXP QorIQ eFuse driver 2023-08-23 16:34:01 +02:00
rave-sp-eeprom.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
rmem.c nvmem: rmem: Fix return value of rmem_read() 2024-07-18 13:21:21 +02:00
rockchip-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
rockchip-otp.c nvmem: rockchip-otp: set add_legacy_fixed_of_cells config option 2024-08-03 08:54:01 +02:00
sc27xx-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
sec-qfprom.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
snvs_lpgpr.c nvmem: Explicitly include correct DT includes 2023-08-23 16:34:01 +02:00
sprd-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
stm32-bsec-optee-ta.c nvmem: stm32: add OP-TEE support for STM32MP13x 2023-02-06 19:06:59 +01:00
stm32-bsec-optee-ta.h nvmem: stm32: add OP-TEE support for STM32MP13x 2023-02-06 19:06:59 +01:00
stm32-romem.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
sunplus-ocotp.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
sunxi_sid.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
u-boot-env.c nvmem: u-boot-env: error if NVMEM device is too small 2024-09-18 19:24:04 +02:00
uniphier-efuse.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
vf610-ocotp.c nvmem: vf610-ocotp: Use devm_platform_get_and_ioremap_resource() 2023-04-05 19:41:13 +02:00
zynqmp_nvmem.c nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00