- 30 3月, 2020 2 次提交
-
-
由 Miquel Raynal 提交于
Use Joe Perches cvt_fallthrough.pl script to convert /* fallthrough */ comments (and its derivatives) into a fallthrough; statement. This automatically drops useless ones. Do it MTD-wide. Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Acked-by: NVignesh Raghavendra <vigneshr@ti.com> Acked-by: NTudor Ambarus <tudor.ambarus@microchip.com> Acked-by: NRichard Weinberger <richard@nod.at> Link: https://lore.kernel.org/linux-mtd/20200325212115.14170-1-miquel.raynal@bootlin.com
-
由 Miquel Raynal 提交于
Raw NAND core changes: * Add support for manufacturer specific suspend/resume operation * Add support for manufacturer specific lock/unlock operation * Replace zero-length array with flexible-array member * Fix a typo ("manufecturer") * Ensure nand_soft_waitrdy wait period is enough Raw NAND controller driver changes: * Brcmnand: Add support for flash-edu for dma transfers (+ bindings) * Cadence: Reinit completion before executing a new command Change bad block marker size Fix the calculation of the avaialble OOB size Get meta data size from registers * Qualcom: Use dma_request_chan() instead dma_request_slave_channel() Release resources on failure within qcom_nandc_alloc() * Allwinner: Use dma_request_chan() instead dma_request_slave_channel() * Marvell: Use dma_request_chan() instead dma_request_slave_channel() Release DMA channel on error * Freescale: Use dma_request_chan() instead dma_request_slave_channel() * Macronix: Add support for Macronix NAND randomizer (+ bindings) * Ams-delta: Rename structures and functions to gpio_nand* Make the driver custom I/O ready Drop useless local variable Support custom driver initialisation Add module device tables Handle more GPIO pins as optional Make read pulses optional Don't hardcode read/write pulse widths Push inversion handling to gpiolib Enable OF partition info support Drop board specific partition info Use struct gpio_nand_platdata Write protect device during probe * Ingenic: Use devm_platform_ioremap_resource() Add dependency on MIPS || COMPILE_TEST * Denali: Deassert write protect pin * ST: Use dma_request_chan() instead dma_request_slave_channel() Raw NAND chip driver changes: * Toshiba: Support reading the number of bitflips for BENAND (Built-in ECC NAND) * Macronix: Add support for deep power down mode Add support for block protection SPI-NAND core changes: * Do not erase the block before writing a bad block marker * Explicitly use MTD_OPS_RAW to write the bad block marker to OOB * Stop using spinand->oobbuf for buffering bad block markers * Rework detect procedure for different READ_ID operation SPI-NAND driver changes: * Toshiba: Support for new Kioxia Serial NAND Rename function name to change suffix and prefix (8Gbit) Add comment about Kioxia ID * Micron: Add new Micron SPI NAND devices with multiple dies Add M70A series Micron SPI NAND devices identify SPI NAND device with Continuous Read mode Add new Micron SPI NAND devices Describe the SPI NAND device MT29F2G01ABAGD Generalize the OOB layout structure and function names
-
- 26 3月, 2020 4 次提交
-
-
由 Yoshio Furuyama 提交于
Add support vendor specific commands for KIOXIA CORPORATION BENAND. The actual bitflips number can be retrieved by this command. Signed-off-by: NYoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1585124572-4693-1-git-send-email-ytc-mb-yfuruyama7@kioxia.com
-
由 Miquel Raynal 提交于
SPI NOR core changes: - move all the manufacturer specific quirks/code out of the core, to make the core logic more readable and thus ease maintenance. - move the SFDP logic out of the core, it provides a better separation between the SFDP parsing and core logic. - trim what is exposed in spi-nor.h. The SPI NOR controllers drivers must not be able to use structures that are meant just for the SPI NOR core. - use the spi-mem direct mapping API to let advanced controllers optimize the read/write operations when they support direct mapping. - add generic formula for the Status Register block protection handling. It fixes some long standing locking limitations and eases the addition of the 4bit block protection support. - add block protection support for flashes with 4 block protection bits in the Status Register. SPI NOR controller drivers changes: - the mtk-quadspi driver is replaced by the new spi-mem spi-mtk-nor driver. Merge tag 'mtk-mtd-spi-move' into spi-nor/next to avoid conflicts.
-
由 Miquel Raynal 提交于
HyperBus changes * Print err msg when compatible is wrong or missing * Move mapping of direct access window from core to individual drivers
-
由 Tudor Ambarus 提交于
The #mtd channel (on OFTC servers) is being used to discuss MTD related topics. Add it for better visibility to the HYPERBUS, NAND and SPI NOR entries. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Acked-by: NMiquel Raynal <miquel.raynal@bootlin.com> Acked-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 25 3月, 2020 7 次提交
-
-
由 Xiaoming Ni 提交于
The following sequence is problematic: mtdblock_flush() -->write_cached_data() --->erase_write() mtdblock: erase of region [0x40000, 0x20000] on "xxx" failed Problem is: mtdblock_flush() always returns 0. Indeed, even if write_cached_data() fails and data is not written to the device, syscall_write() still returns success. Avoid this situation by actually returning the error coming out of write_cached_data(). Signed-off-by: NXiaoming Ni <nixiaoming@huawei.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1584674111-101462-1-git-send-email-nixiaoming@huawei.com
-
由 Gustavo A. R. Silva 提交于
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200319224200.GA25162@embeddedor.com
-
由 Wen Yang 提交于
The variable 'name' is released multiple times in the error path, which may cause double free issues. This problem is avoided by adding a goto label to release the memory uniformly. And this change also makes the code a bit more cleaner. Fixes: 4f678a58 ("mtd: fix memory leaks in phram_setup") Signed-off-by: NWen Yang <wenyang@linux.alibaba.com> Cc: Joern Engel <joern@lazybastard.org> Cc: Miquel Raynal <miquel.raynal@bootlin.com> Cc: Richard Weinberger <richard@nod.at> Cc: Vignesh Raghavendra <vigneshr@ti.com> Cc: linux-mtd@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200318153156.25612-1-wenyang@linux.alibaba.com
-
由 Yoshio Furuyama 提交于
Add support for new Kioxia products. The new Kioxia products support program load x4 command, and have HOLD_D bit which is equivalent to QE bit. Signed-off-by: NYoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/aa69e455beedc5ce0d7141359b9364ed8aec9e65.1584949601.git.ytc-mb-yfuruyama7@kioxia.com
-
由 Yoshio Furuyama 提交于
The suffix was changed from "G" to "J" to classify between 1st generation and 2nd generation serial NAND devices (which now belong to the Kioxia brand). As reference that's 1st generation device of 1Gbit product is "TC58CVG0S3HRAIG" 2nd generation device of 1Gbit product is "TC58CVG0S3HRAIJ". The 8Gbit type "TH58CxG3S0HRAIJ" is new to Kioxia's serial NAND lineup and the prefix was changed from "TC58" to "TH58". Thus the functions were renamed from tc58cxgxsx_*() to tx58cxgxsxraix_*(). Signed-off-by: NYoshio Furuyama <ytc-mb-yfuruyama7@kioxia.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/0dedd9869569a17625822dba87878254d253ba0e.1584949601.git.ytc-mb-yfuruyama7@kioxia.com
-
由 Mason Yang 提交于
Macronix AD series support deep power down mode for a minimum power consumption state. Overload nand_suspend() & nand_resume() in Macronix specific code to support deep power down mode. Signed-off-by: NMason Yang <masonccyang@mxic.com.tw> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Mason Yang 提交于
Patch nand_suspend() & nand_resume() to let manufacturers overwrite suspend/resume operations. Signed-off-by: NMason Yang <masonccyang@mxic.com.tw> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1584517348-14486-2-git-send-email-masonccyang@mxic.com.tw
-
- 24 3月, 2020 7 次提交
-
-
由 Jungseung Lee 提交于
n25q512ax3 and n25q512a use the 4 bit Block Protection scheme. Enable locking for both. Tested on n25q512ax3. The other is modified following the datasheet. Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jungseung Lee 提交于
Currently we are supporting block protection only for flash chips with 3 block protection bits (BP0-2) in the SR register. Enable block protection support for flashes with 4 block protection bits (BP0-3). Add a flash_info flag for flashes that describe 4 block protection bits. Add another flash_info flag for flashes in which BP3 bit is not adjacent to the BP0-2 bits. Tested with a n25q512ax3 (BP0-3) and w25q128 (BP0-2). Signed-off-by: NJungseung Lee <js07.lee@samsung.com> Reviewed-by: NMichael Walle <michael@walle.cc> Tested-by: NMichael Walle <michael@walle.cc> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Jungseung Lee 提交于
The current mainline locking was restricted and could only be applied to flashes that have 3 block protection bits and fixed locking ratio. A new method of normalization was reached at the end of the discussion [1]. (1) - if bp slot is insufficient. (2) - if bp slot is sufficient. if (bp_slots_needed > bp_slots) // (1) min_prot_length = sector_size << (bp_slots_needed - bp_slots); else // (2) min_prot_length = sector_size; This patch changes logic to handle block protection based on min_prot_length. It is suitable for the overall flashes with exception of some corner cases (see EON and catalyst) and easy to extend and apply for the case of 2bit or 4bit block protection. [1] http://lists.infradead.org/pipermail/linux-mtd/2020-February/093934.htmlSigned-off-by: NJungseung Lee <js07.lee@samsung.com> Reviewed-by: NMichael Walle <michael@walle.cc> Tested-by: NMichael Walle <michael@walle.cc> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Tudor Ambarus 提交于
When there are more BP settings than needed for defining the protected areas of the flash memory, most flashes will define the remaining settings as "protect all", i.e. the equivalent of having all the BP bits set to one. But there are flashes where the in-between BP values are undefined (not mentioned), and only the "all bits set" is protecting the entire memory. One such example is w25q80, where BP[2:0]=0b101 and 0b110 are not defined. Set all the BP bits to one when lock_len == mtd->size, to treat this special case. Suggested-by: NMichael Walle <michael@walle.cc> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NJungseung Lee <js07.lee@samsung.com> Reviewed-by: NMichael Walle <michael@walle.cc>
-
由 Gustavo A. R. Silva 提交于
The current codebase makes use of the zero-length array language extension to the C90 standard, but the preferred mechanism to declare variable-length types such as these ones is a flexible array member[1][2], introduced in C99: struct foo { int stuff; struct boo array[]; }; By making use of the mechanism above, we will get a compiler warning in case the flexible array does not occur last in the structure, which will help us prevent some kind of undefined behavior bugs from being inadvertently introduced[3] to the codebase from now on. Also, notice that, dynamic memory allocations won't be affected by this change: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero."[1] This issue was found with the help of Coccinelle. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://github.com/KSPP/linux/issues/21 [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour") Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Tudor Ambarus 提交于
When an Erase or Program error occurs on a spansion/cypress or a micron flash, the WEL bit remains set to one and should be cleared with a WRDI command in order to protect against inadvertent writes that can possible corrupt the contents of the memory. Winbond, macronix, gd, etc., do not support the E_ERR and P_ERR bits in the Status Register and always clear the WEL bit regardless of the outcome of the erase or page program operation (ex w25q40bw, MX25L25635E). Issue a WRDI command when erase or page program errors occur. Reported-by: NJohn Garry <john.garry@huawei.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Tested-by: NJohn Garry <john.garry@huawei.com>
-
由 Lukas Bulwahn 提交于
Commit a0900d01 ("mtd: spi-nor: Prepare core / manufacturer code split") moved all SPI NOR controller drivers to a controllers/ sub-directory. However, the moved nxp-spifi.c file was referenced in the ARM/LPC18XX ARCHITECTURE entry in MAINTAINERS. Hence, since then, ./scripts/get_maintainer.pl --self-test complains: warning: no file matches F: drivers/mtd/spi-nor/nxp-spifi.c Update the file entry in MAINTAINERS to its new location. Signed-off-by: NLukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
- 17 3月, 2020 20 次提交
-
-
由 Tudor Ambarus 提交于
The SPI NOR controllers drivers must not be able to use structures that are meant just for the SPI NOR core. struct spi_nor_flash_parameter is filled at run-time with info gathered from flash_info, manufacturer and sfdp data. struct spi_nor_flash_parameter should be opaque to the SPI NOR controller drivers, make sure it is. spi_nor_option_flags, spi_nor_read_command, spi_nor_pp_command, spi_nor_read_command_index and spi_nor_pp_command_index are defined for the core use, make sure they are opaque to the SPI NOR controller drivers. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Tudor Ambarus 提交于
Cross manufacturer code is unlikely and discouraged, get rid of the MFR definitions. Suggested-by: NVignesh Raghavendra <vigneshr@ti.com> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
-
由 Boris Brezillon 提交于
All entries have been moved to manufacturer drivers. Get rid of this empty table. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for XMC chips, and move the XMC definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Xilinx chips, and move the Xilinx definitions outside of core.c. While at it, remove the SPI_S3AN flag which is now useless. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Catalyst chips, and move the Catalyst definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Winbond chips, and move the Winbond definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for SST chips, and move the SST definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Spansion chips, and move the Spansion definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Micron/ST chips, and move the Micron/ST definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Macronix chips, and move the Macronix definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Tested-by: NXiang Chen <chenxiang66@hisilicon.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for ISSI chips, and move the ISSI definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Intel chips, and move the Intel definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for GigaDevice chips, and move the GigaDevice definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Fujitsu chips, and move the Fujitsu definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Everspin chips, and move the Everspin definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for ESMT chips, and move the ESMT definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Eon chips, and move the Eon definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Create a SPI NOR manufacturer driver for Atmel chips, and move the Atmel definitions outside of core.c. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com>
-
由 Boris Brezillon 提交于
Declare a spi_nor_manufacturer struct and add basic building blocks to move manufacturer specific code outside of the core. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NVignesh Raghavendra <vigneshr@ti.com>
-