Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob

New SPI Devices Under Linux – KBA220962

New SPI Devices Under Linux – KBA220962

Community-Team
Employee
Employee
50 questions asked 10 questions asked 5 questions asked

Version: **

Translation - Japanese: Linuxでの新しいSPI Flash Memoryのサポート - KBA220962 - Community Translated (JA)

Question:

How can I add support for new SPI devices to Linux?

Answer:

Support for Cypress SPI flash devices comes with the MTD chip driver in m25p80.c and/or spi-nor.c (for kernels 3.16 or later). This driver implements the device specific command set, i.e., the protocol or language needed to talk to the physical device. It includes support for a whole series of compatible SPI flash devices from various vendors. Its code base has been growing continuously in the past with an increasing number of features as well as number of supported devices. If needed, new OPNs can easily be added. For example, the following device entries describe the new Cypress S25FL-L family members:

{ "s25fl064l", INFO(0x016017, 0, 64 * 1024, 128, SECT_4K) }, 
{ "s25fl128l", INFO(0x016018, 0, 64 * 1024, 256, SECT_4K) },
{ "s25fl256l", INFO(0x016019, 0, 64 * 1024, 512, SECT_4K) },

The structure of device entries is pretty simple. Data sets start with a unique string or name followed by the standard and extended device IDs, sector size in bytes, number of sectors and finally optional flags. The SECT_4K flag is optional and can be omitted if the full bock sectors are desired as erase unit size, e.g., in the context of a flash file system.

0 Likes
1056 Views
Contributors