[PATCH v2 00/10] Make i.MX8M OCOTP work as accessing controller

Alexander Stein
2025-02-07T08:36:51Z

Hi,

inspired by [1] this adds the accessing controller feature to i.MX8M.
The OCOTP eFuse has bits which can disable particular peripherals, such as
GPU, MIPI-DSI oder USB.

In OCOTP driver, the nodes under "/" will be iterated, and checked
if property "#access-controllers" exsits. If not allow access, detach
the node.

I successfully used this on a i.MX8M Nano DualLite which has GPU disabled.
Without this patchset the default DT completly freezes the SoC if GPU
is accessed.
Using this patchset the GPU is disabled without any DT modification from
bootloader:
> imx_ocotp 30350000.efuse: /soc@0/gpu@38000000: disabled by fuse, device driver will not be probed

Changes in v2:
* Encode all addresses and bit offsets into DT directly
This eliminates the need for platform specific code in imx-ocotp
* Added support for imx8mm, imx8mp and imx8mq as well

Best regards,
Alexander

[1] https://lore.kernel.org/all/20250204-imx-ocotp-v8-0-01be4a4bb045@nxp.com/

Alexander Stein (10):
nvmem: imx-ocotp: Sort header alphabetically
nvmem: imx-ocotp: Support accessing controller for i.MX8M
arm64: dts: imx8mn: Add i.MX8M Nano OCOTP disable fuse definitions
arm64: dts: imx8mn: Add access-controller references
arm64: dts: imx8mp: Add i.MX8M Plus OCOTP disable fuse definitions
arm64: dts: imx8mp: Add access-controller references
arm64: dts: imx8mm: Add i.MX8M Mini OCOTP disable fuse definitions
arm64: dts: imx8mm: Add access-controller references
arm64: dts: imx8mq: Add i.MX8M OCOTP disable fuse definitions
arm64: dts: imx8mq: Add access-controller references

arch/arm64/boot/dts/freescale/imx8mm-ocotp.h | 31 ++++++++
arch/arm64/boot/dts/freescale/imx8mm.dtsi | 13 ++++
arch/arm64/boot/dts/freescale/imx8mn-ocotp.h | 26 +++++++
arch/arm64/boot/dts/freescale/imx8mn.dtsi | 8 +++
arch/arm64/boot/dts/freescale/imx8mp-ocotp.h | 42 +++++++++++
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 26 +++++++
arch/arm64/boot/dts/freescale/imx8mq-ocotp.h | 37 ++++++++++
arch/arm64/boot/dts/freescale/imx8mq.dtsi | 15 ++++
drivers/nvmem/Kconfig | 3 +
drivers/nvmem/imx-ocotp.c | 76 +++++++++++++++++++-
10 files changed, 275 insertions(+), 2 deletions(-)
create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-ocotp.h
create mode 100644 arch/arm64/boot/dts/freescale/imx8mn-ocotp.h
create mode 100644 arch/arm64/boot/dts/freescale/imx8mp-ocotp.h
create mode 100644 arch/arm64/boot/dts/freescale/imx8mq-ocotp.h

--
2.34.1