diff options
author | Florian Fainelli <florian@openwrt.org> | 2013-03-14 14:45:56 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2013-03-14 14:45:56 +0000 |
commit | ddc8718f7f4ef9723e026efac811d3338e6bcddb (patch) | |
tree | 08d6be7813310be182259388518215a17afcc18c /target/linux/generic/patches-3.9/476-mtd-m25p80-allow-to-disable-small-sector-erase.patch | |
parent | 6cb1f067dc42c4bffa8862448167486333d0227e (diff) | |
download | upstream-ddc8718f7f4ef9723e026efac811d3338e6bcddb.tar.gz upstream-ddc8718f7f4ef9723e026efac811d3338e6bcddb.tar.bz2 upstream-ddc8718f7f4ef9723e026efac811d3338e6bcddb.zip |
kernel: add support for 3.9-rc2
Signed-off-by: Florian Fainelli <florian@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36008 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-3.9/476-mtd-m25p80-allow-to-disable-small-sector-erase.patch')
-rw-r--r-- | target/linux/generic/patches-3.9/476-mtd-m25p80-allow-to-disable-small-sector-erase.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/generic/patches-3.9/476-mtd-m25p80-allow-to-disable-small-sector-erase.patch b/target/linux/generic/patches-3.9/476-mtd-m25p80-allow-to-disable-small-sector-erase.patch new file mode 100644 index 0000000000..726c2e8b50 --- /dev/null +++ b/target/linux/generic/patches-3.9/476-mtd-m25p80-allow-to-disable-small-sector-erase.patch @@ -0,0 +1,41 @@ +--- a/drivers/mtd/devices/Kconfig ++++ b/drivers/mtd/devices/Kconfig +@@ -110,6 +110,14 @@ config MTD_SPEAR_SMI + help + This enable SNOR support on SPEAR platforms using SMI controller + ++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 +@@ -76,6 +76,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 { +@@ -1017,7 +1023,7 @@ static int m25p_probe(struct spi_device + 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) { |