summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'for-linus-20141215' of git://git.infradead.org/linux-mtdLinus Torvalds2014-12-1732-448/+2292
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull MTD updates from Brian Norris: "Summary: - Add device tree support for DoC3 - SPI NOR: Refactoring, for better layering between spi-nor.c and its driver users (e.g., m25p80.c) New flash device support Support 6-byte ID strings - NAND: New NAND driver for Allwinner SoC's (sunxi) GPMI NAND: add support for raw (no ECC) access, for testing purposes Add ATO manufacturer ID A few odd driver fixes - MTD tests: Allow testers to compensate for OOB bitflips in oobtest Fix a torturetest regression - nandsim: Support longer ID byte strings And more" * tag 'for-linus-20141215' of git://git.infradead.org/linux-mtd: (63 commits) mtd: tests: abort torturetest on erase errors mtd: physmap_of: fix potential NULL dereference mtd: spi-nor: allow NULL as chip name and try to auto detect it mtd: nand: gpmi: add raw oob access functions mtd: nand: gpmi: add proper raw access support mtd: nand: gpmi: add gpmi_copy_bits function mtd: spi-nor: factor out write_enable() for erase commands mtd: spi-nor: add support for s25fl128s mtd: spi-nor: remove the jedec_id/ext_id mtd: spi-nor: add id/id_len for flash_info{} mtd: nand: correct the comment of function nand_block_isreserved() jffs2: Drop bogus if in comment mtd: atmel_nand: replace memcpy32_toio/memcpy32_fromio with memcpy mtd: cafe_nand: drop duplicate .write_page implementation mtd: m25p80: Add support for serial flash Spansion S25FL132K MTD: m25p80: fix inconsistency in m25p_ids compared to spi_nor_ids mtd: spi-nor: improve wait-till-ready timeout loop mtd: delete unnecessary checks before two function calls mtd: nand: omap: Fix NAND enumeration on 3430 LDP mtd: nand: add ATO manufacturer info ...
| * mtd: tests: abort torturetest on erase errorsBrian Norris2014-12-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The torture test should quit once it actually induces an error in the flash. This step was accidentally removed during refactoring. Without this fix, the torturetest just continues infinitely, or until the maximum cycle count is reached. e.g.: ... [ 7619.218171] mtd_test: error -5 while erasing EB 100 [ 7619.297981] mtd_test: error -5 while erasing EB 100 [ 7619.377953] mtd_test: error -5 while erasing EB 100 [ 7619.457998] mtd_test: error -5 while erasing EB 100 [ 7619.537990] mtd_test: error -5 while erasing EB 100 ... Fixes: 6cf78358c94f ("mtd: mtd_torturetest: use mtd_test helpers") Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Akinobu Mita <akinobu.mita@gmail.com> Cc: <stable@vger.kernel.org>
| * mtd: physmap_of: fix potential NULL dereferenceArd Biesheuvel2014-12-121-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On device remove, when testing the cmtd field of an of_flash struct to decide whether it is a concatenated device or not, we get a false positive on cmtd == NULL, and dereference it subsequently. This may occur if of_flash_remove() is called from the cleanup path of of_flash_probe(). Instead, test for NULL first, and only then perform the test for a concatenated device. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: allow NULL as chip name and try to auto detect itRafał Miłecki2014-12-011-3/+11
| | | | | | | | | | | | | | This will allow spi-nor users to plainly use JEDEC to detect flash chip. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: gpmi: add raw oob access functionsBoris BREZILLON2014-12-011-0/+18
| | | | | | | | | | | | | | | | | | Implement raw OOB access functions to retrieve OOB bytes when accessing the NAND in raw mode. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: gpmi: add proper raw access supportBoris BREZILLON2014-12-012-0/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several MTD users (either in user or kernel space) expect a valid raw access support to NAND chip devices. This is particularly true for testing tools which are often touching the data stored in a NAND chip in raw mode to artificially generate errors. The GPMI drivers do not implemenent raw access functions, and thus rely on default HW_ECC scheme implementation. The default implementation consider the data and OOB area as properly separated in their respective NAND section, which is not true for the GPMI controller. In this driver/controller some OOB data are stored at the beginning of the NAND data area (these data are called metadata in the driver), then ECC bytes are interleaved with data chunk (which is similar to the HW_ECC_SYNDROME scheme), and eventually the remaining bytes are used as OOB data. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: gpmi: add gpmi_copy_bits functionBoris BREZILLON2014-12-012-0/+157
| | | | | | | | | | | | | | | | | | | | | | | | Add a new function to copy bits (not bytes) from a memory region to another one. This function is similar to memcpy except it acts at bit level. It is needed to implement GPMI raw access functions and adapt to the hardware ECC engine which does not pad ECC bits to the next byte boundary. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: factor out write_enable() for erase commandsBrian Norris2014-12-013-14/+6
| | | | | | | | | | | | | | | | | | | | | | write_enable() was being duplicated to both m25p80.c and fsl-quadspi.c. But this should be handled within the spi-nor abstraction layer. At the same time, let's add write_disable() after erasing, so we don't leave the flash in a write-enabled state afterward. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <shijie.huang@intel.com>
| * mtd: spi-nor: add support for s25fl128sHuang Shijie2014-12-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | We need to store the six bytes ID for s25fl128s, since it shares the same five bytes with s25fl129p1. This patch adds a macro INFO6 which is used for the six bytes ID flash, and adds a new item for the s25fl128s. Signed-off-by: Huang Shijie <shijie.huang@intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: remove the jedec_id/ext_idHuang Shijie2014-12-011-53/+45
| | | | | | | | | | | | | | | | | | The "id" array contains all the information about the JEDEC and the manufacturer ID info. This patch removes the jedec_id/ext_id from flash_info. Signed-off-by: Huang Shijie <shijie.huang@intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: add id/id_len for flash_info{}Huang Shijie2014-12-011-14/+25
| | | | | | | | | | | | | | | | | | | | This patch adds the id/id_len fields for flash_info{}, and rewrite the INFO to fill them. And at last, we read out 6 bytes in the spi_nor_read_id(), and we use these new fields to parse out the correct flash_info. Signed-off-by: Huang Shijie <shijie.huang@intel.com> Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: correct the comment of function nand_block_isreserved()Gu Zheng2014-11-281-2/+2
| | | | | | | | | | Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: atmel_nand: replace memcpy32_toio/memcpy32_fromio with memcpyWu, Josh2014-11-251-29/+10
| | | | | | | | | | | | | | | | | | | | | | | | There is no need to use memcpy32_toio/memcpy32_fromio to transfer data between memory and NFC sram. As the NFC sram is a also a memory space not an I/O space, we can just use memcpy(). We remove the __iomem prefix for NFC sram to avoid sparse warnings. Signed-off-by: Josh Wu <josh.wu@atmel.com> Reviewed-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: cafe_nand: drop duplicate .write_page implementationBrian Norris2014-11-251-45/+0
| | | | | | | | | | | | | | | | This write_page() function is functionally equivalent to the default in nand_base.c. Its only difference is in subpage programming support, which cafe_nand.c does not advertise, so the difference is negligible. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: m25p80: Add support for serial flash Spansion S25FL132KKnut Wohlrab2014-11-252-3/+2
| | | | | | | | | | | | | | Signed-off-by: Knut Wohlrab <knut.wohlrab@de.bosch.com> Signed-off-by: Alison Chaiken <alison_chaiken@mentor.com> Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * MTD: m25p80: fix inconsistency in m25p_ids compared to spi_nor_idsAlison Chaiken2014-11-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | As stated in a5b7616c5, "mtd: m25p80,spi-nor: Fix module aliases for m25p80", m25p_ids[] in m25p80.c needs to be kept in sync with spi_nor_ids[] in spi-nor.c. The change here corrects a misalignment. (We were missing m25px80 and we had a duplicate w25q128.) Signed-off-by: Alison Chaiken <alison_chaiken@mentor.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: <stable@vger.kernel.org> # 3.18+
| * mtd: spi-nor: improve wait-till-ready timeout loopBrian Norris2014-11-251-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are a few small issues with the timeout loop in spi_nor_wait_till_ready(): * The first operation should not be a reschedule; we should check the status register at least once to see if we're complete! * We should check the status register one last time after declaring the deadline has passed, to prevent a premature timeout error (this is theoretically possible if we sleep for a long time after the previous status register check). * Add an error message, so it's obvious if we ever hit a timeout. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Huang Shijie <shijie.huang@intel.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
| * mtd: delete unnecessary checks before two function callsMarkus Elfring2014-11-252-4/+2
| | | | | | | | | | | | | | | | | | | | The functions kfree() and pci_dev_put() test whether their argument is NULL and then return immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: omap: Fix NAND enumeration on 3430 LDPRoger Quadros2014-11-251-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3430LDP has NAND flash with 32 bytes OOB size which is sufficient to hold BCH8 codes but the small page check introduced in commit b491da7233d5 ("mtd: nand: omap: clean-up ecc layout for BCH ecc schemes") considers anything below 64 bytes unsuitable for BCH4/8/16. There is another bug in that code where it doesn't skip the check for OMAP_ECC_HAM1_CODE_SW. Get rid of that small page check code as it is insufficient and redundant because we are checking for OOB available bytes vs ecc layout before calling nand_scan_tail(). Fixes: b491da7233d5 ("mtd: nand: omap: clean-up ecc layout for BCH ecc schemes") Reported-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: add ATO manufacturer infoBrian Norris2014-11-251-0/+1
| | | | | | | | | | | | Tested with ATO AFND1G08U3, 128MiB NAND. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: print erase size on initRafał Miłecki2014-11-251-2/+2
| | | | | | | | | | | | | | It may be useful info, e.g. if someone wants to use ubinize. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: oobtest: correct printf() format specifier for 'size_t'Brian Norris2014-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes warning: drivers/mtd/tests/oobtest.c: In function 'memcmpshow': drivers/mtd/tests/oobtest.c:129: warning: format '%x' expects type 'unsigned int', but argument 3 has type 'size_t' Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Roger Quadros <rogerq@ti.com> Cc: Sekhar Nori <nsekhar@ti.com>
| * mtd: mtd_oobtest: add bitflip_limit parameterRoger Quadros2014-11-191-18/+47
| | | | | | | | | | | | | | | | | | | | | | It is common for NAND devices to have bitflip errors. Add a bitflip_limit parameter to specify how many bitflips per page we can tolerate without flagging an error. By default zero bitflips are tolerated. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: mtd_oobtest: Show the verification error location and dataRoger Quadros2014-11-191-7/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a function memcmpshow() that compares the 2 data buffers and shows the address:offset and data bytes on comparison failure. This function does not break at a comparison failure but runs the check for the whole data buffer. Use memcmpshow() instead of memcmp() for all the verification paths. Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * fsl_ifc: Support all 8 IFC chip selectsAaron Sierra2014-11-051-6/+4
| | | | | | | | | | | | | | | | | | Freescale's QorIQ T Series processors support 8 IFC chip selects within a memory map backward compatible with previous P Series processors which supported only 4 chip selects. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: atmel_nand: make PMECC lookup table and offset property optionalJosh Wu2014-11-052-4/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is no PMECC lookup table stored in ROM, or lookup table offset is not specified, PMECC driver should build it in DDR by itself. That make the PMECC driver work for some board which doesn't have PMECC lookup table in ROM. The PMECC use the BCH algorithm, so based on the build_gf_tables() function in lib/bch.c, we can build the Galois Field lookup table. For more information can refer to section 5.4 of PMECC controller application note: http://www.atmel.com/images/doc11127.pdf Signed-off-by: Josh Wu <josh.wu@atmel.com> Cc: devicetree@vger.kernel.org Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: mxc_nand: use __iowrite32_copy for 32 bit copyKoul, Vinod2014-11-051-7/+3
| | | | | | | | | | | | | | | | The driver was also using own method to do 32bit copy, turns out we have a kernel API so use that instead Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: intflmount: fix off by one error in INFTL_dumpVUchains()Dan Carpenter2014-11-051-1/+1
| | | | | | | | | | | | | | | | | | The ->PUtable[] array has "->nb_blocks" number of elemetns so this comparison should be ">=" instead of ">". Otherwise it could result in a minor read beyond the end of an array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: Add support for SST spi flashHarini Katakam2014-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | Add sst25wf080 to the spi-nor device id table. Signed-off-by: Harini Katakam <harinik@xilinx.com> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: Add support for Fujitsu MB85RS1MT FRAMRostislav Lisovy2014-11-051-0/+3
| | | | | | | | | | | | | | | | Tested with this particular FRAM chip Signed-off-by: Rostislav Lisovy <lisovy@merica.cz> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: omap: Synchronize the access to the ECC engineRostislav Lisovy2014-11-051-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AM335x Technical Reference Manual (spruh73j.pdf) says "Because the ECC engine includes only one accumulation context, it can be allocated to only one chip-select at a time ... " (7.1.3.3.12.3). Since the commit 97a288ba2cfa ("ARM: omap2+: gpmc-nand: Use dynamic platform_device_alloc()") gpmc-nand driver supports multiple NAND flash devices connected to the single controller. Use global 'struct nand_hw_control' among multiple NAND instances to synchronize the access to the single ECC Engine. Tested with custom AM335x board using 2x NAND flash chips. Signed-off-by: Rostislav Lisovy <lisovy@merica.cz> Acked-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: Move n25q032 entry to Micron devices listChunhe Lan2014-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Because n25q032 is the Micron SPI chip, move it to Micron devices list group. In order that know which Micron SPI chips have been support at a glance. Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Marek Vasut <marex@denx.de> Cc: Huang Shijie <shijie8@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: dataflash: Remove use of tx_dmaMark Brown2014-11-051-3/+3
| | | | | | | | | | | | | | | | | | | | We are trying to remove the legacy tx_dma and rx_dma fields from the spi_transfer structure. Currently dataflash uses tx_dma but only to make sure that it's set to 0 so we can remove this use by replacing with a zero initialisation of the entire spi_transfer struct. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: drop replaceable wait-till-ready function pointerBrian Norris2014-11-051-18/+10
| | | | | | | | | | | | | | | | | | We don't need to expose a 'wait-till-ready' interface to drivers. Status register polling should be handled by the core spi-nor.c library, and as of now, I see no need to provide a special driver-specific hook for it. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de>
| * mtd: fsl-quadspi: drop wait-till-ready checksBrian Norris2014-11-051-11/+0
| | | | | | | | | | | | | | | | spi-nor.c should be taking care of these now. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Huang Shijie <b32955@freescale.com> Reviewed-by: Marek Vasut <marex@denx.de>
| * mtd: m25p80: drop wait-till-ready checksBrian Norris2014-11-051-11/+0
| | | | | | | | | | | | | | spi-nor.c should be taking care of these now. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de>
| * mtd: spi-nor: move "wait-till-ready" checks into erase/write functionsBrian Norris2014-11-051-27/+9
| | | | | | | | | | | | | | | | We shouldn't have *every* function checking if a previous write is complete; this should be done synchronously after each write/erase. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de>
| * mtd: spi-nor: handle timeout errors in spi_nor_write()Brian Norris2014-11-051-2/+5
| | | | | | | | | | | | | | | | | | The error label was unused here. It looks like we're missing at least one case that should be doing 'goto write_err'. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Huang Shijie <shijie8@gmail.com>
| * mtd: spi-nor: eliminate duplicate spi_nor_wait_till_{, fsr}_ready() codeBrian Norris2014-11-051-32/+34
| | | | | | | | | | | | | | | | | | | | | | | | These functions were near-carbon-copies due to a small per-flash quirk. Let's add a new spi_nor::flags bitfield to support these types of quirks. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Cc: Graham Moore <grmoore@altera.com> Cc: Huang Shijie <shijie8@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: update help of CONFIG_MTD_OF_PARTSMichal Sojka2014-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The help text of CONFIG_MTD_OF_PARTS refers to additional documentation in booting-without-of.txt but this documentation was moved to another file in commit efcc2da3fd148c9acb7d7cf1d9800e0649f950fc (Stefan Roese: Factor MTD physmap bindings out of booting-without-of). This updates the help text to point to the right place. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz> [Brian: fixed doc reference] Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: comment update, the DEPLETE1 command has goneGerhard Sittig2014-11-051-1/+1
| | | | | | | | | | | | | | | | | | update a comment in nand_command_lp() about specific requirements of individual commands, the DEPLETE1 command was removed in the past and the comment no longer applied Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: spi-nor: fix the wrong dummy valueHuang Shijie2014-11-052-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | For the DDR Quad read, the dummy cycles maybe 3 or 6 which is less then 8. The dummy cycles is actually 8 for SPI fast/dual/quad read. This patch makes preparations for the DDR quad read, it fixes the wrong dummy value for both the spi-nor.c and m25p80.c. Signed-off-by: Huang Shijie <b32955@freescale.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: Base BCH ECC bytes on required strengthJordan Friendshuh2014-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | NAND devices with page sizes over 4 KiB require more than 4-bits of ECC coverage. This patch calculates the value of ecc_bytes based on a still assumed 512-byte step size (13-bits) and the ecc_strength. Example: Micron M73A devices (8 KiB page) require 8-bit ECC per 512-byte Signed-off-by: Jordan Friendshuh <jfriendshuh@xes-inc.com> Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: gpio: improve comments about GPIO assisted operationGerhard Sittig2014-11-042-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The drivers/mtd/nand/gpio.c driver does not GPIO bitbang the complete NAND protocol, but instead is GPIO _assisted_ -- a memory mapped interface communicates commands and data, and only few control signals are connected to GPIO pins. Expand comments in the driver source and in the Kconfig description to better reflect the very nature of the driver. The previous text could be mistaken for complete GPIO bitbanging. Signed-off-by: Gerhard Sittig <gsi@denx.de> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * MTD: merge 3.18 development into -next developmentBrian Norris2014-10-292-1/+3
| |\ | | | | | | | | | To keep the two paths in sync
| * | mtd: nand: add sunxi NAND flash controller supportBoris BREZILLON2014-10-293-0/+1439
| | | | | | | | | | | | | | | | | | | | | | | | Add support for the sunxi NAND Flash Controller (NFC). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> [Brian: tweaked to fix ecc->steps issue] Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | nandsim: add id_bytes module parameterAkinobu Mita2014-10-231-18/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nandsim can simulate NAND Flash which returns the ID bytes specified by first_id_byte, ..., fourth_id_byte module parameters. In order to simulate NAND flash which returns more than four ID bytes, this adds id_bytes module parameter which is specified by the array of byte like this: # modprobe nandsim id_bytes=0x98,0xdc,0x90,0x26,0x76,0x15,0x01,0x08 bch=1 This doesn't add fifth_id_byte, ..., seventh_id_byte module parameters, because they are redundant. But the existing first_id_byte, ..., fourth_id_byte module parameters are preserved and add "(obsolete)" to the description. Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: linux-mtd@lists.infradead.org Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | mtd: docg3: fix 'defined but not used' warningBrian Norris2014-10-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With CONFIG_OF=n, we can see the following warning: drivers/mtd/devices/docg3.c:2122:28: warning: 'docg3_dt_ids' defined but not used [-Wunused-variable] static struct of_device_id docg3_dt_ids[] = { Signed-off-by: Brian Norris <computersforpeace@gmail.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
| * | mtd: bcm47xxpart: only register partitions if the trx header was filledHauke Mehrtens2014-10-221-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes the trx offsets are 0, in that case there is no partition and we should not try to add one. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> [Brian: rewrapped] Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | mtd: phram: fix asm/io.h include usageRob Ward2014-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | Modify phram to include <linux/io.h> rather than <asm/io.h> Signed-off-by: Rob Ward <robert.ward114@googlemail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
OpenPOWER on IntegriCloud