- 18 9月, 2017 2 次提交
-
-
由 Masahiro Yamada 提交于
Several drivers check ->chipsize to see if the third row address cycle is needed. Instead of embedding magic sizes such as 32MB, 128MB in drivers, introduce a new flag NAND_ROW_ADDR_3 for clean-up. Since nand_scan_ident() knows well about the device, it can handle this properly. The flag is set if the row address bit width is greater than 16. Delete comments such as "One more address cycle for ..." because intention is now clear enough from the code. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NWenyou Yang <wenyou.yang@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Miquel Raynal 提交于
Use the core's large page OOB layout functions when not reserving any space for ECC bytes in the OOB layout. Fix ->nand_ooblayout_ecc_lp() to return -ERANGE instead of a zero length in this case. Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 09 9月, 2017 1 次提交
-
-
由 Masahiro Yamada 提交于
This macro is useful to avoid link error on 32-bit systems. We have the same definition in two drivers, so move it to include/linux/kernel.h While we are here, refactor DIV_ROUND_UP_ULL() by using DIV_ROUND_DOWN_ULL(). Link: http://lkml.kernel.org/r/1500945156-12907-1-git-send-email-yamada.masahiro@socionext.comSigned-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Acked-by: NMark Brown <broonie@kernel.org> Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Richard Weinberger <richard@nod.at> Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 05 9月, 2017 3 次提交
-
-
由 Ludovic Desroches 提交于
For HSMC controller, the register layout depends on the device i.e. the offset of setup, pulse, cycle, mode and timings registers is not the same. An helper is added to provide the correct register layout. Fixes: fe9d7cb2 ("mfd: syscon: atmel-smc: Add new helpers to ease SMC regs manipulation") Suggested-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NLudovic Desroches <ludovic.desroches@microchip.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NLee Jones <lee.jones@linaro.org>
-
由 Christoph Hellwig 提交于
Make the position an in/out argument like all the other read/write helpers and and make the buf argument a void pointer. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
由 Christoph Hellwig 提交于
Use proper ssize_t and size_t types for the return value and count argument, move the offset last and make it an in/out argument like all other read/write helpers, and make the buf argument a void pointer to get rid of lots of casts in the callers. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 30 8月, 2017 1 次提交
-
-
由 Lothar Waßmann 提交于
commit c51d0ac5 ("mtd: nand: Move Samsung specific init/detection logic in nand_samsung.c") introduced a regression for Samsung SLC NAND chips. Prior to this commit chip->bits_per_cell was initialized by calling nand_get_bits_per_cell() before using nand_is_slc(). With the offending commit this call is skipped, leaving chip->bits_per_cell cleared to zero when the manufacturer specific '.detect' function calls nand_is_slc() which in turn interprets bits_per_cell != 1 as indication for an MLC chip. The effect is that e.g. a K9F1G08U0F NAND chip is falsely detected as MLC NAND with 4KiB page size rather than SLC with 2KiB page size. Add a call to nand_get_bits_per_cell() before calling the .detect hook function in nand_manufacturer_detect(), so that the nand_is_slc() calls in the manufacturer specific code will return correct results. Fixes: c51d0ac5 ("mtd: nand: Move Samsung specific init/detection logic in nand_samsung.c") Cc: <stable@vger.kernel.org> Signed-off-by: NLothar Waßmann <LW@KARO-electronics.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 25 8月, 2017 2 次提交
-
-
由 Boris Brezillon 提交于
Version 4 of the ONFI spec mandates that tADL be at least 400 nanoseconds, but, depending on the master clock rate, 400 ns may not fit in the tADL field of the SMC reg. We need to relax the check and accept the -ERANGE return code. Note that previous versions of the ONFI spec had a lower tADL_min (100 or 200 ns). It's not clear why this timing constraint got increased but it seems most NANDs are fine with values lower than 400ns, so we should be safe. Fixes: f9ce2edd ("mtd: nand: atmel: Add ->setup_data_interface() hooks") Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NQuentin Schulz <quentin.schulz@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Uwe Kleine-König 提交于
The debugfs entries must be removed before an error is returned in the probe function. Otherwise another try to load the module fails and when the debugfs files are accessed without the module loaded, the kernel still tries to call a function in that module. Fixes: 5346c27c ("mtd: nandsim: Introduce debugfs infrastructure") Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: NRichard Weinberger <richard@nod.at> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 23 8月, 2017 31 次提交
-
-
由 Andrea Adami 提交于
With the introduction of sharpslpart partition parser we can now read the offsets from NAND: we specify the list of the parsers as platform data, with cmdlinepart and ofpart parsers first allowing to override the part. table written in NAND. This is done in the board files using this driver. Use now these parsers. Signed-off-by: NAndrea Adami <andrea.adami@gmail.com> Acked-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Andrea Adami 提交于
With the introduction of sharpslpart partition parser we can now read the offsets from NAND: we specify the list of the parsers as platform data, with cmdlinepart and ofpart parsers first allowing to override the part. table written in NAND. This is done in the board files using this driver. Use now these parsers. Signed-off-by: NAndrea Adami <andrea.adami@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
Add the compatible string for IPQ8074 QPIC NAND controller version 1.5.0 which uses BAM DMA and its FLASH_DEV_CMD registers starting offset is 0x7000. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
Add the compatible string for IPQ4019 QPIC NAND controller version 1.4.0 which uses BAM DMA. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The FLASH_DEV_CMD registers starting offset is not same in different QPIC NAND controller versions. This patch adds the starting offset in NAND controller properties and uses the same for calculating the actual offset of these registers. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. Add the data descriptor preparation function which will be used only by BAM DMA for forming the data SGL’s 2. Add clear BAM transaction and call it before every new request 3. Check DMA mode for ADM or BAM and call the appropriate descriptor formation function. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. DM_EN is only required for EBI2 NAND controller which uses ADM 2. BAM mode will be disabled after power on reset which needs to be enabled before starting any BAM transfers. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The NAND controller returns ECC failure during read of completely erased codeword. The NAND controller has hardware functionality to detect erased codeword in case of BCH ECC algorithm. The NAND_ERASED_CW_DETECT_CFG register controls the erased codeword/page detection controller. This register should be reset before every page read by setting and clearing bit 0 of NAND_ERASED_CW_DETECT_CFG. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
In EBI2, all codeword data will be read in FLASH_BUF_ACC buffer and ADM will copy the data from source (FLASH_BUF_ACC) to destination (memory for data read). In QPIC, there is no FLASH_BUF_ACC and all the codeword data will held in QPIC BAM FIFO buffers. It provides multiple READ_LOCATION registers which will be used for copying the data from FIFO to memory. The READ_LOCATION register will be used to read a specific amount of data from a specific offset within the flash buffer. It supports sequential offset requests. Each request is composed of the following fields: a. Offset within the flash buffer from which data should be read b. Amount of data to be read c. Flag bit specifying the last read request from the flash buffer. Following the last read request the NANDc refers to the buffer as empty. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The QPIC NAND BAM has multiple flags to control the transfer. This patch adds flags parameter in register and data transfer DMA helper functions and modifies all these functions call with appropriate flags using following rule 1. Read and write can’t go in single command descriptor so separate SGL should be used. 2. For some of the requests, NWD flag should be set in BAM DMA descriptor. 3. For Data write, the BAM has internal buffer for each codeword. All write request will modify the data in internal buffer and this buffer will be flushed to NAND device once EOT flag is set. So for all the write requests in single codeword, the EOT should be cleared for all tx data descriptors except the last one. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. prepare_bam_async_desc is the function which will call all the DMA API’s. It will fetch the outstanding scatter gather list for passed channel and will do the DMA descriptor formation. The DMA flag is dependent upon the type of channel. 2. For ADM DMA, the descriptor is being formed for every DMA request so its sgl count will be always 1 while in BAM DMA, the clubbing of descriptor is being done to increase throughput. 3. ADM DMA uses only one channel while in BAM DMA, data descriptors will be submitted to tx channel (for write) or rx channel (for read) and all the registers read/write descriptors in command channel. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
- The BAM transaction is the core data structure which will be used for all the data transfers in QPIC NAND. Since the core framework in nand_base.c is serializing all the NAND requests so allocating BAM transaction before every transfer will be overhead. The memory for it be allocated during probe time and before every transfer, it will be cleared. - The BAM transaction contains the array of command and data scatter gather list and indexes. For every transfer, all the resource will be taken from BAM transaction. - The size of the buffer used for BAM transactions is calculated based on the NAND device with the maximum page size, among all the devices connected to the controller. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The EBI2 NAND controller directly remaps register read buffer with dma_map_sg and DMA address of this buffer will be passed to DMA API’s. While, on QPIC NAND controller, which uses BAM DMA, we read the controller registers by preparing a BAM command descriptor. This command descriptor requires the - controller register address - the DMA address in which we want to store the value read back from the controller register. This command descriptor will be remapped with dma_map_sg and its DMA address will be passed to DMA API’s. Therefore, it's required that we also map our register read buffer for DMA (using dma_map_single). We use the returned DMA address for preparing entries in our command descriptor. This patch adds the DMA mapping support for register read buffer. This buffer will be DMA mapped during allocation time. Before starting of any operation, this buffer will be synced for device operation and after operation completion, it will be synced again for CPU. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
1. QPIC NAND controller uses 3 BAM channels: command, data tx and data rx while EBI2 NAND controller uses only single ADM channel. 2. CRCI is only required for ADM DMA and it's not required for BAM DMA. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The current driver only supports EBI2 NAND controller which uses ADM DMA. The latest QCOM SoC uses QPIC NAND controller with BAM DMA. NAND registers and programming sequence are same for EBI2 and QPIC NAND so the same driver can support QPIC NAND also by adding the BAM DMA support. This patch adds the is_bam in NAND property which will be checked for determining the DMA engine type. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
Currently driver data is being assigned directly with ECC modes. Now, the plan is to add more NAND controller versions which will have different properties. This patch reorganizes the current driver data assignment by creating NAND controller properties structure which will contain all properties specific to NAND controller. Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The NAND page read fails without complete boot chain since NAND_DEV_CMD_VLD value is not proper. The default power on reset value for this register is 0xe - ERASE_START_VALID | WRITE_START_VALID | READ_STOP_VALID The READ_START_VALID should be enabled for sending PAGE_READ command. READ_STOP_VALID should be cleared since normal NAND page read does not require READ_STOP command. Fixes: c76b78d8 ("mtd: nand: Qualcomm NAND controller driver") Cc: stable@vger.kernel.org Reviewed-by: NArchit Taneja <architt@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Gustavo A. R. Silva 提交于
platform_get_irq() returns an error code, but the mtk_ecc driver ignores it and always returns -EINVAL. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Gustavo A. R. Silva 提交于
platform_get_irq() returns an error code, but the sh_flctl driver ignores it and always returns -ENXIO. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Pan Bian 提交于
The return value of dma_map_single() should be checked by dma_mapping_error(). However, in function flctl_dma_fifo0_transfer(), its return value is checked against NULL, which could result in failures. Signed-off-by: NPan Bian <bianpan2016@163.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Sergei Shtylyov 提交于
of_irq_get() may return 0 as well as negative error number on failure, while the driver only checks for the negative values. The driver would then call devm_request_irq() for IRQ0 in its probe method and never get a valid interrupt. Check for 'nc->irq <= 0' instead and return -ENXIO from the driver's probe if of_irq_get() returned 0. Fixes: f88fc122 ("mtd: nand: Cleanup/rework the atmel_nand driver") Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-by: NWenyou Yang <Wenyou.yang@microchip.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Martin Blumenstingl 提交于
According to the datasheet of the H27UCG8T2BTR the NAND Technology field (6th byte of the "Device Identifier Description", bits 0-2) the following values are possible: - 0x0 = 48nm - 0x1 = 41nm - 0x2 = 32nm - 0x3 = 26nm - 0x4 = 20nm - (all others are reserved) Fix this by extending the mask for this field to allow detecting value 0x4 (20nm) as valid NAND technology. Without this the detection of the ECC requirements fails, because the code assumes that the device is a 48nm device (0x4 & 0x3 = 0x0) and aborts with "Invalid ECC requirements" because it cannot map the "ECC Level". Extending the mask makes the ECC requirement detection code recognize this chip as <= 26nm and sets up the ECC step size and ECC strength correctly. Signed-off-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com> Fixes: 78f3482d ("mtd: nand: hynix: Rework NAND ID decoding to extract more information") Cc: <stable@vger.kernel.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Commit a894cf6c ("mtd: nand: mxc: switch to mtd_ooblayout_ops") introduced a bug in the OOB layout description. Even if the driver claims that 3 ECC bytes are reserved to protect 512 bytes of data, it's actually 5 ECC bytes to protect 512+6 bytes of data (some OOB bytes are also protected using extra ECC bytes). Fix the mxc_v1_ooblayout_{free,ecc}() functions to reflect this behavior. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> 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>
-
由 Philipp Zabel 提交于
Commit a53e35db ("reset: Ensure drivers are explicit when requesting reset lines") started to transition the reset control request API calls to explicitly state whether the driver needs exclusive or shared reset control behavior. Convert all drivers requesting exclusive resets to the explicit API call so the temporary transition helpers can be removed. No functional changes. Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Richard Weinberger <richard@nod.at> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Marek Vasut <marek.vasut@gmail.com> Cc: Cyrille Pitchen <cyrille.pitchen@wedev4u.fr> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Cc: linux-mtd@lists.infradead.org Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> 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>
-
由 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>
-
由 Arvind Yadav 提交于
- clk_prepare_enable() can fail here and we must check its return value. - oxnas_nand_probe() can fail here and we must disable clock. Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: NNeil Armstrong <narmstrong@baylibre.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>
-
由 Arnd Bergmann 提交于
orion_nand_read_buf uses an inline assembly with the "ldrd" instruction, which is only available from ARMv5 upwards. This used to be fine, since all users have an ARMv5 or ARMv7 CPU, but now we can also build a multiplatform kernel with ARMv4 support enabled in addition to the "kirkwood" (mvebu) platform. This provides an alternative to call the readsl() function that is supposed to have the same effect and is also optimized for performance. I first posted a version of this patch back in 2014, and there was some discussion about it then. This fixes the bugs identified back then and should be a reasonable alternative for the rare corner case. Link: https://patchwork.kernel.org/patch/4144791/ Cc: Jingoo Han <jg1.han@samsung.com> Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Gregory CLEMENT 提交于
The controller supported by the pxa3xx_nand driver is also available on the mvebu 64-bit SoCs, such as the Armada 7K and Armada 8K SoCs. This patch updates the Kconfig dependency to allow building the kernel for this SoC family too. Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Abhishek Sahu 提交于
The NAND controller can support multiple NAND devices having different page sizes. Future code will require us to allocate memory based on the maximum number of codewords among all the devices. We reorganize the NAND device probing such that the ONFI parameters are first read for each connected device to identify the maximum number of codewords possible, and only then proceed with MTD device registration (i.e, call nand_scan_tail and mtd_device_register). This is a reorganization of the existing code and will not change any functionality. Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-