aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-06-07 16:52:56 -0400
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-06-07 16:52:56 -0400
commit6e89b84e28f69c4f848dc8f1ea8fdecf33f2fbb4 (patch)
tree4c32febe723d922cf551e34c5a082033ebe371ce
parentc64d4419a17cfb39a5b573f9016cd02ade4c9a64 (diff)
parentf567c71f4f91d173795a2f46d6fc493387ce084d (diff)
Merge tag 'nand/for-4.18' of git://git.infradead.org/linux-mtd into mtd/next
Core changes: - Add Miquel as a NAND maintainer - Add access mode to the nand_page_io_req struct - Fix kernel-doc in rawnand.h - Support bit-wise majority to recover from corrupted ONFI parameter pages - Stop checking FAIL bit after a SET_FEATURES, as documented in the ONFI spec Raw NAND Driver changes: - Fix and cleanup the error path of many NAND controller drivers - GPMI: * Cleanup/simplification of a few aspects in the driver * Take ECC setup specified in the DT into account - sunxi: remove support for GPIO-based R/B polling - MTK: * Use of_device_get_match_data() instead of of_match_device() * Add an entry in MAINTAINERS for this driver * Fix nand-ecc-step-size and nand-ecc-strength description in the DT bindings doc - fsl_ifc: fix ->cmdfunc() to read more than one ONFI parameter page OneNAND driver changes: - samsung: use dev_get_drvdata() instead of platform_get_drvdata()
-rw-r--r--Documentation/devicetree/bindings/mtd/gpmi-nand.txt5
-rw-r--r--Documentation/devicetree/bindings/mtd/mtk-nand.txt24
-rw-r--r--Documentation/devicetree/bindings/mtd/sunxi-nand.txt2
-rw-r--r--MAINTAINERS8
-rw-r--r--drivers/mtd/nand/onenand/samsung.c6
-rw-r--r--drivers/mtd/nand/raw/davinci_nand.c25
-rw-r--r--drivers/mtd/nand/raw/diskonchip.c4
-rw-r--r--drivers/mtd/nand/raw/fsl_elbc_nand.c13
-rw-r--r--drivers/mtd/nand/raw/fsl_ifc_nand.c29
-rw-r--r--drivers/mtd/nand/raw/fsmc_nand.c27
-rw-r--r--drivers/mtd/nand/raw/gpmi-nand/gpmi-lib.c54
-rw-r--r--drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c188
-rw-r--r--drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.h25
-rw-r--r--drivers/mtd/nand/raw/hisi504_nand.c35
-rw-r--r--drivers/mtd/nand/raw/lpc32xx_mlc.c38
-rw-r--r--drivers/mtd/nand/raw/lpc32xx_slc.c26
-rw-r--r--drivers/mtd/nand/raw/mtk_ecc.c7
-rw-r--r--drivers/mtd/nand/raw/mtk_nand.c10
-rw-r--r--drivers/mtd/nand/raw/nand_base.c89
-rw-r--r--drivers/mtd/nand/raw/sunxi_nand.c91
-rw-r--r--include/linux/mtd/nand.h3
-rw-r--r--include/linux/mtd/rawnand.h35
22 files changed, 328 insertions, 416 deletions
diff --git a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
index b289ef3c1b7e..393588385c6e 100644
--- a/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/gpmi-nand.txt
@@ -47,6 +47,11 @@ Optional properties:
47 partitions written from Linux with this feature 47 partitions written from Linux with this feature
48 turned on may not be accessible by the BootROM 48 turned on may not be accessible by the BootROM
49 code. 49 code.
50 - nand-ecc-strength: integer representing the number of bits to correct
51 per ECC step. Needs to be a multiple of 2.
52 - nand-ecc-step-size: integer representing the number of data bytes
53 that are covered by a single ECC step. The driver
54 supports 512 and 1024.
50 55
51The device tree may optionally contain sub-nodes describing partitions of the 56The device tree may optionally contain sub-nodes describing partitions of the
52address space. See partition.txt for more detail. 57address space. See partition.txt for more detail.
diff --git a/Documentation/devicetree/bindings/mtd/mtk-nand.txt b/Documentation/devicetree/bindings/mtd/mtk-nand.txt
index 1c88526dedfc..f20ab4abd214 100644
--- a/Documentation/devicetree/bindings/mtd/mtk-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/mtk-nand.txt
@@ -50,14 +50,19 @@ Optional:
50- nand-on-flash-bbt: Store BBT on NAND Flash. 50- nand-on-flash-bbt: Store BBT on NAND Flash.
51- nand-ecc-mode: the NAND ecc mode (check driver for supported modes) 51- nand-ecc-mode: the NAND ecc mode (check driver for supported modes)
52- nand-ecc-step-size: Number of data bytes covered by a single ECC step. 52- nand-ecc-step-size: Number of data bytes covered by a single ECC step.
53 valid values: 512 and 1024. 53 valid values:
54 512 and 1024 on mt2701 and mt2712.
55 512 only on mt7622.
54 1024 is recommended for large page NANDs. 56 1024 is recommended for large page NANDs.
55- nand-ecc-strength: Number of bits to correct per ECC step. 57- nand-ecc-strength: Number of bits to correct per ECC step.
56 The valid values that the controller supports are: 4, 6, 58 The valid values that each controller supports:
57 8, 10, 12, 14, 16, 18, 20, 22, 24, 28, 32, 36, 40, 44, 59 mt2701: 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28,
58 48, 52, 56, 60. 60 32, 36, 40, 44, 48, 52, 56, 60.
61 mt2712: 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 28,
62 32, 36, 40, 44, 48, 52, 56, 60, 68, 72, 80.
63 mt7622: 4, 6, 8, 10, 12, 14, 16.
59 The strength should be calculated as follows: 64 The strength should be calculated as follows:
60 E = (S - F) * 8 / 14 65 E = (S - F) * 8 / B
61 S = O / (P / Q) 66 S = O / (P / Q)
62 E : nand-ecc-strength. 67 E : nand-ecc-strength.
63 S : spare size per sector. 68 S : spare size per sector.
@@ -66,6 +71,15 @@ Optional:
66 O : oob size. 71 O : oob size.
67 P : page size. 72 P : page size.
68 Q : nand-ecc-step-size. 73 Q : nand-ecc-step-size.
74 B : number of parity bits needed to correct
75 1 bitflip.
76 According to MTK NAND controller design,
77 this number depends on max ecc step size
78 that MTK NAND controller supports.
79 If max ecc step size supported is 1024,
80 then it should be always 14. And if max
81 ecc step size is 512, then it should be
82 always 13.
69 If the result does not match any one of the listed 83 If the result does not match any one of the listed
70 choices above, please select the smaller valid value from 84 choices above, please select the smaller valid value from
71 the list. 85 the list.
diff --git a/Documentation/devicetree/bindings/mtd/sunxi-nand.txt b/Documentation/devicetree/bindings/mtd/sunxi-nand.txt
index 0734f03bf3d3..dcd5a5d80dc0 100644
--- a/Documentation/devicetree/bindings/mtd/sunxi-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/sunxi-nand.txt
@@ -22,8 +22,6 @@ Optional properties:
22- reset : phandle + reset specifier pair 22- reset : phandle + reset specifier pair
23- reset-names : must contain "ahb" 23- reset-names : must contain "ahb"
24- allwinner,rb : shall contain the native Ready/Busy ids. 24- allwinner,rb : shall contain the native Ready/Busy ids.
25 or
26- rb-gpios : shall contain the gpios used as R/B pins.
27- nand-ecc-mode : one of the supported ECC modes ("hw", "soft", "soft_bch" or 25- nand-ecc-mode : one of the supported ECC modes ("hw", "soft", "soft_bch" or
28 "none") 26 "none")
29 27
diff --git a/MAINTAINERS b/MAINTAINERS
index 0a1410d5a621..634abf4569c4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8941,6 +8941,13 @@ L: linux-wireless@vger.kernel.org
8941S: Maintained 8941S: Maintained
8942F: drivers/net/wireless/mediatek/mt7601u/ 8942F: drivers/net/wireless/mediatek/mt7601u/
8943 8943
8944MEDIATEK NAND CONTROLLER DRIVER
8945M: Xiaolei Li <xiaolei.li@mediatek.com>
8946L: linux-mtd@lists.infradead.org
8947S: Maintained
8948F: drivers/mtd/nand/raw/mtk_*
8949F: Documentation/devicetree/bindings/mtd/mtk-nand.txt
8950
8944MEDIATEK RANDOM NUMBER GENERATOR SUPPORT 8951MEDIATEK RANDOM NUMBER GENERATOR SUPPORT
8945M: Sean Wang <sean.wang@mediatek.com> 8952M: Sean Wang <sean.wang@mediatek.com>
8946S: Maintained 8953S: Maintained
@@ -9574,6 +9581,7 @@ F: drivers/net/ethernet/myricom/myri10ge/
9574 9581
9575NAND FLASH SUBSYSTEM 9582NAND FLASH SUBSYSTEM
9576M: Boris Brezillon <boris.brezillon@bootlin.com> 9583M: Boris Brezillon <boris.brezillon@bootlin.com>
9584M: Miquel Raynal <miquel.raynal@bootlin.com>
9577R: Richard Weinberger <richard@nod.at> 9585R: Richard Weinberger <richard@nod.at>
9578L: linux-mtd@lists.infradead.org 9586L: linux-mtd@lists.infradead.org
9579W: http://www.linux-mtd.infradead.org/ 9587W: http://www.linux-mtd.infradead.org/
diff --git a/drivers/mtd/nand/onenand/samsung.c b/drivers/mtd/nand/onenand/samsung.c
index 2e9d076e445a..4cce4c0311ca 100644
--- a/drivers/mtd/nand/onenand/samsung.c
+++ b/drivers/mtd/nand/onenand/samsung.c
@@ -958,8 +958,7 @@ static int s3c_onenand_remove(struct platform_device *pdev)
958 958
959static int s3c_pm_ops_suspend(struct device *dev) 959static int s3c_pm_ops_suspend(struct device *dev)
960{ 960{
961 struct platform_device *pdev = to_platform_device(dev); 961 struct mtd_info *mtd = dev_get_drvdata(dev);
962 struct mtd_info *mtd = platform_get_drvdata(pdev);
963 struct onenand_chip *this = mtd->priv; 962 struct onenand_chip *this = mtd->priv;
964 963
965 this->wait(mtd, FL_PM_SUSPENDED); 964 this->wait(mtd, FL_PM_SUSPENDED);
@@ -968,8 +967,7 @@ static int s3c_pm_ops_suspend(struct device *dev)
968 967
969static int s3c_pm_ops_resume(struct device *dev) 968static int s3c_pm_ops_resume(struct device *dev)
970{ 969{
971 struct platform_device *pdev = to_platform_device(dev); 970 struct mtd_info *mtd = dev_get_drvdata(dev);
972 struct mtd_info *mtd = platform_get_drvdata(pdev);
973 struct onenand_chip *this = mtd->priv; 971 struct onenand_chip *this = mtd->priv;
974 972
975 this->unlock_all(mtd); 973 this->unlock_all(mtd);
diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c
index 0f09518d980f..7255a0d94374 100644
--- a/drivers/mtd/nand/raw/davinci_nand.c
+++ b/drivers/mtd/nand/raw/davinci_nand.c
@@ -27,7 +27,6 @@
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/clk.h>
31#include <linux/io.h> 30#include <linux/io.h>
32#include <linux/mtd/rawnand.h> 31#include <linux/mtd/rawnand.h>
33#include <linux/mtd/partitions.h> 32#include <linux/mtd/partitions.h>
@@ -55,7 +54,6 @@ struct davinci_nand_info {
55 struct nand_chip chip; 54 struct nand_chip chip;
56 55
57 struct device *dev; 56 struct device *dev;
58 struct clk *clk;
59 57
60 bool is_readmode;