From e72c7e17a475c00134c56f4392578ddc16a47a2e Mon Sep 17 00:00:00 2001 From: Imre Kaloz Date: Thu, 24 Oct 2013 13:50:11 +0000 Subject: preliminary 3.12 support Signed-off-by: Imre Kaloz SVN-Revision: 38528 --- ...25p80-allow-to-disable-small-sector-erase.patch | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 target/linux/generic/patches-3.12/471-mtd-m25p80-allow-to-disable-small-sector-erase.patch (limited to 'target/linux/generic/patches-3.12/471-mtd-m25p80-allow-to-disable-small-sector-erase.patch') diff --git a/target/linux/generic/patches-3.12/471-mtd-m25p80-allow-to-disable-small-sector-erase.patch b/target/linux/generic/patches-3.12/471-mtd-m25p80-allow-to-disable-small-sector-erase.patch new file mode 100644 index 0000000..7373c67 --- /dev/null +++ b/target/linux/generic/patches-3.12/471-mtd-m25p80-allow-to-disable-small-sector-erase.patch @@ -0,0 +1,41 @@ +--- a/drivers/mtd/devices/Kconfig ++++ b/drivers/mtd/devices/Kconfig +@@ -109,6 +109,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 +@@ -82,6 +82,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 { +@@ -1046,7 +1052,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) { -- cgit v1.1