summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* mtd: nand: style fixups in pr_* messagesBrian Norris2011-09-112-48/+42Star
| | | | | | | | This is a cleanup of some punctuation, indentation, and capitalization on the lines affected affected by the last patch. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: nand: convert printk() to pr_*()Brian Norris2011-09-112-39/+39
| | | | | | | | | | | | | Instead of directly calling printk, it's simpler to use the built-in pr_* functions. This shortens code and allows easy customization through the definition of a pr_fmt() macro (not used currently). Ideally, we could implement much of this with dev_* functions, but the MTD subsystem does not necessarily register all its master `mtd_info.dev` device, so we cannot use dev_* consistently. See: http://lists.infradead.org/pipermail/linux-mtd/2011-July/036950.html Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: nand: change KERN_DEBUG to KERN_INFOBrian Norris2011-09-111-7/+7
| | | | | | | | | | | | Soon we will change many printk statements into pr_* statements, i.e., 'printk(KERN_INFO, ...)' becomes 'pr_info(...)'. However, this means that KERN_DEBUG messages will become pr_debug() statements and therefore will not be activated by default - they must be enabled using dynamic debug. So, for important DEBUG messages, we will simply upgrade these to INFO so that they appear by default. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: dataflash: add device tree probe supportShawn Guo2011-09-111-2/+16
| | | | | | | It adds device tree probe support for mtd_dataflash driver. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: pxa3xx_nand: enable multiple chip select supportLei Wen2011-09-111-50/+123
| | | | | | | | | | | | | | | Current pxa3xx_nand controller has two chip select which both be workable. This patch enable this feature. Update platform driver to support this feature. Another notice should be taken that: When you want to use this feature, you should not enable the keep configuration feature, for two chip select could be attached with different nand chip. The different page size and timing requirement make the keep configuration impossible. Signed-off-by: Lei Wen <leiwen@marvell.com>
* mtd: pxa3xx_nand: sperate each chip individual infoLei Wen2011-09-111-132/+160
| | | | | | | For support two chip select, we seperate chip specific info in this patch. Signed-off-by: Lei Wen <leiwen@marvell.com>
* mtd: pxa3xx_nand: convert all printk into dev_*Lei Wen2011-09-111-11/+16
| | | | | | | Also add missed warning message. Signed-off-by: Lei Wen <leiwen@marvell.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
* mtd: pxa3xx_nand: enhance suspend and resume routineLei Wen2011-09-111-1/+14
| | | | | | | | | This patch add protection on the suspend&resume path to prevent some unexpected behavior, like interrupt occur at the very second of resume back and it don't follow normal command path, which lead to bug. Signed-off-by: Lei Wen <leiwen@marvell.com>
* mtd: eLBC NAND: remove elbc_fcm_ctrl->oob_poiMike Hench2011-09-111-31/+2Star
| | | | | | | | | | | The eLBC NAND driver currently follows up each program/write operation with a read-back of the page, in order to [ostensibly] fill in ECC data for the caller. However, the page address used for this read is always -1, so the read will never work correctly. Remove this useless (and potentially problematic) block of code. Signed-off-by: Matthew L. Creech <mlcreech@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: atmel_nand: optimize read/write buffer functionsNicolas Ferre2011-09-111-41/+4Star
| | | | | | | | | | For PIO NAND access functions, we use the features of the SMC: - no need to take into account the NAND bus width: SMC will deal with this - use of an IO memcpy on the NAND chip-select space is able to generate proper SMC behavior. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: nand: don't free the global data too earlyLiu Shuo2011-09-111-1/+0Star
| | | | | | | | | The global data fsl_lbc_ctrl_dev->nand don't have to be freed in fsl_elbc_chip_remove(). The right place to do that is in fsl_elbc_nand_remove() if elbc_fcm_ctrl->counter is zero. Signed-off-by: Liu Shuo <b35362@freescale.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: fsl_upm: fix a memory leak in fun_chip_init error pathAxel Lin2011-09-111-0/+2
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: atmel_nand: fix wrong use of 0 as NULLNicolas Ferre2011-09-111-1/+1
| | | | | | | | | Fixing this error: atmel_nand.c:718:20: warning: Using plain integer as NULL pointer Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: nand_flash_detect_onfi propagate busw infoMatthieu CASTET2011-09-111-4/+4
| | | | | | | | | there is a bug in nand_flash_detect_onfi, busw need to be passed by pointer to return it. Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com> Acked-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: edit NAND-related commentBrian Norris2011-09-111-2/+3
| | | | | | | | | | This comment was unclear regarding which NAND functions do and do not support ECC on the spare area. This update should reflect the current status of the NAND system but can be updated if changes are made in the standard functions. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: tests: ignore corrected bitflips in OOB on mtd_readtestBrian Norris2011-09-111-1/+2
| | | | | | | | read_oob may now return ECC error codes. If the code is -EUCLEAN, then we can safely ignore the error as a corrected bitflip. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: nand: ignore ECC errors for simple BBM scansBrian Norris2011-09-111-3/+10
| | | | | | | | | | | | Now that nand_do_readoob() may return -EUCLEAN or -EBADMSG on ECC errors, we need to handle the return value specially in some cases. When scanning for simple bad block markers, reacting to an ECC error is not very useful, as we assume that the relevant markers are still non-0xFF for true bad blocks. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: ofpart: add ofoldpart aliasDmitry Eremin-Solenikov2011-09-111-0/+6
| | | | | | | | | | ofpart.ko also provides ofoldpart MTD parser. Add respective MODULE_ALIAS("ofoldpart"); declaration. Artem: improve the comment Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: nand: handle ECC errors in OOBBrian Norris2011-09-112-1/+23
| | | | | | | | | | | | | | | | | While the standard NAND OOB functions do not do ECC on the spare area, it is possible for a driver to supply its own OOB ECC functions (e.g., HW ECC). nand_do_read_oob should act like nand_do_read_ops in checking the ECC stats and returning -EBADMSG or -EUCLEAN on uncorrectable errors or correctable bitflips, respectively. These error codes could be used in flash-based BBT code or in YAFFS, for example. Doing this, however, messes with the behavior of mtd_do_readoob. Now, mtd_do_readoob should check whether we had -EUCLEAN or -EBADMSG errors and discard those as "non-fatal" so that the ioctls can still succeed with (possibly uncorrected) data. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: make ofpart buildable as a separate moduleDmitry Eremin-Solenikov2011-09-113-2/+5
| | | | | | | | | | As ofpart now uses a standard mtd partitions parser interface, make it buildable as a separate module. Also provide MODULE_DESCRIPTION and MODULE_AUTHOR for this module. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: spelling, capitalization, uniformityBrian Norris2011-09-1115-97/+93Star
| | | | | | | | | | | | | | | | | | | | Therefor -> Therefore [Intern], [Internal] -> [INTERN] [REPLACABLE] -> [REPLACEABLE] syndrom, syndom -> syndrome ecc -> ECC buswith -> buswidth endianess -> endianness dont -> don't occures -> occurs independend -> independent wihin -> within erease -> erase blockes -> blocks ... Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: drop mtd_device_registerDmitry Eremin-Solenikov2011-09-111-23/+0Star
| | | | | | | | mtd_device_register() is a limited version of mtd_device_parse_register. Replace it with macro calling mtd_device_parse_register(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: remove put_partition_parser() from public headerDmitry Eremin-Solenikov2011-09-111-0/+2
| | | | | | | | There is no need to pollute public header with a definition private to mtdpart.c. Move it from mtd/partitions.h to mtdpart.c Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: hide parse_mtd_partitionsDmitry Eremin-Solenikov2011-09-112-1/+3
| | | | | | | | | There is no need to export parse_mtd_partitions() now , as it's fully handled by registration functions. So move the definition to private header and remove respective EXPORT_SYMBOL_GPL. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: nand: drop edb7312 supportDmitry Eremin-Solenikov2011-09-113-196/+0Star
| | | | | | | | | EDB7312 isn't supported by mainline kernel, so drop it now. If the board support will ever be submitted to mainline, one can revert this commit. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: maps: drop edb7312 supportDmitry Eremin-Solenikov2011-09-113-143/+0Star
| | | | | | | | | | EDB7312 isn't supported by mainline kernel, this driver wasn't working before recent fixes, the same functionality can be achieved via physmap, so drop it now. If the board support will ever be submitted to mainline, one either can revert this commit, or use physmap mtd map driver. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: OneNAND: Detect the correct NOP when 4KiB pagesizeKyungmin Park2011-09-111-0/+15
| | | | | | | | | | | There are two different 4KiB pagesize chips KFM4G16Q4M series have NOP 4 with version ID 0x0131 But KFM4G16Q5M has NOP 1 with versoin ID 0x013e Note that Q5M means that it has NOP 1. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: socrates_nand.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-10/+1Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: ndfc.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-6/+1Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: mpc5121_nfc.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-10/+1Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: fsl_upm.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-3/+1Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: fsl_elbc_nand.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-6/+2Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: m25p80.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-25/+3Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: physmap_of.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-15/+3Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: physmap_of: move parse_obsolete_partitions to become separate parserDmitry Eremin-Solenikov2011-09-112-53/+75
| | | | | | | | Move parse_obsolete_partitions() to ofpart.c and register it as an ofoldpart partitions parser. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: drop of_mtd_parse_partitions()Dmitry Eremin-Solenikov2011-09-111-11/+9Star
| | | | | | | | All users have been converted to call of_mtd_parse_partitions through parse_mtd_partitions() multiplexer. Drop obsolete API. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: socrates_nand: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-11/+3Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: ndfc: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-8/+3Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: mpc5121_nfc: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-5/+3Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: fsl_upm: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-8/+3Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: fsl_elbc_nand: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-8/+4Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: m25p80: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-8/+3Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: physmap_of: use ofpart through generic parsingDmitry Eremin-Solenikov2011-09-111-8/+5Star
| | | | | | | | Convert the driver to use ofpart partitions parsing through the generic parse_mtd_partitions(). Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: prepare to convert of_mtd_parse_partitions to partition parserDmitry Eremin-Solenikov2011-09-112-4/+31
| | | | | | | | | | | | Prepare to convert of_mtd_parse_partitions() to usual partitions parser: 1) Register ofpart parser 2) Internally don't use passed device for error printing 3) Add device_node to mtd_part_parser_data struct 4) Move of_mtd_parse_partitions from __devinit to common text section 5) add ofpart to the default list of partition parsers Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: abstract last MTD partition parser argumentDmitry Eremin-Solenikov2011-09-116-18/+18
| | | | | | | | | | | | Encapsulate last MTD partition parser argument into a separate structure. Currently it holds only 'origin' field for RedBoot parser, but will be extended in future to contain at least device_node for OF devices. Amended commentary to make kerneldoc happy Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: nand_base: always initialise oob_poi before writing OOB dataTHOMSON, Adam (Adam)2011-09-111-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In nand_do_write_ops() code it is possible for a caller to provide ops.oobbuf populated and ops.mode == MTD_OOB_AUTO, which currently means that the chip->oob_poi buffer isn't initialised to all 0xFF. The nand_fill_oob() method then carries out the task of copying the provided OOB data to oob_poi, but with MTD_OOB_AUTO it skips areas marked as unavailable by the layout struct, including the bad block marker bytes. An example of this causing issues is when the last OOB data read was from the start of a bad block where the markers are not 0xFF, and the caller wishes to write new OOB data at the beginning of another block. In this scenario the caller would provide OOB data, but nand_fill_oob() would skip the bad block marker bytes in oob_poi before copying the OOB data provided by the caller. This means that when the OOB data is written back to NAND, the block is inadvertently marked as bad without the caller knowing. This has been witnessed when using YAFFS2 where tags are stored in the OOB. To avoid this oob_poi is always initialised to 0xFF to make sure no left over data is inadvertently written back to the OOB area. Credits to Brian Norris <computersforpeace@gmail.com> for fixing this patch. Signed-off-by: Adam Thomson <adam.thomson@alcatel-lucent.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com> Cc: stable@kernel.org [2.6.20+]
* mtd: onenand: remove redundant mtd_device_unregister before onenand_releaseAxel Lin2011-09-111-1/+0Star
| | | | | | | | onenand_release() will call mtd_device_unregister(), thus remove the redundant mtd_device_unregister() call before onenand_release(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
* mtd: edb7312: correctly pass MTD name to parsersDmitry Eremin-Solenikov2011-09-111-1/+2
| | | | | | | | cmdline partitions parser expects MTD name at mtd->name, instead of origin, while edb7312 passes MTDID as origin. Fix that. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: mtd_dataflash.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-18/+3Star
| | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: onenand/samsung.c: use mtd_device_parse_registerDmitry Eremin-Solenikov2011-09-111-8/+3Star
| | | | | | | | | | | Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Axel Lin <axel.lin@gmail.com>: fixed build error. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>