diff options
| author | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-06-07 16:52:56 -0400 |
|---|---|---|
| committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-06-07 16:52:56 -0400 |
| commit | 6e89b84e28f69c4f848dc8f1ea8fdecf33f2fbb4 (patch) | |
| tree | 4c32febe723d922cf551e34c5a082033ebe371ce | |
| parent | c64d4419a17cfb39a5b573f9016cd02ade4c9a64 (diff) | |
| parent | f567c71f4f91d173795a2f46d6fc493387ce084d (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()
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 | ||
| 51 | The device tree may optionally contain sub-nodes describing partitions of the | 56 | The device tree may optionally contain sub-nodes describing partitions of the |
| 52 | address space. See partition.txt for more detail. | 57 | address 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 | |||
| 8941 | S: Maintained | 8941 | S: Maintained |
| 8942 | F: drivers/net/wireless/mediatek/mt7601u/ | 8942 | F: drivers/net/wireless/mediatek/mt7601u/ |
| 8943 | 8943 | ||
| 8944 | MEDIATEK NAND CONTROLLER DRIVER | ||
| 8945 | M: Xiaolei Li <xiaolei.li@mediatek.com> | ||
| 8946 | L: linux-mtd@lists.infradead.org | ||
| 8947 | S: Maintained | ||
| 8948 | F: drivers/mtd/nand/raw/mtk_* | ||
| 8949 | F: Documentation/devicetree/bindings/mtd/mtk-nand.txt | ||
| 8950 | |||
| 8944 | MEDIATEK RANDOM NUMBER GENERATOR SUPPORT | 8951 | MEDIATEK RANDOM NUMBER GENERATOR SUPPORT |
| 8945 | M: Sean Wang <sean.wang@mediatek.com> | 8952 | M: Sean Wang <sean.wang@mediatek.com> |
| 8946 | S: Maintained | 8953 | S: Maintained |
| @@ -9574,6 +9581,7 @@ F: drivers/net/ethernet/myricom/myri10ge/ | |||
| 9574 | 9581 | ||
| 9575 | NAND FLASH SUBSYSTEM | 9582 | NAND FLASH SUBSYSTEM |
| 9576 | M: Boris Brezillon <boris.brezillon@bootlin.com> | 9583 | M: Boris Brezillon <boris.brezillon@bootlin.com> |
| 9584 | M: Miquel Raynal <miquel.raynal@bootlin.com> | ||
| 9577 | R: Richard Weinberger <richard@nod.at> | 9585 | R: Richard Weinberger <richard@nod.at> |
| 9578 | L: linux-mtd@lists.infradead.org | 9586 | L: linux-mtd@lists.infradead.org |
| 9579 | W: http://www.linux-mtd.infradead.org/ | 9587 | W: 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 | ||
| 959 | static int s3c_pm_ops_suspend(struct device *dev) | 959 | static 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 | ||
| 969 | static int s3c_pm_ops_resume(struct device *dev) | 968 | static 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; | ||
