- 11 5月, 2020 3 次提交
-
-
由 Miquel Raynal 提交于
These flags are in a strange order, reorder the list, add spaces when it is relevant, pack definitions that are related. There is no functional change. Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-3-miquel.raynal@bootlin.com
-
由 Miquel Raynal 提交于
Use the BIT() macro instead of defining a 8-digit value. Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200507105241.14299-2-miquel.raynal@bootlin.com
-
由 Miquel Raynal 提交于
Convert the timings union into a structure containing the mode and the actual values. The values are still a union in prevision of the addition of the NVDDR modes. Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200428094302.14624-2-miquel.raynal@bootlin.com
-
- 25 3月, 2020 1 次提交
-
-
由 Mason Yang 提交于
Patch nand_suspend() & nand_resume() to let manufacturers overwrite suspend/resume operations. Signed-off-by: NMason Yang <masonccyang@mxic.com.tw> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1584517348-14486-2-git-send-email-masonccyang@mxic.com.tw
-
- 11 3月, 2020 2 次提交
-
-
由 Mason Yang 提交于
Add nand_lock() & nand_unlock() for manufacturer specific lock & unlock operation while the device supports Block Portection function. Signed-off-by: NMason Yang <masonccyang@mxic.com.tw> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/1583220084-10890-2-git-send-email-masonccyang@mxic.com.tw
-
由 Jonathan Neuschäfer 提交于
Signed-off-by: NJonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200223180634.8736-1-j.neuschaefer@gmx.net
-
- 28 6月, 2019 1 次提交
-
-
由 Sascha Hauer 提交于
The NAND core has a NAND operation tracing function, but it can only be used by drivers using the generic option parser from the NAND core. Export the tracing function as a static inline function in rawnand.h so that drivers implementing exec_op directly do not have to write their own operation tracing. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 19 6月, 2019 1 次提交
-
-
由 Thomas Gleixner 提交于
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: NThomas Gleixner <tglx@linutronix.de> Reviewed-by: NEnrico Weigelt <info@metux.net> Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org> Reviewed-by: NAllison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 18 4月, 2019 4 次提交
-
-
由 Frieder Schrempf 提交于
To be able to check and set bad block markers in the first and second page of a block independently of each other, we create separate flags for both cases. Previously NAND_BBM_SECONDPAGE meant, that both, the first and the second page were used. With this patch NAND_BBM_FIRSTPAGE stands for using the first page and NAND_BBM_SECONDPAGE for using the second page. This patch is only for preparation of subsequent changes and does not implement the logic to actually handle both flags separately. Signed-off-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Frieder Schrempf 提交于
The information about where the manufacturer puts the bad block markers inside the bad block and in the OOB data is stored in different places. Let's move this information to nand_chip.options and nand_chip.badblockpos. As this chip-specific information is not directly related to the bad block table (BBT), we also rename the flags to NAND_BBM_*. Signed-off-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Reviewed-by: NMiquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Masahiro Yamada 提交于
Currently, drivers are able to constify a nand_op_parser array, but not nand_op_parser_pattern and nand_op_parser_pattern_elem since they are instantiated by using the NAND_OP_PARSER(_PATTERN). Add 'const' to them in order to move more driver data from .data to .rodata section. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Jonathan Neuschäfer 提交于
Sphinx doesn't handle expressions in identifier references. This fixes the following warnings: ./include/linux/mtd/rawnand.h:1184: WARNING: Inline strong start-string without end-string. ./include/linux/mtd/rawnand.h:1186: WARNING: Inline strong start-string without end-string. Signed-off-by: NJonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 08 4月, 2019 9 次提交
-
-
由 Boris Brezillon 提交于
nand_device embeds a nand_ecc_req object which contains the minimum strength and step-size required by the NAND device. Drop the chip->ecc_{strength,step}_ds fields and use chip->base.eccreq.{strength,step_size} instead. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
The same information is provided by nanddev_ntargets(). Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
The target size can now be returned by nanddev_get_targetsize(). Get rid of the chip->chipsize field and use this helper instead. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Now that we inherit from nand_device, we can use nand_device->memorg.bits_per_cell instead of having our own field at the nand_chip level. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
nanddev_mtd_max_bad_blocks() is implemented by the generic NAND layer and is already doing what we need. Reuse this function instead of having our own implementation. While at it, get rid of the ->max_bb_per_die and ->blocks_per_die fields which are now unused. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
Looking at the field names it's hard to tell what ->data_buf, ->pagebuf and ->pagebuf_bitflips are for. Clarify that by moving those fields in a sub-struct named pagecache. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
We plan to move cache related fields to a pagecache struct in nand_chip but some drivers access ->pagebuf directly to invalidate the cache before they start using ->data_buf. Let's provide an helper that returns a pointer to ->data_buf after invalidating the cache. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
The generic NAND layer provides abstraction of NAND devices no matter the bus that is used to communicate with the chip. Basing the raw NAND core on this generic layer should avoid duplication of common operations, like iterating over all pages/blocks for MTD IO/erase operations. In order to re-use this layer, we must first inherit from nand_device and then initialize the nand_device struct appropriately. This patch is taking care of the former. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
由 Boris Brezillon 提交于
Use the nand_to_mtd() helper to access chip->mtd as done everywhere else. Signed-off-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@kontron.de>
-
- 05 2月, 2019 2 次提交
-
-
由 Masahiro Yamada 提交于
Now that the last user of this hook, denali.c, stopped using it, we can remove the erase hook from nand_legacy. I squashed single_erase() because only the difference between single_erase() and nand_erase_op() is the number of bit shifts. The status/ret conversion in nand_erase_nand() is unneeded since commit eb94555e ("mtd: nand: use usual return values for the ->erase() hook"). Cleaned it up now. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
nand_get_device() was complex for apparently no good reason. Let's replace this locking scheme with 2 mutexes: one attached to the controller and another one attached to the chip. Every time the core calls nand_get_device(), it will first lock the chip and if the chip is not suspended, will then lock the controller. nand_release_device() will release both lock in the reverse order. nand_get_device() can sleep, just like the previous implementation, which means you should never call that from an atomic context. We also get rid of - the chip->state field, since all it was used for was flagging the chip as suspended. We replace it by a field called chip->suspended and directly set it from nand_suspend/resume() - the controller->wq and controller->active fields which are no longer needed since the new controller->lock (now a mutex) guarantees that all operations are serialized at the controller level - panic_nand_get_device() which would anyway be a no-op. Talking about panic write, I keep thinking the rawnand implementation is unsafe because there's not negotiation with the controller to know when it's actually done with it's previous operation. I don't intend to fix that here, but that's probably something we should look at, or maybe we should consider dropping the ->_panic_write() implementation Last important change to mention: we now return -EBUSY when someone tries to access a device that as been suspended, and propagate this error to the upper layer. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 07 12月, 2018 8 次提交
-
-
由 Boris Brezillon 提交于
We try to force NAND controller drivers to properly separate the NAND controller object from the NAND chip one, so let's deprecate the dummy controller object embedded in nand_chip to encourage them to create their own instance. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
->setup_data_interface() is a controller specific method and should thus be placed in nand_controller_ops. In order to make that work with controllers that support keeping pre-configured timings we need to add a new NAND_KEEP_TIMINGS flag to inform the core it should skip the timings selection step. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
->exec_op() is a controller method and has nothing to do in the nand_chip struct. Let's move it to the nand_controller_ops struct and adjust the core and drivers accordingly. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Now that the CS line to be selected is passed to ->exec_op() and stored in chip->cur_cs and after patching all drivers implementing ->exec_op() to stop implementing this method, we can deprecate it by moving it to the nand_legacy structure. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
In order to deprecate the ->select_chip hook we need to pass the CS line a NAND operations are targeting. This is done through the addition of a cs field to the nand_operation struct. We also need to keep track of the currently selected target to properly initialize op->cs, hence the ->cur_cs field addition to the nand_chip struct. Note that op->cs is not assigned in nand_exec_op() because we might rework the way we execute NAND operations in the future (adopt a queuing mechanism instead of the serialization we have right now). Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Add a wrapper to prevent drivers and core code from directly calling the ->select_chip hook which we are about to deprecate. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Looks like NAND_CONTROLLER_ALLOC has been introduced a long time ago back when the dummy nand_hw_ctrl object was dynamically allocated instead of being embedded in nand_chip. We can safely get rid of this unused flag. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
nand_exec_op() is only used by core code (nand_xxx.c files). Let's move this inline function in drivers/mtd/nand/raw/internals.h. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Tested-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 05 11月, 2018 1 次提交
-
-
由 Janusz Krzysztofik 提交于
Each controller driver having access to NAND R/B pin over GPIO would have to reimplement the polling loop otherwise. Suggested-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NJanusz Krzysztofik <jmkrzyszt@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
- 03 10月, 2018 8 次提交
-
-
由 Boris Brezillon 提交于
Currently, the selection of ECC byte ordering for software hamming is done at compilation time, which doesn't make sense when ECC byte calculation is done in hardware and byte ordering is forced by the hardware engine. In this case, only the correction is done in software and we want to force the byte-ordering no matter the value of CONFIG_MTD_NAND_ECC_SMC. This is typically the case for the FSMC (Smart Media ordering), TMIO and TXX9NDFMC (regular byte ordering) blocks. For all other use cases (pure software implementation, SM FTL and nandecctest), we keep selecting the byte ordering based on the CONFIG_MTD_NAND_ECC_SMC value. It might not be ideal for SM FTL (I'd expect Smart Media ordering to be employed by the Smart Media FTL), but this option doesn't seem to be enabled in the existing _defconfig, so I can't tell setting sm_order to true is the right choice. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
This moves JEDEC related code to nand_jedec.c and JEDEC related struct/macros to include/linux/mtd/jedec.h. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
This moves ONFI related code to nand_onfi.c and ONFI related struct/macros to include/linux/mtd/onfi.h. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
A lot of things defined in rawnand.h should not be exposed to NAND controller drivers and should only be shared by core files. Create the drivers/mtd/nand/raw/internals.h header to store such definitions, and move all private defs to this header. Also remove EXPORT_SYMBOLS() on functions that are not supposed to be exposed. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
onfi_get_async_timing_mode() is only used in one place inside nand_base.c. Let's inline the code and kill the helper. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
platform_nand_xxx definitions are just used by the plat_nand driver. Let's move those definitions out of the core/driver-agnostic rawnand.h header. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
Those definitions are not used, let's remove them. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-
由 Boris Brezillon 提交于
There's already a forward declaration of nand_chip at the beginning of the file. Get rid of this one. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
-