diff options
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index a48f152e3180..26b14f9fcac6 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #define OPCODE_FAST_READ 0x0b /* Read data bytes (high frequency) */ | 43 | #define OPCODE_FAST_READ 0x0b /* Read data bytes (high frequency) */ |
44 | #define OPCODE_PP 0x02 /* Page program (up to 256 bytes) */ | 44 | #define OPCODE_PP 0x02 /* Page program (up to 256 bytes) */ |
45 | #define OPCODE_BE_4K 0x20 /* Erase 4KiB block */ | 45 | #define OPCODE_BE_4K 0x20 /* Erase 4KiB block */ |
46 | #define OPCODE_BE_4K_PMC 0xd7 /* Erase 4KiB block on PMC chips */ | ||
46 | #define OPCODE_BE_32K 0x52 /* Erase 32KiB block */ | 47 | #define OPCODE_BE_32K 0x52 /* Erase 32KiB block */ |
47 | #define OPCODE_CHIP_ERASE 0xc7 /* Erase whole flash chip */ | 48 | #define OPCODE_CHIP_ERASE 0xc7 /* Erase whole flash chip */ |
48 | #define OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */ | 49 | #define OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */ |
@@ -692,6 +693,7 @@ struct flash_info { | |||
692 | #define M25P_NO_ERASE 0x02 /* No erase command needed */ | 693 | #define M25P_NO_ERASE 0x02 /* No erase command needed */ |
693 | #define SST_WRITE 0x04 /* use SST byte programming */ | 694 | #define SST_WRITE 0x04 /* use SST byte programming */ |
694 | #define M25P_NO_FR 0x08 /* Can't do fastread */ | 695 | #define M25P_NO_FR 0x08 /* Can't do fastread */ |
696 | #define SECT_4K_PMC 0x10 /* OPCODE_BE_4K_PMC works uniformly */ | ||
695 | }; | 697 | }; |
696 | 698 | ||
697 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \ | 699 | #define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) \ |
@@ -773,6 +775,11 @@ static const struct spi_device_id m25p_ids[] = { | |||
773 | { "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, 0) }, | 775 | { "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, 0) }, |
774 | { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) }, | 776 | { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K) }, |
775 | 777 | ||
778 | /* PMC */ | ||
779 | { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) }, | ||
780 | { "pm25lv010", INFO(0, 0, 32 * 1024, 4, SECT_4K_PMC) }, | ||
781 | { "pm25lq032", INFO(0x7f9d46, 0, 64 * 1024, 64, SECT_4K) }, | ||
782 | |||
776 | /* Spansion -- single (large) sector size only, at least | 783 | /* Spansion -- single (large) sector size only, at least |
777 | * for the chips listed here (without boot sectors). | 784 | * for the chips listed here (without boot sectors). |
778 | */ | 785 | */ |
@@ -1026,6 +1033,9 @@ static int m25p_probe(struct spi_device *spi) | |||
1026 | if (info->flags & SECT_4K) { | 1033 | if (info->flags & SECT_4K) { |
1027 | flash->erase_opcode = OPCODE_BE_4K; | 1034 | flash->erase_opcode = OPCODE_BE_4K; |
1028 | flash->mtd.erasesize = 4096; | 1035 | flash->mtd.erasesize = 4096; |
1036 | } else if (info->flags & SECT_4K_PMC) { | ||
1037 | flash->erase_opcode = OPCODE_BE_4K_PMC; | ||
1038 | flash->mtd.erasesize = 4096; | ||
1029 | } else { | 1039 | } else { |
1030 | flash->erase_opcode = OPCODE_SE; | 1040 | flash->erase_opcode = OPCODE_SE; |
1031 | flash->mtd.erasesize = info->sector_size; | 1041 | flash->mtd.erasesize = info->sector_size; |