This fixes the issues with the jffs2 images on various boards. Using JFFS2 on devices with 4KiB erase sectors is not safe: http://lists.infradead.org/pipermail/linux-mtd/2011-June/036591.html SVN-Revision: 29521master
parent
470b1f471a
commit
5afedc67e2
@ -0,0 +1,41 @@ |
|||||||
|
--- a/drivers/mtd/devices/Kconfig
|
||||||
|
+++ b/drivers/mtd/devices/Kconfig
|
||||||
|
@@ -102,6 +102,14 @@ config M25PXX_USE_FAST_READ
|
||||||
|
help
|
||||||
|
This option enables FAST_READ access supported by ST M25Pxx.
|
||||||
|
|
||||||
|
+config M25PXX_PREFER_SMALL_SECTOR_ERASE
|
||||||
|
+ bool "Prefer small sector erase"
|
||||||
|
+ depends on MTD_M25P80
|
||||||
|
+ default y
|
||||||
|
+ help
|
||||||
|
+ This option enables use of the small erase sectors if that is
|
||||||
|
+ supported by the flash chip.
|
||||||
|
+
|
||||||
|
config MTD_SST25L
|
||||||
|
tristate "Support SST25L (non JEDEC) SPI Flash chips"
|
||||||
|
depends on SPI_MASTER
|
||||||
|
--- a/drivers/mtd/devices/m25p80.c
|
||||||
|
+++ b/drivers/mtd/devices/m25p80.c
|
||||||
|
@@ -77,6 +77,12 @@
|
||||||
|
#define FAST_READ_DUMMY_BYTE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#ifdef CONFIG_M25PXX_PREFER_SMALL_SECTOR_ERASE
|
||||||
|
+#define PREFER_SMALL_SECTOR_ERASE 1
|
||||||
|
+#else
|
||||||
|
+#define PREFER_SMALL_SECTOR_ERASE 0
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
struct m25p {
|
||||||
|
@@ -902,7 +908,7 @@ static int __devinit m25p_probe(struct s
|
||||||
|
flash->mtd.write = m25p80_write;
|
||||||
|
|
||||||
|
/* prefer "small sector" erase if possible */
|
||||||
|
- if (info->flags & SECT_4K) {
|
||||||
|
+ if (PREFER_SMALL_SECTOR_ERASE && (info->flags & SECT_4K)) {
|
||||||
|
flash->erase_opcode = OPCODE_BE_4K;
|
||||||
|
flash->mtd.erasesize = 4096;
|
||||||
|
} else if (info->flags & SECT_4K_PMC) {
|
@ -0,0 +1,41 @@ |
|||||||
|
--- a/drivers/mtd/devices/Kconfig
|
||||||
|
+++ b/drivers/mtd/devices/Kconfig
|
||||||
|
@@ -102,6 +102,14 @@ config M25PXX_USE_FAST_READ
|
||||||
|
help
|
||||||
|
This option enables FAST_READ access supported by ST M25Pxx.
|
||||||
|
|
||||||
|
+config M25PXX_PREFER_SMALL_SECTOR_ERASE
|
||||||
|
+ bool "Prefer small sector erase"
|
||||||
|
+ depends on MTD_M25P80
|
||||||
|
+ default y
|
||||||
|
+ help
|
||||||
|
+ This option enables use of the small erase sectors if that is
|
||||||
|
+ supported by the flash chip.
|
||||||
|
+
|
||||||
|
config MTD_SST25L
|
||||||
|
tristate "Support SST25L (non JEDEC) SPI Flash chips"
|
||||||
|
depends on SPI_MASTER
|
||||||
|
--- a/drivers/mtd/devices/m25p80.c
|
||||||
|
+++ b/drivers/mtd/devices/m25p80.c
|
||||||
|
@@ -83,6 +83,12 @@
|
||||||
|
|
||||||
|
#define JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16)
|
||||||
|
|
||||||
|
+#ifdef CONFIG_M25PXX_PREFER_SMALL_SECTOR_ERASE
|
||||||
|
+#define PREFER_SMALL_SECTOR_ERASE 1
|
||||||
|
+#else
|
||||||
|
+#define PREFER_SMALL_SECTOR_ERASE 0
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
struct m25p {
|
||||||
|
@@ -924,7 +930,7 @@ static int __devinit m25p_probe(struct s
|
||||||
|
flash->mtd.write = m25p80_write;
|
||||||
|
|
||||||
|
/* prefer "small sector" erase if possible */
|
||||||
|
- if (info->flags & SECT_4K) {
|
||||||
|
+ if (PREFER_SMALL_SECTOR_ERASE && (info->flags & SECT_4K)) {
|
||||||
|
flash->erase_opcode = OPCODE_BE_4K;
|
||||||
|
flash->mtd.erasesize = 4096;
|
||||||
|
} else if (info->flags & SECT_4K_PMC) {
|
@ -0,0 +1,41 @@ |
|||||||
|
--- a/drivers/mtd/devices/Kconfig
|
||||||
|
+++ b/drivers/mtd/devices/Kconfig
|
||||||
|
@@ -102,6 +102,14 @@ config M25PXX_USE_FAST_READ
|
||||||
|
help
|
||||||
|
This option enables FAST_READ access supported by ST M25Pxx.
|
||||||
|
|
||||||
|
+config M25PXX_PREFER_SMALL_SECTOR_ERASE
|
||||||
|
+ bool "Prefer small sector erase"
|
||||||
|
+ depends on MTD_M25P80
|
||||||
|
+ default y
|
||||||
|
+ help
|
||||||
|
+ This option enables use of the small erase sectors if that is
|
||||||
|
+ supported by the flash chip.
|
||||||
|
+
|
||||||
|
config MTD_SST25L
|
||||||
|
tristate "Support SST25L (non JEDEC) SPI Flash chips"
|
||||||
|
depends on SPI_MASTER
|
||||||
|
--- a/drivers/mtd/devices/m25p80.c
|
||||||
|
+++ b/drivers/mtd/devices/m25p80.c
|
||||||
|
@@ -83,6 +83,12 @@
|
||||||
|
|
||||||
|
#define JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16)
|
||||||
|
|
||||||
|
+#ifdef CONFIG_M25PXX_PREFER_SMALL_SECTOR_ERASE
|
||||||
|
+#define PREFER_SMALL_SECTOR_ERASE 1
|
||||||
|
+#else
|
||||||
|
+#define PREFER_SMALL_SECTOR_ERASE 0
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/****************************************************************************/
|
||||||
|
|
||||||
|
struct m25p {
|
||||||
|
@@ -924,7 +930,7 @@ static int __devinit m25p_probe(struct s
|
||||||
|
flash->mtd.write = m25p80_write;
|
||||||
|
|
||||||
|
/* prefer "small sector" erase if possible */
|
||||||
|
- if (info->flags & SECT_4K) {
|
||||||
|
+ if (PREFER_SMALL_SECTOR_ERASE && (info->flags & SECT_4K)) {
|
||||||
|
flash->erase_opcode = OPCODE_BE_4K;
|
||||||
|
flash->mtd.erasesize = 4096;
|
||||||
|
} else if (info->flags & SECT_4K_PMC) {
|
Loading…
Reference in new issue