SPI-NOR Flash memory in Torizon

Hi!

We would like to add an external SPI-NOR Flash memory to our products, in order to be able to change the SoM, in case it gets damaged, without losing the customer’s configuration and data.

We were looking at this chip: MT25QL512 (datasheet here). I searched through Linux source code but only found this reference. Is that the driver for that device?

The idea is to be able to mount this memory in the root filesystem and write/read to/from it like a normal disk. I read that with MTD subsystem we could do this. Is this really possible?

Thank you.
Tomás

Greetings @tomas.ayi,

As far as I can tell that appears to be the correct driver for that chipset. Also yes if you set everything up properly then the MTD subsystem should create an entry in /dev that you can then mount and then perform the usual disk/flash operations.

Also don’t forget in addition to enabling the driver you’ll most likely need device tree modifications.

Best Regards,
Jeremias

1 Like

Hi Jeremias,

Thank you for your answer. I just noticed that the device driver was added in a newer version of the Linux kernel and it’s not avaiable in v5.1. Is it possible to use that same source code and compile it in TorizonCore v5.1, or there is a high probability to need to modify something?

Thank you again,
Tomas

Your right it seems support for this specific Micron chip wasn’t available in the version of the Linux Kernel we’re using.

Here’s what I found out however. Before the source file micron-st.c the driver code existed in core.c as seen here: mtd: spi-nor: Move Micron/ST bits out of core.c · torvalds/linux@15f5c7e · GitHub

However before a renaming core.c use to be called spi-nor.c. This file does exist in the Toradex Linux kernel. It also has entries for micron specific chips: spi-nor.c « spi-nor « mtd « drivers - linux-toradex.git - Linux kernel for Apalis and Colibri modules

However it seems at this point support for “MT25QL512” wasn’t added yet. Hmm probably the best you can hope for at this point is attempt a backport for “MT25QL512” support. Fortunately a lot of the support for Micron chips already exists, it’s just a matter of figuring out what was added later on that is specific to the “MT25QL512”. Then once these have been isolated you can attempt a backport. Though I can’t comment much further than this about any possible issues.

Best Regards,
Jeremias

1 Like