[brcm63xx] rename 96348GW-1{0,1}-gen to 96348GW-1{0,1}-generic
[openwrt.git] / target / linux / generic / patches-2.6.32 / 084-mtd_m25p80_add_pm25lv_flash_support.patch
1 --- a/drivers/mtd/devices/m25p80.c
2 +++ b/drivers/mtd/devices/m25p80.c
3 @@ -42,6 +42,7 @@
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_ALT 0xd7 /* Erase 4KiB block */
8 #define OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */
9 #define OPCODE_RDID 0x9f /* Read JEDEC ID */
10
11 @@ -599,6 +600,7 @@ struct flash_info {
12
13 u16 flags;
14 #define SECT_4K 0x01 /* OPCODE_BE_4K works uniformly */
15 +#define SECT_4K_ALT 0x02 /* OPCODE_BE_4K_ALT works uniformly */
16 };
17
18
19 @@ -626,6 +628,10 @@ static struct flash_info __devinitdata m
20 { "mx25l12805d", 0xc22018, 0, 64 * 1024, 256, },
21 { "mx25l12855e", 0xc22618, 0, 64 * 1024, 256, },
22
23 + /* PMC -- pm25x "blocks" are 32K, sectors are 4K */
24 + { "pm25lv512", 0, 0, 32 * 1024, 2, SECT_4K_ALT },
25 + { "pm25lv010", 0, 0, 32 * 1024, 4, SECT_4K_ALT },
26 +
27 /* Spansion -- single (large) sector size only, at least
28 * for the chips listed here (without boot sectors).
29 */
30 @@ -807,6 +813,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_ALT) {
35 + flash->erase_opcode = OPCODE_BE_4K_ALT;
36 + flash->mtd.erasesize = 4096;
37 } else {
38 flash->erase_opcode = OPCODE_SE;
39 flash->mtd.erasesize = info->sector_size;
This page took 0.052972 seconds and 5 git commands to generate.