aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2013-08-20 00:30:22 -0400
committerBrian Norris <computersforpeace@gmail.com>2013-11-07 02:33:06 -0500
commitddba7c5ad797f4b878f4e177ef300c1f9837cd29 (patch)
treee0f9934ced1dc0430c45697297e95616a19f22b8 /drivers/mtd
parent6e5d9bda27000c682a9b38f0466941007e295f82 (diff)
mtd: m25p80: remove M25PXX_USE_FAST_READ Kconfig
Remove the compile-time option for FAST_READ, since we have run-time support for detecting it. This refactors the logic for enabling fast-read, such that for DT-enabled devices, we honor the "m25p,fast-read" property but for non-DT devices, we default to using FAST_READ whenever the flash device supports it. Normal READ and FAST_READ differ only in the following: * FAST_READ supports SPI higher clock frequencies [1] * number of dummy cycles; FAST_READ requires 8 dummy cycles (whereas READ requires 0) to allow the flash sufficient setup time, even when running at higher clock speeds Thus, for flash chips which support FAST_READ, there is otherwise no limiting reason why we cannot use the FAST_READ opcode instead of READ. It simply allows the SPI controller to run at higher clock rates. So theoretically, nobody should be needing the compile-time option anyway. [1] I have a Spansion S25FL128S datasheet which says: "The maximum operating clock frequency for the READ command is 50 MHz." And: "The maximum operating clock frequency for FAST READ command is 133 MHz." Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/Kconfig7
-rw-r--r--drivers/mtd/devices/m25p80.c11
2 files changed, 6 insertions, 12 deletions
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig
index 74ab4b7e523e..01281382180b 100644
--- a/drivers/mtd/devices/Kconfig
+++ b/drivers/mtd/devices/Kconfig
@@ -95,13 +95,6 @@ config MTD_M25P80
95 if you want to specify device partitioning or to use a device which 95 if you want to specify device partitioning or to use a device which
96 doesn't support the JEDEC ID instruction. 96 doesn't support the JEDEC ID instruction.
97 97
98config M25PXX_USE_FAST_READ
99 bool "Use FAST_READ OPCode allowing SPI CLK >= 50MHz"
100 depends on MTD_M25P80
101 default y
102 help
103 This option enables FAST_READ access supported by ST M25Pxx.
104
105config MTD_SPEAR_SMI 98config MTD_SPEAR_SMI
106 tristate "SPEAR MTD NOR Support through SMI controller" 99 tristate "SPEAR MTD NOR Support through SMI controller"
107 depends on PLAT_SPEAR 100 depends on PLAT_SPEAR
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 7e3ec7ae727f..d6c5c57380f8 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -1055,13 +1055,14 @@ static int m25p_probe(struct spi_device *spi)
1055 flash->page_size = info->page_size; 1055 flash->page_size = info->page_size;
1056 flash->mtd.writebufsize = flash->page_size; 1056 flash->mtd.writebufsize = flash->page_size;
1057 1057
1058 flash->fast_read = false; 1058 if (np)
1059 if (np && of_property_read_bool(np, "m25p,fast-read")) 1059 /* If we were instantiated by DT, use it */
1060 flash->fast_read = of_property_read_bool(np, "m25p,fast-read");
1061 else
1062 /* If we weren't instantiated by DT, default to fast-read */
1060 flash->fast_read = true; 1063 flash->fast_read = true;
1061 1064
1062#ifdef CONFIG_M25PXX_USE_FAST_READ 1065 /* Some devices cannot do fast-read, no matter what DT tells us */
1063 flash->fast_read = true;
1064#endif
1065 if (info->flags & M25P_NO_FR) 1066 if (info->flags & M25P_NO_FR)
1066 flash->fast_read = false; 1067 flash->fast_read = false;
1067 1068