1 --- a/drivers/mtd/devices/m25p80.c
2 +++ b/drivers/mtd/devices/m25p80.c
4 #define OPCODE_BE_4K 0x20 /* Erase 4KiB block */
5 #define OPCODE_BE_32K 0x52 /* Erase 32KiB block */
6 #define OPCODE_CHIP_ERASE 0xc7 /* Erase whole flash chip */
7 +#define OPCODE_BE_4K_PMC 0xd7 /* Erase 4KiB block on PMC chips*/
8 #define OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */
9 #define OPCODE_RDID 0x9f /* Read JEDEC ID */
11 @@ -598,6 +599,7 @@ struct flash_info {
13 #define SECT_4K 0x01 /* OPCODE_BE_4K works uniformly */
14 #define M25P_NO_ERASE 0x02 /* No erase command needed */
15 +#define SECT_4K_PMC 0x04 /* OPCODE_BE_4K_PMC works uniformly */
18 #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \
19 @@ -654,6 +656,10 @@ static const struct spi_device_id m25p_i
20 { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) },
21 { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) },
23 + /* PMC -- pm25x "blocks" are 32K, sectors are 4K */
24 + { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) },
25 + { "pm25lv010", INFO(0, 0, 32 * 1024, 4, SECT_4K_PMC) },
27 /* Spansion -- single (large) sector size only, at least
28 * for the chips listed here (without boot sectors).
30 @@ -873,6 +879,9 @@ static int __devinit m25p_probe(struct s
31 if (info->flags & SECT_4K) {
32 flash->erase_opcode = OPCODE_BE_4K;
33 flash->mtd.erasesize = 4096;
34 + } else if (info->flags & SECT_4K_PMC) {
35 + flash->erase_opcode = OPCODE_BE_4K_PMC;
36 + flash->mtd.erasesize = 4096;
38 flash->erase_opcode = OPCODE_SE;
39 flash->mtd.erasesize = info->sector_size;