summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
...
* | | mtd: introduce function max_bad_blocksJeff Westfahl2017-02-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If implemented, 'max_bad_blocks' returns the maximum number of bad blocks to reserve for a MTD. An implementation for NAND is coming soon. Signed-off-by: Jeff Westfahl <jeff.westfahl@ni.com> Signed-off-by: Zach Brown <zach.brown@ni.com> Acked-by: Boris Brezillon <boris.brezillon@free-electron.com> Acked-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* | | mtd: fix typos in ooblayout comment blocksMasahiro Yamada2017-02-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | - "This functions return ..." -> "This function returns ..." - "I you want ..." -> "If you want ..." Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* | | mtd: pmcmsp: use kstrndup instead of kmalloc+strncpyArnd Bergmann2017-02-081-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kernelci.org reports a warning for this driver, as it copies a local variable into a 'const char *' string: drivers/mtd/maps/pmcmsp-flash.c:149:30: warning: passing argument 1 of 'strncpy' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] Using kstrndup() simplifies the code and avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* | | mtd: physmap_of: add a hook for Gemini flash probingLinus Walleij2017-02-085-7/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support device tree probing of Gemini NOR flash chips, a certain register in the syscon needs to be poked to enable parallel flash mode. Such things used to happen in "necessarily different" board file code, and this indeed was also done for the Gemini, so the MTD driver could treat it as any memory-mapped NOR flash, but this is not the way in the future: board files need to go, and hardware concerns distributed down to the applicable drivers. This adds a hook in the same way that the Versatile did: if the Kconfig symbol is not selected the net total of supporting Gemini should be zero bytes of added code. To live up to this promise, also the return value error print from the Versatile extra probe call get to be removed in this patch, all printing need to happen in the add-ons. Cc: Janos Laube <janos.dev@gmail.com> Cc: Paulius Zaleckas <paulius.zaleckas@gmail.com> Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* | | mtd: update my email addressJohn Crispin2017-02-082-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates my email address as I no longer have access to the old one. Signed-off-by: John Crispin <john@phrozen.org> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* | | mtd: bcm47xxsflash: use platform_(set|get)_drvdataRafał Miłecki2017-02-081-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | We have generic place & helpers for storing platform driver data so there is no reason for using custom priv pointer. This allows cleaning up struct bcma_sflash from unneeded fields. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
* | mtd: nand: lpc32xx: fix invalid error handling of a requested irqVladimir Zapolskiy2017-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver. The change fixes LPC32xx NAND MLC driver initialization on boot. Fixes: 8cb17b5ed017 ("irqchip: Add LPC32xx interrupt controller driver") Cc: stable@kernel.org # v4.7+ Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* | mtd: nand: tango: Reset pbus to raw mode in probeMarc Gonzalez2017-01-031-0/+2
| | | | | | | | | | | | | | | | Linux should not expect the boot loader to properly configure the peripheral bus "pad mode", so reset PBUS_PAD_MODE to raw. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* | mtd: nand: tango: Update DT binding descriptionMarc Gonzalez2017-01-031-1/+1
| | | | | | | | | | | | | | | | Visually separate register ranges (address/size pairs) in reg prop. Change DMA channel name, for consistency with other drivers. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* | mtd: nand: oxnas_nand: fix build errors on arch/um, require HAS_IOMEMRandy Dunlap2017-01-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix build errors on arch/um, which does not support HAS_IOMEM, while the oxnas_nand.c driver uses interfaces that are supplied by HAS_IOMEM. (loadable module build:) ERROR: "devm_ioremap_resource" [drivers/mtd/nand/oxnas_nand.ko] undefined! or (built-in build:) drivers/built-in.o: In function `oxnas_nand_probe': drivers/mtd/nand/oxnas_nand.c:102: undefined reference to `devm_ioremap_resource' Fixes: 668592492409 ("mtd: nand: Add OX820 NAND Support") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <fengguang.wu@intel.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* | mtd: nand: xway: fix build because of module functionsHauke Mehrtens2017-01-021-4/+1
| | | | | | | | | | | | | | | | | | | | Remove the usage of modules functions to make this driver compile again. Otherwise an include of linux/modules.h would be needed. Fixes: 024366750c2e ("mtd: nand: xway: convert to normal platform driver") Cc: <stable@vger.kernel.org> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* | mtd: nand: xway: disable module supportHauke Mehrtens2017-01-021-1/+1
|/ | | | | | | | | | | | The xway_nand driver accesses the ltq_ebu_membase symbol which is not exported. This also should not get exported and we should handle the EBU interface in a better way later. This quick fix just deactivated support for building as module. Fixes: 99f2b107924c ("mtd: lantiq: Add NAND support on Lantiq XWAY SoC.") Cc: <stable@vger.kernel.org> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
* Replace <asm/uaccess.h> with <linux/uaccess.h> globallyLinus Torvalds2016-12-249-9/+9
| | | | | | | | | | | | | This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge tag 'for-linus-20161216' of git://git.infradead.org/linux-mtdLinus Torvalds2016-12-1744-349/+1370
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull MTD updates from Brian Norris: "Nothing enormous here, though notably we have some of the first work of a few new maintainers. I think for now I'll still be sending pull requests, but that's open to change in the future. Summary: Core: - dynamic BDI object allocation (resolves some problems when built as a module) - cleanups in the ooblayout handling NAND: - new tango NAND controller driver - new ox820 NAND controller driver - addition of a new full-ID entry in the nand_ids table - rework of the s3c240 driver to support DT - extension of the nand_sdr_timings to expose tCCS, tPROG and tR - addition of a new flag to ask the core to wait for tCCS when sending a RNDIN/RNDOUT command - addition of a new flag to ask the core to let the controller driver send the READ/PROGPAGE command Minor fixes/cleanup/cosmetic changes: - properly support 512 ECC step size in the sunxi driver - improve the error messages in the PXA probe path - fix module autoload in the omap2 driver - cleanup of several nand drivers to return nand_scan{_tail}() error code instead of returning -EIO - various cleanups in the denali driver - fix an error check in nandsim SPI NOR: - new flash IDs - wait for Spansion flash to be ready after quad-enable - error handling fixes for Candence QSPI - constify some structures in Freescale QSPI driver" * tag 'for-linus-20161216' of git://git.infradead.org/linux-mtd: (71 commits) mtd: Allocate bdi objects dynamically mtd: nand: tango: Add standard legalese header mtd: maps: add missing iounmap() in error path mtd: spi-nor: constify fsl_qspi_devtype_data mtd: spi-nor: Add support for mr25h40 mtd: spi-nor: Add support for N25Q016A mtd: spi-nor: Add at25df321 spi-nor flash support mtd: spi-nor: Fix some error codes in cqspi_setup_flash() mtd: spi-nor: Off by one in cqspi_setup_flash() mtd: spi-nor: add support for s25fl208k mtd: spi-nor: fix flags for s25fl128s mtd: spi-nor: fix spansion quad enable mtd: spi-nor: add Macronix mx25u25635f to list of known devices. mtd: mtdswap: fix spelling mistake "erassure" -> "erasure" mtd: bcm47xxpart: fix parsing first block after aligned TRX mtd: nand: tango: Use nand_to_mtd() instead of directly accessing chip->mtd mtd: remove unneeded initializer in mtd_ooblayout_count_bytes() mtd: use min_t() to refactor mtd_ooblayout_{get, set}_bytes() mtd: remove unneeded initializer in mtd_ooblayout_{get, set}_bytes() mtd: nand: nandsim: fix error check ...
| * mtd: Allocate bdi objects dynamicallySteve Longerbeam2016-12-011-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MTD backing dev info objects mtd_bdi was statically allocated. So when MTD is built as a loadable module, this object fall in the vmalloc address space. The problem with that, is that the BDI APIs use wake_up_bit(), which calls virt_to_page() to retrieve the memory zone of the page containing the wait_queue to wake up, and virt_to_page() is not valid for vmalloc or highmem addresses. Fix this by allocating the BDI objects dynamically with kmalloc. The objects now fall in the logical address space so that BDI APIs will work in all cases (mtd builtin or module). Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Jim Baxter <jim_baxter@mentor.com> Signed-off-by: Sandeep Jain <Sandeep_Jain@mentor.com> Reviewed-by: Richard Weinberger <richard@nod.at> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: nand: tango: Add standard legalese headerMarc Gonzalez2016-12-011-0/+8
| | | | | | | | | | | | | | Provide proper copyright notice and license information. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * mtd: maps: add missing iounmap() in error pathLuis Henriques2016-11-301-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was triggered by the following Coccinelle error: ./drivers/mtd/maps/sc520cdp.c:246:3-9: \ ERROR: missing iounmap; ioremap on line 242 \ and execution via conditional on line 244 Since do_map_probe() is also invoked in this loop, it is also necessary to map_destroy() any initialised struct mtd_info. Signed-off-by: Luis Henriques <henrix@camandro.org> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * Merge tag 'spi-nor/for-4.10' of git://github.com/spi-nor/linuxBrian Norris2016-11-293-7/+21
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Cyrille Pitchen: """ This pull request contains the following notable changes: - add support to new memory parts. - fix of spansion_quad_enable(). - fix of the Candence QSPI driver. - constify some structure instances of the Freescale QSPI driver. """
| | * mtd: spi-nor: constify fsl_qspi_devtype_dataLABBE Corentin2016-11-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | All fsl_qspi_devtype_data structures are never modified. This patch constify them. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Han Xu <han.xu@nxp.com> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: Add support for mr25h40IWAMOTO Masahiko2016-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add Everspin mr25h40 512KB MRAM to the list of supported chips. Signed-off-by: Masahiko Iwamoto <iwamoto@allied-telesis.co.jp> Reviewed-by: Jagan Teki <jagan@openedev.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: Add support for N25Q016AMoritz Fischer2016-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support in the spi-nor driver for the N25Q016A, a 16Mbit SPI NOR flash from Micron. Cc: David Woodhouse <dwmw2@infradead.org> Cc: Brian Norris <computersforpeace@gmail.com> Cc: Jagan Teki <jteki@openedev.com> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-by: Jagan Teki <jteki@openedev.com> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: Add at25df321 spi-nor flash supportJagan Teki2016-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Atmel at25df321 spi-nor flash to the list of spi_nor_ids. Cc: Brian Norris <computersforpeace@gmail.com> Cc: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Jagan Teki <jteki@openedev.com> Acked-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: Fix some error codes in cqspi_setup_flash()Dan Carpenter2016-11-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We return success or possibly uninitialized values on these error paths instead of proper error codes. Fixes: 140623410536 ("mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: Off by one in cqspi_setup_flash()Dan Carpenter2016-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are CQSPI_MAX_CHIPSELECT elements in the ->f_pdata array so the > should be >=. Fixes: 140623410536 ('mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: add support for s25fl208kSean Nyekjaer2016-11-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Reviewed-by: Jagan Teki <jagan@openedev.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: fix flags for s25fl128sHeiner Kallweit2016-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Spansion S25FL128S also supports dual read mode. In addition remove flag SECT_4K. 4K erases are supported, but not uniformly. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Jagan Teki <jteki@openedev.com> Acked-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: fix spansion quad enableJoël Esponde2016-11-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the S25FL127S nor flash part, each writing to the configuration register takes hundreds of ms. During that time, no more accesses to the flash should be done (even reads). This commit adds a wait loop after the register writing until the flash finishes its work. This issue could make rootfs mounting fail when the latter was done too much closely to this quad enable bit setting step. And in this case, a driver as UBIFS may try to recover the filesystem and may broke it completely. Signed-off-by: Joël Esponde <joel.esponde@honeywell.com> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| | * mtd: spi-nor: add Macronix mx25u25635f to list of known devices.Ash Benz2016-11-231-0/+1
| | | | | | | | | | | | | | | Signed-off-by: Ash Benz <ash.benz@bk.ru> Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
| * | Merge tag 'nand/for-4.10' of github.com:linux-nand/linuxBrian Norris2016-11-2937-317/+1292
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Boris Brezillon: """ This pull request contains the following notable changes: - new tango NAND controller driver - new ox820 NAND controller driver - addition of a new full-ID entry in the nand_ids table - rework of the s3c240 driver to support DT - extension of the nand_sdr_timings to expose tCCS, tPROG and tR - addition of a new flag to ask the core to wait for tCCS when sending a RNDIN/RNDOUT command - addition of a new flag to ask the core to let the controller driver send the READ/PROGPAGE command This pull request also contains minor fixes/cleanup/cosmetic changes: - properly support 512 ECC step size in the sunxi driver - improve the error messages in the pxa probe path - fix module autoload in the omap2 driver - cleanup of several nand drivers to return nand_scan{_tail}() error code instead of returning -EIO - various cleanups in the denali driver - cleanups in the ooblayout handling (MTD core) - fix an error check in nandsim """
| | * | mtd: nand: tango: Use nand_to_mtd() instead of directly accessing chip->mtdBoris Brezillon2016-11-211-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nand_to_mtd() helper is here to hide internal mtd_info <-> nand_chip association and ease future refactors. Make use of this helper instead of directly accessing chip->mtd. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
| | * | mtd: remove unneeded initializer in mtd_ooblayout_count_bytes()Masahiro Yamada2016-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to initialize oobregion since it will be filled by the iterator. This function is called with mtd_ooblayout_free or mtd_ooblayout_ecc for the iterator; both of them calls memset() to clear the oobregion. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: use min_t() to refactor mtd_ooblayout_{get, set}_bytes()Masahiro Yamada2016-11-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I hope this will make the code a little more readable. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: remove unneeded initializer in mtd_ooblayout_{get, set}_bytes()Masahiro Yamada2016-11-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to initialize oobregion and section since they will be filled by mtd_ooblayout_find_region(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: nandsim: fix error checkSudip Mukherjee2016-11-191-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | debugfs_create_dir() and debugfs_create_file() returns NULL on error or a pointer on success. They do not return the error value with ERR_PTR. So we should not check the return with IS_ERR_OR_NULL, instead we should just check for NULL. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: tango: Cleanup raw_write and raw_readMarc Gonzalez2016-11-191-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop raw_write return value (no longer used). Drop raw_read return value (for symmetry). Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: tango: Enable custom page accessorsMarc Gonzalez2016-11-191-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable NAND_ECC_CUSTOM_PAGE_ACCESS in the tango NFC driver. Fixup the "raw" page accessors to send the proper NAND commands. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: Support controllers with custom pageMarc Gonzalez2016-11-191-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If your controller already sends the required NAND commands when reading or writing a page, then the framework is not supposed to send READ0 and SEQIN/PAGEPROG respectively. Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove debug lines of __FILE__, __LINE__, __func__Masahiro Yamada2016-11-191-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such debug lines might be useful when debugging the driver first, but should be deleted from the upstream code. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove unneeded parenthesesMasahiro Yamada2016-11-191-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove parentheses surrounding the whole right side of an assignment. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: return error code from nand_scan_ident/tail on errorMasahiro Yamada2016-11-191-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nand_scan_ident/tail() returns an appropriate error value when it fails. Use it instead of the fixed -ENXIO. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: return error code from devm_request_irq() on errorMasahiro Yamada2016-11-191-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devm_request_irq() returns an appropriate error value when it fails. Use it instead of the fixed -ENODEV. While we are here, reword the comment to make it fit in a single line, fixing the misspelling of "initialization". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: use managed devm_irq_request()Masahiro Yamada2016-11-191-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the managed variant instead of request_irq() and free_irq(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove unused struct member totalblks, blksperchipMasahiro Yamada2016-11-192-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The denali->blksperchip is set, but not referenced any more. The denali->totalblks is used only for calculating denali->blksperchip. Both of them are unneeded. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove "Spectra:" prefix from printk stringsMasahiro Yamada2016-11-191-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As far as I understood from the Kconfig menu deleted by commit be7f39c5ecf5 ("Staging: delete spectra driver"), the "Spectra" is specific to Intel Moorestown Platform. The Denali NAND controller IP is used for various SoCs such as Altera SOCFPGA, Socionext UniPhier, etc. The platform specific strings are not preferred in this driver. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove detect_partition_feature()Masahiro Yamada2016-11-192-38/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The denali->fwblks is set by detect_partition_feature(), but it is not referenced from anywhere. That means the struct member fwblks and the whole of detect_partition_feature() are unneeded. The comment block implies this function is only for Intel platforms. I found drivers/staging/spectra used to exist, but it was deleted by commit be7f39c5ecf5 ("Staging: delete spectra driver") 5 years ago. So, I guess nobody would need this function any more. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove bogus comment about interrupt handler setupMasahiro Yamada2016-11-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interrupt handler is setup in denali_init(), not in denali_drv_init(). This comment is false. Such a comment adds no value, so just delete it instead of move. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove unused struct member denali_nand_info::idxMasahiro Yamada2016-11-192-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The struct member "idx" was used as an index for debug_array long ago, but the DEBUG_DENALI feature was removed by commit 7cfffac06ca0 ("nand/denali: use dev_xx debug function to replace nand_dbg_print and some printk"). Since then, this has been only initialized, but never referenced. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: denali: remove unneeded <linux/slab.h> includesMasahiro Yamada2016-11-193-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver calls devm_kzalloc()/devm_kfree() to allocate/free memory. They are declared in <linux/device.h>, not in <linux/slab.h>. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: socrates: use nand_scan() for nand_scan_ident/tail() comboMasahiro Yamada2016-11-071-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For this driver, there is nothing between nand_scan_ident() and nand_scan_tail(). They can be merged into nand_scan(). Also, nand_scan() returns an appropriate error value when it fails. Use it instead of the fixed error code -ENXIO. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
| | * | mtd: nand: nandsim: remove unneeded checks for nand_scan_ident/tail()Masahiro Yamada2016-11-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nand_scan_ident/tail() never returns a positive value when it fails. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>