MTD: m25p80 handles more chips, uses JEDEC ids and small eraseblocks
PATCH 1/1 MTD: m25p80 handles more chips, uses JEDEC ids and small eraseblocks
Update chip ID tables in m25p80 to handle more SPI flash chips, matching datasheets. All of these can use the same core operations and are newer chips that support the JEDEC "read id" instruction:
- Atmel AT25 and AT26 (seven chips)
- Spansion S25SL (five chips)
- SST 25VF (four chips)
- ST M25, M45 (five more chips)
- Winbond W25X series (seven chips)
That JEDEC instruction is now used, either to support a sanity check on the platform data holding board configuration data, or to determine chip type when it's not included in platform data. In fact, boards that don't need a standard partition table may not need that platform data any more.
For chips that support 4KB erase units, use that smaller block size instead of the larger size (usually 64KB); it's less wasteful. (Tested on W25X80.)
--- drivers/mtd/devices/Kconfig | 17 ++- drivers/mtd/devices/m25p80.c | 234 +++++++++++++++++++++++++++++++++---------- 2 files changed, 194 insertions(+), 57 deletions(-)
drivers/mtd/devices/Kconfig +13 -4
@@ -69,12 +69,21 @@ config MTD_DATAFLASH26 If you have such a board and such a DataFlash, say 'Y'. config MTD_M25P80 - tristate "Support for M25 SPI Flash" + tristate "Support most SPI Flash chips (AT26DF, M25P, W25X, ...)" depends on SPI_MASTER && EXPERIMENTAL help - This enables access to ST M25P80 and similar SPI flash chips, - used for program and data storage. Set up your spi devices - with the right board-specific platform data. + This enables access to most modern SPI flash chips, used for + program and data storage. Series supported include Atmel AT26DF, + Spansion S25SL, SST 25VF, ST M25P, and Winbond W25X. Other chips + are supported as well. See the driver source for the current list, + or to add other chips. + + Note that the original DataFlash chips (AT45 series, not AT26DF), + need an entirely different driver. + + Set up your spi devices with the right board-specific platform data, + if you want to specify device partitioning or to use a device which + doesn't support the JEDEC ID instruction. config MTD_SLRAM tristate "Uncached system RAM"
drivers/mtd/devices/m25p80.c +181 -53
335 lines not on this page · raw message
Re: [patch 2.6.23-git] MTD: m25p80 whitespace fix
Whitespace fix: a recent patch added some extraneous whitespace. Highlighted in glaring color by kernel-configured text editors...
--- drivers/mtd/devices/m25p80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/devices/m25p80.c +1 -1
@@ -36,7 +36,7 @@#define OPCODE_READ 0x03/* Read data bytes (low frequency) */ #define OPCODE_FAST_READ 0x0b/* Read data bytes (high frequency) */ #define OPCODE_PP 0x02/* Page program (up to 256 bytes) */ -#define OPCODE_BE_4K 0x20/* Erase 4KiB block */ +#define OPCODE_BE_4K 0x20/* Erase 4KiB block */ #define OPCODE_BE_32K 0x52/* Erase 32KiB block */ #define OPCODE_SE 0xd8/* Sector erase (usually 64KiB) */ #define OPCODE_RDID 0x9f/* Read JEDEC ID */