- 24 3月, 2017 2 次提交
-
-
由 Masahiro Yamada 提交于
The nand_default_block_markbad() and scan_block_fast() use high level APIs to get access to the BBM. On the other hand, nand_block_bad (the default implementation of ->block_bad) calls the lower level ->cmdfunc hook. This prevents drivers from using ->ecc.read_oob() even if optimized read operation is implemented. Besides, some NAND controllers may protect the BBM with ECC. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Masahiro Yamada 提交于
Currently, it is valid to specify both "nand-ecc-step-size" and "nand-ecc-strength", but not allowed to set only one of them. This requirement has a conflict with "nand-ecc-maximize"; this flag is used when you want the driver to choose the best ECC strength. If "nand-ecc-maximize" is set, "nand-ecc-strength" is very likely to be unset. It would be possible to make the if-conditional more complex by adding the check for the NAND_ECC_MAXIMIZE flag, but I chose to drop the check entirely. I thought of the situation where the hardware has a fixed ECC step size (so it can be hard-coded in the driver), whereas the ECC strength is configurable by software. In that case, we may want to only set "nand-ecc-strength" (or "nand-ecc-maximize") in DT. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 23 3月, 2017 12 次提交
-
-
由 Thomas Petazzoni 提交于
Since commit 4404d7d8 ("mtd: nand: fsmc: remove stale non-DT probe path"), the fsmc NAND driver only supports Device Tree probing, and therefore has a "depends on OF" in its Kconfig option. Due to this the #ifdef CONFIG_OF ... #endif condition in the driver code is no longer necessary. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
These definitions are not used anywhere in the driver, so remove them. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
This commit switches the fsmc_nand driver from clk_get() to devm_clk_get(), which saves a few clk_put(). Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
Since the driver now only supports DT probing, it doesn't make a lot of sense to have a private data structure called platform_data, fill it in with information coming from the DT, and then copying this into the driver-specific structure fsmc_nand_data. So instead, we remove fsmc_nand_platform_data entirely, and have fsmc_nand_probe_config_dt() fill in the fsmc_nand_data structure directly. This requires calling fsmc_nand_probe_config_dt() after fsmc_nand_data has been allocated instead of before. Also, as an added bonus, we now propagate properly the return value of fsmc_nand_probe_config_dt() instead of returning -ENODEV on failure. The error message is also removed, since it no longer made any sense. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
It is already done a few lines before. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
The ->partitions and ->nr_partitions fields of struct fsmc_nand_platform_data are never set anywhere, so they are always NULL/0. The corresponding fields in 'struct fsmc_nand_data' are set to the value of the same fields in fsmc_nand_platform_data, i.e NULL/0. Therefore, we remove those two fields, and pass NULL/0 directly to mtd_device_register(), like many other NAND drivers already do. At the same time, we remove the comment about the fact that we pass partition info, since we are no longer doing this. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
The read_dma_priv and write_dma_priv fields of fsmc_nand_platform_data are never set, so this commit removes them. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
host->select_chip used to point to the ->select_bank() function provided by the platform data, but the latter no longer exists. Therefore host->select_chip is always NULL. Due to this, the fsmc_select_chip() does nothing, except: chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); when chipnr is -1, which is exactly what the default implementation of ->select_chip() does in the NAND framework. So, this commit kills fsmc_select_chip() entirely. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
Since commit 4404d7d8 ("mtd: nand: fsmc: remove stale non-DT probe path"), only DT probing is used for the fsmc_nand driver. Due to this, the ->select_bank() field of fsmc_nand_platform_data is never used, so this commit gets rid of it. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
This commit simply moves the "struct fsmc_nand_data" definition to be towards the beginning of the file, with the other defines and type definitions, instead of in the middle of the driver code. This is much more consistent with what most Linux drivers do. Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Thomas Petazzoni 提交于
In commit eea62819 ("mtd: Add device-tree support to fsmc_nand"), Device Tree support was added to the fmsc_nand driver. However, this code has a bug in how it handles the bank-width DT property to set the bus width. Indeed, in the function fsmc_nand_probe_config_dt() that parses the Device Tree, it sets pdata->width to either 8 or 16 depending on the value of the bank-width DT property. Then, the ->probe() function will test if pdata->width is equal to FSMC_NAND_BW16 (which is 2) to set NAND_BUSWIDTH_16 in nand->options. Therefore, with the DT probing, this condition will never match. This commit fixes that by removing the "width" field from fsmc_nand_platform_data and instead have the fsmc_nand_probe_config_dt() function directly set the appropriate nand->options value. It is worth mentioning that if this commit gets backported to older kernels, prior to the drop of non-DT probing, then non-DT probing will be broken because nand->options will no longer be set to NAND_BUSWIDTH_16. Fixes: eea62819 ("mtd: Add device-tree support to fsmc_nand") Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Dan Carpenter 提交于
We should be return -ENOMEM instead of success. Fixes: 626994e0 ("mtd: nand: hynix: Add read-retry support for 1x nm MLC NANDs") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Reviewed-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 16 3月, 2017 5 次提交
-
-
由 Christophe Leroy 提交于
On some hardware, the nCE signal is wired to the ChipSelect associated to bus address of the NAND, so it is automatically driven during the memory access and it is not managed by a GPIO. Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Alison Wang 提交于
As NAND support for Freescale/NXP IFC controller is available on LS1021A, the dependency for LS1021A is added. LS1021A is an earlier product and is not compatible with later LayerScape architecture. So ARCH_LAYERSCAPE can't cover LS1021A. Signed-off-by: NAlison Wang <alison.wang@nxp.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
do_dma() uses an int to pass the DMA data direction information and pass the same value to dmaengine_prep_slave_sg(). Currently, DMA_{FROM,TO}_DEVICE match DMA_{DEV_TO_MEM,MEM_TO_DEV} definitions so it works fine, but assuming this will always be the case is not safe. Enforce enum dma_data_direction type in the function prototype and make the enum dma_data_direction -> enum dma_transfer_direction conversion explicit. Reported-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NMarc Gonzalez <marc_gonzalez@sigmadesigns.com>
-
由 Colin Ian King 提交于
trivial fix to spelling mistake in NS_ERR error message Signed-off-by: NColin Ian King <colin.king@canonical.com> Acked-by: NMarek Vasut <marek.vasut@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Philipp Zabel 提交于
As of commit bb475230 ("reset: make optional functions really optional"), the reset framework API calls use NULL pointers to describe optional, non-present reset controls. This allows to return errors from devm_reset_control_get_optional and to call reset_control_(de)assert unconditionally. Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 09 3月, 2017 17 次提交
-
-
由 Boris Brezillon 提交于
All Hynix MLC NANDs produced with the 1x nm process support read-retry. This read retry implementation should also be re-usable for other Hynix NANDs, but the method to retrieve the read-retry parameters from the read-retry OTP area might change a bit (some NANDs are even using a fixed set of values instead of retrieving those information from the OTP area). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
The current NAND ID detection in nand_hynix.c is not handling the different scheme used by Hynix, thus forcing developers to add new entry to the nand_ids table each time they want to support a new MLC NAND. Enhance the detection logic to handle all known formats. This does not necessarily mean we are handling all the cases, but if new formats are discovered, the code should evolve to take them into account instead of adding more full-id entries to the nand_ids table. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Hans de Goede 提交于
On some nand controllers with hw-ecc the controller code wants to know the ecc strength and size and having these as 0, 0 is not accepted. Specifying these in devicetree is possible but undesirable as the nand may be different in different production runs of the same board, so it is better to get this info from the nand id where possible. This commit adds code to read the ecc strength and size from the nand for Samsung extended-id nands. This code is based on the info for the 5th id byte in the datasheets for the following Samsung nands: K9GAG08U0E, K9GAG08U0F, K9GAG08X0D, K9GBG08U0A, K9GBG08U0B. These all use these bits in the exact same way. Signed-off-by: NHans de Goede <hdegoede@redhat.com> Acked-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Move Macronix specific initialization logic into nand_macronix.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Move AMD/Spansion specific initialization/detection logic into nand_amd.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
Move Micron specific initialization logic into nand_micron.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
Move Toshiba specific initialization and detection logic into nand_toshiba.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
Move Hynix specific initialization and detection logic into nand_hynix.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
Move Samsung specific initialization and detection logic into nand_samsung.c. This is part of the "separate vendor specific code from core" cleanup process. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
A lot of NANDs are implementing generic features in a non-generic way, or are providing advanced auto-detection logic where the NAND ID bytes meaning changes with the NAND generation. Providing this vendor specific initialization step will allow us to get rid of full-id entries in the nand_ids table or all the vendor specific cases added over the time in the generic NAND ID decoding logic. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
There is no reason to expose the NAND manufacturer table. Provide an helper function to find manufacturers by their id. We also turn the nand_manufacturers table into a const array, since its members are not modified after the initial assignment. Finally, we remove the sentinel manufacturer entry from the manufacturers table (we already have the array size information given by ARRAY_SIZE()), and add the nand_manufacturer_name() helper to handle the "Unknown" case properly. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
MTD_NAND_IDS is selected by MTD_NAND, which makes it useless. Remove the Kconfig option and link nand_ids.o into the nand.o object file. Doing that also prevents creating an extra nand_ids.ko module when MTD_NAND is activated as a module. Since nand_ids.c is no longer compiled as a standalone module and the nand_manuf_ids/nand_flash_ids symbols are only used in nand_base.c, we can get rid of the MODULE_XXX() and EXPORT_SYMBOL() definitions. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Drop the 's' at the end of nand_manufacturers since the struct is actually describing a single manufacturer, not a manufacturer table. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Since commit 4722c0e9 ("mtd: nand: change return type of nand_get_flash_type() to int"), nand_get_flash_type() no longer returns a nand_flash_dev object. Rename the function to match this new behavior. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
Auto-detection functions are passed a busw parameter to retrieve the actual NAND bus width and eventually set the correct value in chip->options. Rework the nand_get_flash_type() function to get rid of this extra parameter and let detection code directly set the NAND_BUSWIDTH_16 flag in chip->options if needed. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
由 Boris Brezillon 提交于
Store the NAND ID in struct nand_chip to avoid passing id_data and id_len as function parameters. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
由 Boris Brezillon 提交于
Now that struct nand_chip embeds an mtd_info object we can get rid of the mtd parameter and extract it from the chip parameter with the nand_to_mtd() helper. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRichard Weinberger <richard@nod.at> Reviewed-by: NMarek Vasut <marek.vasut@gmail.com>
-
- 02 3月, 2017 2 次提交
-
-
由 Ingo Molnar 提交于
We are going to split <linux/sched/task_stack.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/task_stack.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: NLinus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: NIngo Molnar <mingo@kernel.org>
-
由 Ingo Molnar 提交于
We are going to move softlockup APIs out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. <linux/nmi.h> already includes <linux/sched.h>. Include the <linux/nmi.h> header in the files that are going to need it. Acked-by: NLinus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: NIngo Molnar <mingo@kernel.org>
-
- 09 2月, 2017 2 次提交
-
-
由 Zach Brown 提交于
ONFI compliant chips contain the values for the max_bb_per_die and blocks_per_die fields in the parameter page. When the ONFI paged is retrieved/parsed the chip's fields are set by the corresponding fields in the param page. Signed-off-by: NZach Brown <zach.brown@ni.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electron.com> Acked-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Zach Brown 提交于
Implement the new mtd function 'max_bad_blocks'. Using the chip's max_bb_per_die and blocks_per_die fields to determine the maximum bad blocks to reserve for an MTD. Signed-off-by: NJeff Westfahl <jeff.westfahl@ni.com> Signed-off-by: NZach Brown <zach.brown@ni.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electron.com> Acked-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-