Skip to content

RFC Add NVMEM driver for i.MX93 OTP access through ELE

Frieder Schrempf imx linux-arm-kernel linux-devicetree lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5firmware: imx: ele: Add API functions for OCOTP fuse accessdrivers/firmware/imx/ele_base_msg.c drivers/firmware/imx/ele_base_msg.h include/linux/firmware/imx/se_api.h+133 -00 replies
2/5nvmem: Add i.MX OCOTP fuse driver using ELE S400 APIdrivers/nvmem/Kconfig drivers/nvmem/Makefile drivers/nvmem/imx-ocotp-s400.c+208 -00 replies
3/5arm64: dts: imx93: Add node for EdgeLock Enclave (ELE) firmware driverarch/arm64/boot/dts/freescale/imx93.dtsi+6 -00 replies
4/5arm64: dts: imx93: Add node for OCOTP S400 NVMEM driverarch/arm64/boot/dts/freescale/imx93.dtsi+5 -00 replies
5/5arm64: dts: imx93-kontron: Add DMA memory region for ELE firmwarearch/arm64/boot/dts/freescale/imx93-kontron-osm-s.dtsi+16 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] Add NVMEM driver for i.MX93 OTP access through ELE

From: Frieder Schrempf <[email protected]>

This depends on [1] for the support of the Edgelock Secure Enclave firmware driver.

There are at least two ways to access the OTP fuses on i.MX93:

(1) through the FSB (fuseblock) registers
(2) through the ELE S400 API

There currently is a NVMEM driver imx-ocotp-ele.c that (despite its name) implements (1). As the FSB only provides limited access to the OTP registers (read only) it's not sufficient for all use-cases.

It seems like imx-ocotp-ele.c was intended to be extended later to implement
(1) and (2) deciding on a per-fuse-register basis which of both access methods should be used.

This has some downsides:

* the driver gets convoluted and complex
* the driver decides which OTP registers are accessed in which way and therefore mixes read-only and read/write access

Therefore I implemented a simple driver that uses the ELE S400 API only, as the FSB access (1) doesn't provide any benefits except for that it doesn't depend on the ELE firmware being available. This is used by us downstream.

For the upstream solution I would like to have some feedback on how to move on:

1. switch imx-ocotp-ele.c to use ELE API exclusively
-> this will create a hard dependency on the ELE firmware/driver being available
2. extend imx-ocotp-ele.c to use FSB and ELE API
-> make the driver use ELE API for all registers if ELE firmware/driver is available
3. create separate drivers as done in this RFC

Thanks!

[1] https://patchwork.kernel.org/project/linux-arm-kernel/cover/[email protected]/

Frieder Schrempf (5):
firmware: imx: ele: Add API functions for OCOTP fuse access
nvmem: Add i.MX OCOTP fuse driver using ELE S400 API
arm64: dts: imx93: Add node for EdgeLock Enclave (ELE) firmware driver
arm64: dts: imx93: Add node for OCOTP S400 NVMEM driver
arm64: dts: imx93-kontron: Add DMA memory region for ELE firmware

 .../dts/freescale/imx93-kontron-osm-s.dtsi    |  16 ++
 arch/arm64/boot/dts/freescale/imx93.dtsi      |  11 +
 drivers/firmware/imx/ele_base_msg.c           | 122 +++++++++++
 drivers/firmware/imx/ele_base_msg.h           |   8 +
 drivers/nvmem/Kconfig                         |  11 +
 drivers/nvmem/Makefile                        |   2 +
 drivers/nvmem/imx-ocotp-s400.c                | 195 ++++++++++++++++++
 include/linux/firmware/imx/se_api.h           |   3 +
 8 files changed, 368 insertions(+)
 create mode 100644 drivers/nvmem/imx-ocotp-s400.c
Signature · 1 line
2.49.0