Linux 5.13 Adds Support For SPI NOR One-Time Programmable Memory Regions

Written by Michael Larabel in Linux Storage on 9 May 2021 at 06:13 AM EDT. Add A Comment
The Linux 5.13 kernel has initial support for dealing with SPI one-time programmable (OTP) flash memory regions.

Linux 5.13 adds the new MTD OTP functions for accessing SPI one-time programmable data. The OTP are memory regions intended to be programmed once and can be used for permanent secure identification, immutable properties, and similar purposes.

In addition to adding the core infrastructure support for OTP to the MTD SPI-NOR code in Linux 5.13, the functionality is wired up for Winbond and similar flash memory chips. The MTD subsystem has already supported OTP areas but not for SPI-NOR flash memory.

While it's "one-time programmable", the code does introduce an ERASE ioctl interface for OTP too. It turns out some flash memory chips support erasing the OTP region multiple times until becoming locked. So if encountering a flash memory chip with an OTP region not yet locked, that interface can be used for erasing it... Which can be useful for development purposes.

Various kernel developers have been working on SPI OTP support for the mainline Linux kernel in recent years while finally the support made its way to Linux 5.13 via the MTD pull last week after being stuck under review the past year.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week