[PATCH v4 00/11] Support ELE API in i.MX OCOTP NVMEM driver
From: Frieder Schrempf <hidden>
Date: 2026-07-27 13:01:44
Also in:
imx, linux-devicetree, lkml
This patchset depends on "firmware: imx: driver for NXP secure-enclave" [1]. The imx-ocotp-ele.c driver currently uses the limited FSB (fuseblock) to access the fuse registers. In order to gain full read/write access to all fuses, we need to use the Edgelock Secure Enclave firmware. This patchset does: * Add bindings to reference ELE device in OCOTP driver (patch 1) * Export ELE API functions (patch 3) * Let the OCOTP driver use the ELE API (patch 7) * Extend the devicetree of i.MX91/i.MX93 boards for using the ELE API (patch 10/11) The rest of the patches contain cleanups that were implemented along the way. This was tested using the 'crucible' tool and by directly reading from the nvmem device on i.MX93. This still lacks support for the i.MX94 and i.MX95 as I don't have the hardware for testing on these platforms. As the documentations is incomplete it is hard to get the keepout table right without testing on the actual hardware. If someone else can provide the data and testing, I can add it in a future version. If not this can be done later. --- Changes in v4: - Reorder allOf in bindings and extend property description (thanks Krzysztof) - Add R-b from Krzysztof - Add R-b from Frank - Improve scope-based cleanup (thanks Frank) - Move firmware node from patch 11 to 10 - Link to v3: https://patch.msgid.link/20260723-upstreaming-next-20260609-imx-ocotp-ele-v3-0-e26930345b4c@kontron.de Changes in v3: - Fix bindings to correctly ignore the secure-enclave property for SoCs other than i.MX93 (thanks Krzysztof) - Rebase on latest ELE driver patchset (v29) [1] - Enable ELE in all board devicetrees (suggested by Francesco) - Put the reserved memory somewhere in the first 256MB of DDR - Link to v2: https://patch.msgid.link/20260713-upstreaming-next-20260609-imx-ocotp-ele-v2-0-b8266d93514b@kontron.de Changes in v2: - Adjust bindings to allow secure-enclave only for i.MX93 and improve commit message (suggested by Krzysztof) - Export generic ELE API functions to be used by drivers (suggested by Frank and Peng) - Move the fuse read/write functions to the NVMEM driver (suggested by Frank and Peng) - Add patch to use __free(kfree) in imx_ocotp_reg_read() to fix memory leak (reported by Sashiko) - Use device link to prevent SE device from being unbound while referenced (reported by Sashiko) - Link to v1: https://patch.msgid.link/20260616-upstreaming-next-20260609-imx-ocotp-ele-v1-0-cb7f3698c3e6@kontron.de [1] https://patchwork.kernel.org/project/linux-arm-kernel/cover/20260721-imx-se-if-v29-0-04a362f4fcca@nxp.com/ To: Srinivas Kandagatla <srini@kernel.org> To: Rob Herring <robh@kernel.org> To: Krzysztof Kozlowski <krzk+dt@kernel.org> To: Conor Dooley <conor+dt@kernel.org> To: Frank Li <Frank.Li@nxp.com> To: Sascha Hauer <s.hauer@pengutronix.de> To: Pengutronix Kernel Team <kernel@pengutronix.de> To: Fabio Estevam <festevam@gmail.com> To: Shawn Guo <shawnguo@kernel.org> To: Pankaj Gupta <pankaj.gupta@nxp.com> To: Peng Fan (OSS) <redacted> Cc: devicetree@vger.kernel.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux@ew.tq-group.com --- Frieder Schrempf (11): dt-bindings: nvmem: imx-ocotp: Add support for secure-enclave firmware: imx: ele: Fix indentation in ele_base_msg.h firmware: imx: ele: Export API functions nvmem: imx-ocotp-ele: Add keepout table for i.MX93 nvmem: imx-ocotp-ele: Remove device-specific reg_read() nvmem: imx-ocotp-ele: Use scope-based cleanup helpers in imx_ocotp_reg_read() nvmem: imx-ocotp-ele: Support the ELE API nvmem: imx-ocotp-ele: Remove the FUSE_ELE type nvmem: imx-ocotp-ele: Rename FSB access map arm64: dts: Add ELE firmware node and common include arm64: dts: Enable EdgeLock Secure Enclave on all i.MX91/i.MX93 boards .../devicetree/bindings/nvmem/imx-ocotp.yaml | 23 +- arch/arm64/boot/dts/freescale/imx91-11x11-evk.dts | 1 + .../boot/dts/freescale/imx91-11x11-frdm-s.dts | 1 + arch/arm64/boot/dts/freescale/imx91-11x11-frdm.dts | 1 + arch/arm64/boot/dts/freescale/imx91-9x9-qsb.dts | 1 + .../boot/dts/freescale/imx91-phycore-som.dtsi | 1 + arch/arm64/boot/dts/freescale/imx91-tqma9131.dtsi | 15 +- arch/arm64/boot/dts/freescale/imx91-var-dart.dtsi | 1 + arch/arm64/boot/dts/freescale/imx91-var-som.dtsi | 1 + arch/arm64/boot/dts/freescale/imx91_93_common.dtsi | 9 + .../boot/dts/freescale/imx93-11x11-evk-common.dtsi | 1 + arch/arm64/boot/dts/freescale/imx93-11x11-frdm.dts | 1 + arch/arm64/boot/dts/freescale/imx93-14x14-evk.dts | 1 + arch/arm64/boot/dts/freescale/imx93-9x9-qsb.dts | 1 + arch/arm64/boot/dts/freescale/imx93-firmware.dtsi | 28 +++ .../boot/dts/freescale/imx93-kontron-osm-s.dtsi | 1 + .../boot/dts/freescale/imx93-phycore-som.dtsi | 1 + arch/arm64/boot/dts/freescale/imx93-tqma9352.dtsi | 1 + arch/arm64/boot/dts/freescale/imx93-var-dart.dtsi | 1 + arch/arm64/boot/dts/freescale/imx93-var-som.dtsi | 1 + drivers/firmware/imx/ele_base_msg.c | 42 ++-- drivers/firmware/imx/ele_base_msg.h | 16 +- drivers/firmware/imx/ele_common.c | 35 ++- drivers/firmware/imx/ele_common.h | 14 -- drivers/firmware/imx/se_ctrl.c | 6 +- drivers/firmware/imx/se_ctrl.h | 14 +- drivers/nvmem/imx-ocotp-ele.c | 239 +++++++++++++++++---- include/linux/firmware/imx/se_api.h | 78 +++++++ 28 files changed, 428 insertions(+), 107 deletions(-) --- base-commit: 6946cd5d0aa4dd10a414ddcb7a10844fdb0ad345 change-id: 20260616-upstreaming-next-20260609-imx-ocotp-ele-a512ddf96b03 prerequisite-change-id: 20240507-imx-se-if-a40055093dc6:v30 prerequisite-patch-id: 0996915f031a1d899202c5fba75a969d6ce2a53d prerequisite-patch-id: dbed47ecb907f6b7f7e284c5c1a3c325566eafd7 prerequisite-patch-id: d27164b5932b6d7f4bd5494e4058c84841db4d77 prerequisite-patch-id: 6a9642b23090d9f1ae18bc8969e30217d053938b prerequisite-patch-id: cdd5a258a3157d609115ccf8b8606d1fcdf520e8 prerequisite-patch-id: d6a8cd2161ea713eebeff46d12f6ae1255c24561 prerequisite-patch-id: 1d8b2e78db2815eaace41a13d571171fb58e4221 Best regards, -- Frieder Schrempf [off-list ref]