- 10 6月, 2017 5 次提交
-
-
由 Masahiro Yamada 提交于
No need to use two struct resource pointers. Just reuse one. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Matthias Lange 提交于
Signed-off-by: NMatthias Lange <matthias.lange@kernkonzept.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Matthias Lange 提交于
This makes it easier to grep. Signed-off-by: NMatthias Lange <matthias.lange@kernkonzept.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Arvind Yadav 提交于
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
If we see unrecoverable ECC error, we need to count number of bitflips from all-ones and report correctable/uncorrectable according to that. Otherwise we report ECC failed on erased flash with single bit error. Signed-off-by: NPavel Machek <pavel@denx.de> Reported-by: NDarwin Dingel <Darwin.Dingel@alliedtelesis.co.nz> Acked-by: NDarwin Dingel <Darwin.Dingel@alliedtelesis.co.nz> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 01 6月, 2017 24 次提交
-
-
由 Xiaolei Li 提交于
MT2712 NAND FLASH Controller is similar to MT2701 except those following: (1) MT2712 supports up to 148B spare size per 1KB size sector (the same with 74B spare size per 512B size sector). There are three new spare format: 61, 67, 74. (2) MT2712 supports up to 80 bit ecc strength. There are three new ecc strength level: 68, 72, 80. (3) MT2712 ECC encode parity data register's start offset is 0x300, and different with 0x10 of MT2701. (4) MT2712 improves ecc irq function. When ECC works in ECC_NFI_MODE, MT2701 will generate ecc irq number the same with ecc steps during page read. However, MT2712 can only generate one ecc irq. Changes of this patch are: (1) add two new variables named pg_irq_sel, encode_parity_reg0 in struct mtk_ecc_caps. (2) add new bitfield ECC_PG_IRQ_SEL for register ECC_IRQ_REG. (3) add ecc strength array of mt2712. (4) add spare size array of mt2712. (5) add mt2712 nfc and ecc device compatiable and data. Signed-off-by: NXiaolei Li <xiaolei.li@mediatek.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Xiaolei Li 提交于
ECC strength and spare size supported may be different among MTK NAND FLASH Controller IPs. This patch contains changes as following: (1) add new struct mtk_nfc_caps to support different spare size. (2) add new struct mtk_ecc_caps to support different ecc strength. (3) remove ECC_CNFG_xBIT define, use a for loop to do ecc strength config. (4) remove PAGEFMT_SPARE_ define, use a for loop to do spare format config. (5) malloc ecc->eccdata buffer according to max ecc strength of this IP. Signed-off-by: NXiaolei Li <xiaolei.li@mediatek.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Xiaolei Li 提交于
The register NFI_PAGEFMT is always 32 bits length, so it is better to do register program using writel() compare with writew(). Signed-off-by: NXiaolei Li <xiaolei.li@mediatek.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Xiaolei Li 提交于
Add MT2712 NAND Flash Controller dt bindings documentation. Signed-off-by: NXiaolei Li <xiaolei.li@mediatek.com> Reviewed-by: NMatthias Brugger <matthias.bgg@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Arnd Bergmann 提交于
The newly added suspend/resume support causes a harmless warning: drivers/mtd/nand/atmel/nand-controller.c:2513:12: error: 'atmel_nand_controller_resume' defined but not used [-Werror=unused-function] This shuts up the warning with a __maybe_unused annotation. Fixes: b107007a7114 ("mtd: nand: atmel: Add PM ops") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
Drivers are supposed to set correct ecc->{size,strength,bytes} before calling nand_scan_tail(), but it does not complain about ecc->total bigger than oobsize. In this case, chip->scan_bbt() crashes due to memory corruption, but it is hard to debug. It would be kind to fail it earlier with a clear message. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
READ0 is sometimes used to exit GET STATUS mode. When this is the case no address cycles are requested, and we can use this information to detect that READSTART should not be issued after READ0 or that we shouldn't wait for the chip to be ready. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
-
由 Boris Brezillon 提交于
Drivers setting NAND_ECC_CUSTOM_PAGE_ACCESS are supposed to handle the full read/write page sequence, and waiting for a page to actually be programmed is part of this write-page sequence. This is also what is done in ->write_oob_xxx() hooks, so let's do that in ->write_page_xxx() as well to make it consistent. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
SEQIN is supposed to be used when one wants to start programming a page. What we want here is just to change the column within the page, which is done with the RNDIN command. Fixes: 6956e238 ("mtd: nand: add tango NAND flash controller support") Cc: stable@vger.kernel.org Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NMarc Gonzalez <marc_gonzalez@sigmadesigns.com>
-
由 Boris Brezillon 提交于
The core already sends the NAND_CMD_READ0 for us. Duplicating this call in the driver is useless and introduces a perf penalty. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
ecc->read_subpage is set to sunxi_nfc_hw_ecc_read_subpage_dma when ->dmac != NULL, but is then unconditionally overwritten in the common init path. Remove this extra assignment to allow usage of the DMA operation when possible. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The ->errstat() hook is no longer implemented NAND controller drivers. Get rid of it before someone starts abusing it. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Cached programming is always skipped, so drop the associated code until we decide to really support it. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Provide a ->resume() hook to make sure the NAND timings are correctly restored by resetting all chips connected to the controller. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The NAND controller IP can adapt the NAND controller timings dynamically. Implement the ->setup_data_interface() hook to support this feature. Note that it's not supported on at91rm9200 because this SoC has a completely different SMC block, which is not supported yet. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Some NAND controllers can assign different NAND timings to different CS lines. Pass the CS line information to ->setup_data_interface() so that the NAND controller driver knows which CS line is concerned by the setup_data_interface() request. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The only user of gpmi_nand_exit() is gpmi_nand_remove(). Move its content to the caller. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Acked-by: NHan Xu <han.xu@nxp.com>
-
由 Boris Brezillon 提交于
The GPMI driver is wrongly assuming that nand_release() can safely be called on an uninitialized/unregistered NAND device. Add a new err_nand_cleanup label in the error path and only execute if nand_scan_tail() succeeded. Note that we now call nand_cleanup() instead of nand_release() (nand_release() is actually grouping the mtd_device_unregister() and nand_cleanup() in one call) because there's no point in trying to unregister a device that has never been registered. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Acked-by: NHan Xu <han.xu@nxp.com> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
由 Stefan Agner 提交于
The clock requirements are completely missing, add the clocks currently required by the driver. Signed-off-by: NStefan Agner <stefan@agner.ch> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Stefan Agner 提交于
Add support for i.MX 7 SoC. The i.MX 7 has a slightly different clock architecture requiring only two clocks to be referenced. The IP is slightly different compared to i.MX 6, but currently none of this differences are in use, therefore reuse GPMI_IS_MX6. Signed-off-by: NStefan Agner <stefan@agner.ch> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Stefan Agner 提交于
Add device specific list of clocks required, and handle all clocks in a single for loop. This avoids further code duplication when adding i.MX 7 support. Signed-off-by: NStefan Agner <stefan@agner.ch> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Pavel Machek 提交于
If we see ~0UL in flash, there's no need for hweight, and no need to check number of bitflips. So this should be net win. Signed-off-by: NPavel Machek <pavel@denx.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
This commit adjusts the fsmc_nand driver so that it accepts the NAND_ECC_ON_DIE case. It simply does nothing in this case, since both the ECC operations and OOB layout will be defined by the NAND chip code rather than by the NAND controller code. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
Now that the core NAND subsystem has support for on-die ECC, this commit brings the necessary code to support on-die ECC on Micron NANDs. In micron_nand_init(), we detect if the Micron NAND chip supports on-die ECC mode, by checking a number of conditions: - It must be an ONFI NAND - It must be a SLC NAND - Enabling *and* disabling on-die ECC must work - The on-die ECC must be correcting 4 bits per 512 bytes of data. Some Micron NAND chips have an on-die ECC able to correct 8 bits per 512 bytes of data, but they work slightly differently and therefore we don't support them in this patch. Then, if the on-die ECC cannot be disabled (some Micron NAND have on-die ECC forcefully enabled), we bail out, as we don't support such NANDs. Indeed, the implementation of raw_read()/raw_write() make the assumption that on-die ECC can be disabled. Support for Micron NANDs with on-die ECC forcefully enabled can easily be added, but in the absence of such HW for testing, we preferred to simply bail out. If the on-die ECC is supported, and requested in the Device Tree, then it is indeed enabled, by using custom implementations of the ->read_page(), ->read_page_raw(), ->write_page() and ->write_page_raw() operation to properly handle the on-die ECC. In the non-raw functions, we need to enable the internal ECC engine before issuing the NAND_CMD_READ0 or NAND_CMD_SEQIN commands, which is why we set the NAND_ECC_CUSTOM_PAGE_ACCESS option at initialization time (it asks the NAND core to let the NAND driver issue those commands). Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 30 5月, 2017 1 次提交
-
-
由 Boris Brezillon 提交于
A lot of drivers are providing their own ->cmdfunc(), and most of the time this implementation does not support all possible NAND operations. But since ->cmdfunc() cannot return an error code, the core has no way to know that the operation it requested is not supported. This is a problem we cannot address for all kind of operations with the current design, but we can prevent these silent failures for the GET/SET FEATURES operation by overloading the default ->onfi_{set,get}_features() methods with one returning -ENOTSUPP. Reported-by: NChris Packham <Chris.Packham@alliedtelesis.co.nz> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NChris Packham <Chris.Packham@alliedtelesis.co.nz>
-
- 15 5月, 2017 10 次提交
-
-
由 Thomas Petazzoni 提交于
The nand_read_page_raw() and nand_write_page_raw() functions might be re-used by vendor-specific implementations of the read_page/write_page functions. Instead of having vendor-specific code duplicate this code, it is much better to export those functions and allow them to be re-used. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
A number of NAND flashes have a capability called "on-die ECC" where the NAND chip itself is capable of detecting and correcting errors. Linux already has support for using the ECC implementation of the NAND controller, or a software based ECC implementation, but not for using the ECC implementation of the NAND controller. However, such an implementation is sometimes useful in situations where the NAND controller provides ECC algorithms that are not strong enough for the NAND chip used on the system. A typical case is a NAND chip that requires a 4-bit ECC, while the NAND controller only provides a 1-bit ECC algorithm. This commit introduces the support for the NAND_ECC_ON_DIE ECC mode: - Parsing of the "on-die" value for the "nand-ecc-mode" Device Tree property - Handling NAND_ECC_ON_DIE case in nand_scan_tail(). The idea is that the vendor specific code for the NAND chip must implement ->read_page() and ->write_page(). It may optionally provide its own ->read_page_raw() and ->write_page_raw() as well. For OOB operation, we assume the standard operations are good enough, but they can be overridden by the vendor specific code if needed. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
A number of NAND chips support a feature called on-die ECC, where the NAND chip itself is capable of doing error detection and correction. The new "on-die" value for nand-ecc-mode indicates that we want this functionality to be used. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: NRob Herring <robh@kernel.org> Reviewed-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
When timings are no longer provided by the Device Tree, we now use the SDR timings specified by the NAND flash, and such SDR timings are always provided. Therefore, it is no longer necessary to keep "default" timings in the fmsc driver. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
Until now, the fsmc_nand driver was either using controller timings specified in the Device Tree (through FSMC specific DT properties) or alternatively default/fallback timings. This commit implements support to use the timings advertised by the NAND chip itself, by implementing the ->setup_data_interface() hook. To preserve backward compatibility, if timings are specified in the Device Tree, we use the timings from the Device Tree (and don't implement ->setup_data_interface). Many thanks to Boris Brezillon for coming up with the logic to convert the NAND chip timings into the timings expected by the FSMC controller. Also, since the timings are now not only coming from the DT, the message warning that default timings will be used is removed. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
In preparation for the introduction of support for using SDR timings exposed by the NAND flash instead of hard-coded timings, this commit reworks the fsmc_nand_setup() function to take a "struct fsmc_nand_data" as argument, which already contains the I/O registers base address, bank and bus width information. The timings is also currently contained in the "struct fsmc_nand_data", but we still pass it as a separate argument because the support for using SDR timings will pass a different value. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Alexander Couzens 提交于
If ECC strength is 4bits/512bytes the algorithm of the ECC engine is BCH, otherwise (1bit/512bytes) Hamming is used. Signed-off-by: NAlexander Couzens <lynxis@fe80.eu> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The mtd_set_ooblayout() accesor has been added to hide internals of mtd_info and ease future refactoring. Call mtd_set_ooblayout() instead of directly accessing mtd->ooblayout. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NHarvey Hunt <harveyhuntnexus@gmail.com>
-
由 Ezequiel Garcia 提交于
The Mediatek NAND driver is only needed for a specific platform, so avoid cluttering the configuration. Signed-off-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ezequiel Garcia 提交于
The Hisilicon NAND driver is only needed for a specific platform, so avoid cluttering the configuration. Signed-off-by: NEzequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-