- 28 10月, 2016 1 次提交
-
-
由 Fabio Estevam 提交于
We should disable the previously enabled GPMI clocks in the error paths. Also, when gpmi_enable_clk() fails simply return the error code immediately rather than jumping to to the 'err_out' label. Signed-off-by: NFabio Estevam <fabio.estevam@nxp.com> Reviewed-by: NMarek Vasut <marex@denx.de> Acked-by: NHan Xu <han.xu@nxp.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 04 10月, 2016 1 次提交
-
-
由 Brian Norris 提交于
Introduced by commit fde85cfd ("mtd: nand: Fix nand_command_lp() for 8bits opcodes") and I didn't have the heart to have Boris rewrite his pull request just for that. Anyway, there's some value in having stable commit hashes. Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 23 9月, 2016 28 次提交
-
-
由 Richard Weinberger 提交于
Provide a nand_cleanup() function to free all nand related resources without unregistering the mtd device. This should allow drivers to call mtd_device_unregister() and handle its return value and still being able to cleanup all nand related resources. Signed-off-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NDaniel Walter <dwalter@sigma-star.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
We are about to drop the OF_MTD Kconfig option. Test CONFIG_OF activation instead of CONFIG_OF_MTD. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
8 bits opcodes should be followed by a single address cycle. Make the 2nd address cycle dependent of !nand_opcode_8bits(command). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Setup the maximum ECC config when NAND_ECC_MAXIMIZE is set. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Add support for ECC maximization when software BCH with nand_ooblayout_lp_ops layout is used. Other cases should be handled by the NAND controller driver. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The generic NAND DT bindings allows one to tweak the ECC strength and step size to their need. It can be used to lower the ECC strength to match a bootloader/firmware config, but might also be used to get a better reliability. In the latter case, the user might want to use the maximum ECC strength without having to explicitly calculate the exact value (this value not only depends on the OOB size, but also on the NAND controller, and can be tricky to extract). Add a generic 'nand-ecc-maximize' DT property and the associated NAND_ECC_MAXIMIZE flag, to let ECC controller drivers select the best ECC strength and step-size on their own. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRob Herring <robh@kernel.org>
-
由 Sascha Hauer 提交于
So far we relied on reset default or the bootloader to configure a suitable clk rate for the Nand controller. This works but we can optimize the timing for better performance. This sets the clk rate for v2 controllers (i.MX25/35) based on the timing mode read from the ONFI parameter page. This may also enable the symmetric mode (aks EDO mode) if necessary which reads one word per clock cycle. Tested on an i.MX25 with a Micron MT29F4G08ABBDAHC attached. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Sascha Hauer 提交于
To be able to support different ONFI timing modes we have to implement the onfi_set_features and onfi_get_features. Tested on an i.MX25 SoC. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Sascha Hauer 提交于
The NAND framework is now able to select the best NAND timings for us. All we have to do is implement a ->setup_data_interface() function to apply those timings and remove the timing selection code from the sunxi driver. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The NAND framework provides several helpers to query timing modes supported by a NAND chip, but this implies that all NAND controller drivers have to implement the same timings selection dance. Also currently NAND devices can be resetted at arbitrary places which also resets the timing for ONFI chips to timing mode 0. Provide a common logic to select the best timings based on ONFI or ->onfi_timing_mode_default information. Hook this into nand_reset() to make sure the new timing is applied each time during a reset. NAND controller willing to support timings adjustment should just implement the ->setup_data_interface() method. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
-
由 Sascha Hauer 提交于
The nand layer will need ONFI mode 0 to use it as timing mode before and right after reset. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Sascha Hauer 提交于
onfi_init_data_interface() initializes a data interface with values from a given ONFI mode. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Sascha Hauer 提交于
struct nand_data_interface is the designated type to pass to the NAND drivers to configure the timing. To simplify further patches convert the onfi_sdr_timings array from type struct nand_sdr_timings nand_data_interface. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Sascha Hauer 提交于
When NAND devices are resetted some initialization may have to be done, like for example they have to be configured for the timing mode that shall be used. To get a common place where this initialization can be implemented create a nand_reset() function. This currently only issues a NAND_CMD_RESET to the NAND device. The places issuing this command manually are replaced with a call to nand_reset(). Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Roger Quadros 提交于
Some Keystone devices (e.g. K2G) include a OMAP NAND IP. Allow the NAND driver to be usable for both Keystone and OMAP devices. Signed-off-by: NRoger Quadros <rogerq@ti.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ray Jui 提交于
This patch adds big endian and ONFI support for various iProc based SoCs that use the core brcmstb NAND controller This patch was originally implemented by Prafulla Kota <prafulla.kota@broadcom.com> and fully tested on iProc based NS2 SVK Signed-off-by: NPrafulla Kota <prafulla.kota@broadcom.com> Signed-off-by: NRay Jui <ray.jui@broadcom.com> Reviewed-by: NKamal Dasu <kdasu.kdev@gmail.com> Acked-by: NKamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Kyle Roeschley 提交于
If erasing or writing the BBT fails, we should mark the current BBT block as bad and use the BBT descriptor to scan for the next available unused block in the BBT. We should only return a failure if there isn't any space left. Signed-off-by: NKyle Roeschley <kyle.roeschley@ni.com> Suggested-by: NJeff Westfahl <jeff.westfahl@ni.com> Tested-by: NKyle Roeschley <kyle.roeschley@ni.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
This clarifies the write_bbt() function by removing the write label and simplifying the error/exit path. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NKyle Roeschley <kyle.roeschley@ni.com>
-
由 Boris Brezillon 提交于
In the ONFI spec, the tRR_min entry is defined before the tRST_max one. Reoder the definition to make it easier to review. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
ONFI 4.0 spec defines different values for the tADL_min timing. Since we don't want to have different timings depending on the ONFI version, we just set tADL_min to the maximum value (the one specified in the ONFI 4.0 spec). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Han Xu 提交于
change the way to calculate pagesize to get correct free oob space for legacy_set_geometry function. Signed-off-by: NHan Xu <han.xu@nxp.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Brian Norris 提交于
Some build tools noticed that 'cookie' is being set but not used. Might as well catch the errors here and handle them the same way we handle other DMA prep steps. Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Krzysztof Kozlowski 提交于
The driver registered for CPU frequency transitions to recalculate its clock when ARM clock frequency changes (ratio between frequencies of ARM's parent clock (fclk) and clock for peripherals remains fixed). This is needed only on S3C24xx platform when cpufreq driver is enabled so limit the ifdef to respective cpufreq Kconfig. Suggested-by: NMarek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Andrey Smirnov 提交于
Using "goto" and "switch" statement only makes it harder to follow control flow and doesn't bring any advantages. Rewrite the code to avoid using "goto". Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Andrey Smirnov 提交于
If no user specified chip->select_chip() function is provided, code in nand_base.c will automatically set this hook to nand_select_chip(), which in turn depends on chip->cmd_ctrl() hook being valid. Not providing both of those functions in NAND controller driver (for example by mistake) will result in a bit cryptic segfault. Same is true for chip->cmdfunc(). To avoid the above scenario add a check in nand_scan_dent and error out if cmd_ctrl() is not provided. Suggested-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Suggested-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Andrey Smirnov 提交于
Config MTD_NAND_FSL_IFC is already located inside 'if MTD_NAND' statment, so there's no need to explicitly specify it as a dependency. Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Andrey Smirnov 提交于
MTD_NAND_FSL_ELBC selects FSL_LBC that in turn depends on FSL_SOC, so depending on PPC instead of FSL_SOC leads to this message: warning: (MPC836x_RDK && MTD_NAND_FSL_ELBC && MTD_NAND_FSL_UPM) selects FSL_LBC which has unmet direct dependencies (FSL_SOC) when doing make ARCH=powerpc \ CROSS_COMPILE=powerpc-e500v2-linux-gnuspe- \ allmodconfig" Changing dependency to FSL_SOC fixes that. Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Marc Gonzalez 提交于
The code to initialize a struct nand_hw_control is duplicated across several drivers. Factorize it using an inline function. Signed-off-by: NMarc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 19 9月, 2016 3 次提交
-
-
由 Lothar Waßmann 提交于
commit a894cf6c ("mtd: nand: mxc: switch to mtd_ooblayout_ops") introduced a regression accessing the OOB area from the mxc_nand driver due to an Obiwan error in the mxc_nand_v[12]_ooblayout_free() functions. They report a bogus oobregion { 64, 7 } which leads to errors accessing bogus data when reading the oob area. Prior to the commit the mtd-oobtest module could be run without any errors. With the offending commit, this test fails with results like: |Running mtd-oobtest | |================================================= |mtd_oobtest: MTD device: 5 |mtd_oobtest: MTD device size 524288, eraseblock size 131072, page size 2048, count of eraseblocks 4, pages per eraseblock 64, OOB size 64 |mtd_test: scanning for bad eraseblocks |mtd_test: scanned 4 eraseblocks, 0 are bad |mtd_oobtest: test 1 of 5 |mtd_oobtest: writing OOBs of whole device |mtd_oobtest: written up to eraseblock 0 |mtd_oobtest: written 4 eraseblocks |mtd_oobtest: verifying all eraseblocks |mtd_oobtest: error @addr[0x0:0x19] 0x9a -> 0x78 diff 0xe2 |mtd_oobtest: error @addr[0x0:0x1a] 0xcc -> 0x0 diff 0xcc |mtd_oobtest: error @addr[0x0:0x1b] 0xe0 -> 0x85 diff 0x65 |mtd_oobtest: error @addr[0x0:0x1c] 0x60 -> 0x62 diff 0x2 |mtd_oobtest: error @addr[0x0:0x1d] 0x69 -> 0x45 diff 0x2c |mtd_oobtest: error @addr[0x0:0x1e] 0xcd -> 0xa0 diff 0x6d |mtd_oobtest: error @addr[0x0:0x1f] 0xf2 -> 0x60 diff 0x92 |mtd_oobtest: error: verify failed at 0x0 [...] Signed-off-by: NLothar Waßmann <LW@KARO-electronics.de> Fixes: a894cf6c ("mtd: nand: mxc: switch to mtd_ooblayout_ops") Cc: <stable@vger.kernel.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 RogerCC Lin 提交于
When mtk_nfc_do_write_page() comparing the sector number,because the sector number field is at the 12th-bit position of NFI_BYTELEN register,the masked register should be shifted 12 bits before being compared.The result of this bug may cause the second subpage has incomplete ECC parity bytes. Signed-off-by: NRogerCC Lin <rogercc.lin@mediatek.com> Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device") Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 RogerCC Lin 提交于
When mtk_ecc_encode() is writing the ECC parity data to the OOB region,because each register is 4 bytes in length,but the len's unit is in bytes,the operation in the for loop will cross the ECC's boundary. Signed-off-by: NRogerCC Lin <rogercc.lin@mediatek.com> Fixes: 1d6b1e46 ("mtd: mediatek: driver for MTK Smart Device") Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 10 9月, 2016 1 次提交
-
-
由 Karl Beldan 提交于
This fixes subpage writes when using 4-bit HW ECC. There has been numerous reports about ECC errors with devices using this driver for a while. Also the 4-bit ECC has been reported as broken with subpages in [1] and with 16 bits NANDs in the driver and in mach* board files both in mainline and in the vendor BSPs. What I saw with 4-bit ECC on a 16bits NAND (on an LCDK) which got me to try reinitializing the ECC engine: - R/W on whole pages properly generates/checks RS code - try writing the 1st subpage only of a blank page, the subpage is well written and the RS code properly generated, re-reading the same page the HW detects some ECC error, reading the same page again no ECC error is detected Note that the ECC engine is already reinitialized in the 1-bit case. Tested on my LCDK with UBI+UBIFS using subpages. This could potentially get rid of the issue workarounded in [1]. [1] 28c015a9 ("mtd: davinci-nand: disable subpage write for keystone-nand") Fixes: 6a4123e5 ("mtd: nand: davinci_nand, 4-bit ECC for smallpage") Cc: <stable@vger.kernel.org> Signed-off-by: NKarl Beldan <kbeldan@baylibre.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 30 8月, 2016 1 次提交
-
-
由 Roger Quadros 提交于
dma_request_chan() can fail returning an error pointer. In this case prevent calling dma_release_channel() to prevent a ERR_PTR() dereference. As error path can be called even with no DMA configuration, info->dma can be NULL so don't call dma_release_channel() for that case either. Fixes: de3bfc4a: ("mtd: nand: omap2: fix return value check in omap_nand_probe()") Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NRoger Quadros <rogerq@ti.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 20 7月, 2016 1 次提交
-
-
由 Hector Palacios 提交于
nand_do_write_ops() determines if it is writing a partial page with the formula: part_pagewr = (column || writelen < (mtd->writesize - 1)) When 'writelen' is exactly 1 byte less than the NAND page size the formula equates to zero, so the code doesn't process it as a partial write, although it should. As a consequence the function remains in the while(1) loop with 'writelen' becoming 0xffffffff and iterating endlessly. The bug may not be easy to reproduce in Linux since user space tools usually force the padding or round-up the write size to a page-size multiple. This was discovered in U-Boot where the issue can be reproduced by writing any size that is 1 byte less than a page-size multiple. For example, on a NAND with 2K page (0x800): => nand erase.part <partition> => nand write $loadaddr <partition> 7ff [Editor's note: the bug was added in commit 29072b96, but moved around in commit 66507c7b ("mtd: nand: Add support to use nand_base poi databuf as bounce buffer")] Fixes: 29072b96 ("[MTD] NAND: add subpage write support") Signed-off-by: NHector Palacios <hector.palacios@digi.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Cc: <stable@vger.kernel.org> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 17 7月, 2016 1 次提交
-
-
由 Florian Fainelli 提交于
Change the BUG_ON() condition in brcmnand_send_cmd() which checks for the interrupt status "controller ready" bit to a WARN_ON. There is no good reason to kill the system when this condition occur because we could have systems which listed the NAND controller as available (e.g: from Device Tree), but the NAND chip could be malfunctioning and not responding. Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com> Acked-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NKamal Dasu <kdasu.kdev@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 16 7月, 2016 1 次提交
-
-
由 Wei Yongjun 提交于
In case of error, the function dma_request_chan() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: aa7abd31 ('mtd: nand: omap2: Support parsing dma channel information from DT') Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 14 7月, 2016 2 次提交
-
-
由 Teresa Remmet 提交于
commit c9711ec5 ("mtd: nand: omap: Clean up device tree support") removes the check for the old elm phandle binding. Add it again to keep backward compatibility. Fixes: commit c9711ec5 ("mtd: nand: omap: Clean up device tree support") Signed-off-by: NTeresa Remmet <t.remmet@phytec.de> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Raghav Dogra 提交于
This patch enables IFC NAND support on ARM layerscape platform. It fixes the dependency to enable NAND. The include files are being modified to ensure complilation for both PowerPC and ARM architectures. Signed-off-by: NRaghav Dogra <raghav.dogra@nxp.com> Acked-by: NScott Wood <oss@buserror.net> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-