summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | mtd: fsl-quadspi: allow building for other ARCHes with COMPILE_TESTBrian Norris2015-10-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver doesn't actually need ARCH_MXC to compile. Relax the constraints. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Han xu <han.xu@freescale.com>
| * | | mtd: fsl-quadspi: fix printk() format warning for size_tBrian Norris2015-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seen when compile-testing on non-32-bit arch: CC drivers/mtd/spi-nor/fsl-quadspi.o drivers/mtd/spi-nor/fsl-quadspi.c: In function 'fsl_qspi_read': drivers/mtd/spi-nor/fsl-quadspi.c:873:2: warning: format '%d' expects argument of type 'int', but argument 6 has type 'size_t' [-Wformat=] dev_dbg(q->dev, "cmd [%x],read from 0x%p, len:%d\n", ^ Also drop the '0x' prefixing to the '%p' formatter, since %p already knows how to format pointers appropriately. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Han xu <han.xu@freescale.com>
| * | | mtd: spi-nor: add DUAL_READ for w25q{32,64}dwBrian Norris2015-10-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | These flash support dual and quad read. Tested dual read on the 32 Mbit version. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: disable protection for Winbond flash at startupBrian Norris2015-10-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | In case the flash was locked at boot time. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: support lock/unlock/is_locked for WinbondBrian Norris2015-10-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Many other flash share the same features as ST Micro. I've tested some Winbond flash, so add them. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: add mtd_is_locked() supportBrian Norris2015-10-131-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables ioctl(MEMISLOCKED). Status can now be reported in the mtdinfo or flash_lock utilities found in mtd-utils. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: refactor block protection functionsBrian Norris2015-10-131-45/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was a bit sloppy, would produce a lot of copy-and-paste, and did not always provide a sensible interface: * It didn't validate the length for LOCK and the offset for UNLOCK, so we were essentially discarding half of the user-supplied data and assuming what they wanted to lock/unlock * It didn't do very good error checking * It didn't make use of the fact that this operation works on power-of-two dimensions So, rewrite this to do proper bit arithmetic rather than a bunch of hard-coded condition tables. Now we have: * More comments on how this was derived * Notes on what is (and isn't) supported * A more exendible function, so we could add support for other protection ranges * More accurate locking - e.g., suppose the top quadrant is locked (75% to 100%); then in the following cases, case (a) will succeed but (b) will not (return -EINVAL): (a) user requests lock 3rd quadrant (50% to 75%) (b) user requests lock 3rd quadrant, minus a few blocks (e.g., 50% to 73%) Case (b) *should* fail, since we'd have to lock blocks that weren't requested. But the old implementation didn't know the difference and would lock the entire second half (50% to 100%) This refactoring work will also help enable the addition of mtd_is_locked() support and potentially the support of bottom boot protection (TB=1). Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: use SNOR_MFR_* instead of CFI_MFR_*Brian Norris2015-10-131-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | No functional change, just cosmetic. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: Add support for s25fl004kSean Nyekjaer2015-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: spi-nor: s25fl204k supports dual I/0Sean Nyekjaer2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: pass page number to ecc->write_xxx() methodsBoris BREZILLON2015-10-1318-38/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ->read_xxx() methods are all passed the page number the NAND controller is supposed to read, but ->write_xxx() do not have such a parameter. This is a problem if we want to properly implement data scrambling/randomization in order to mitigate MLC sensibility to repeated pattern: to prevent bitflips in adjacent pages in the same block we need to avoid repeating the same pattern at the same offset in those pages, hence the randomizer/scrambler engine need to be passed the page value in order to adapt its seed accordingly. Moreover, adding the page parameter to the ->write_xxx() methods add some consistency to the current API. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> CC: Josh Wu <josh.wu@atmel.com> CC: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> CC: Maxime Ripard <maxime.ripard@free-electrons.com> CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org> CC: Huang Shijie <shijie.huang@arm.com> CC: Stefan Agner <stefan@agner.ch> CC: devel@driverdev.osuosl.org CC: linux-arm-kernel@lists.infradead.org CC: linux-kernel@vger.kernel.org Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: txx9ndfmc: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: jz4740_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: fsl_upm: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: socrates_nand: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: fsl_elbc_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where mtd parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: pxa3xx_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: gpio: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: onenand: omap2: drop owner and name assignmentFrans Klaver2015-10-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner and name are automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: s3c2410: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: sharpsl: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: omap2: show parent device structure in sysfsFrans Klaver2015-10-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure the device structure is properly shown in sysfs by properly filling in dev.parent. While at it, make use of the default owner and name values set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: onenand: samsung: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: lpc32xx_mlc: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: ndfc: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: pasemi_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: mxc_nand: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: onenand: generic: show parent device in sysfsFrans Klaver2015-10-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where mtd parent device symlinks aren't shown in sysfs. While at it, take advantage of the default owner and name values set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: tmio_nand: show parent device in sysfsFrans Klaver2015-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: sunxi_nand: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: sh_flctl: show parent device in sysfsFrans Klaver2015-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: r852: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: plat_nand: show parent device in sysfsFrans Klaver2015-10-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner and name set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: orion_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: nuc900_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: mpc5121_nfc: show parent device in sysfsFrans Klaver2015-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: hisi504_nand: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: gpmi-nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: fsmc_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: fsl_ifc_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: docg4: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: denali: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: davinci_nand: drop owner and name assignmentFrans Klaver2015-10-131-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner and name are automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: cafe_nand: drop owner assignmentFrans Klaver2015-10-131-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Owner is automatically set by mtdcore. Make use of that. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: bf5xx_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: bcm47xxnflash: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: au1550nd: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: nand: atmel_nand: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: maps: sa1100-flash: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where mtd parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Incidentally, it seems the owner field in the concatenated mtds is not actually used, so this shouldn't make much of a difference anyway. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
| * | | mtd: maps: rbtx4939-flash: show parent device in sysfsFrans Klaver2015-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug where mtd parent device symlinks aren't shown in sysfs. While at it, make use of the default owner value set by mtdcore. Signed-off-by: Frans Klaver <fransklaver@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
OpenPOWER on IntegriCloud