- 16 3月, 2018 4 次提交
-
-
由 Boris Brezillon 提交于
None of the mtd->_erase() implementations work in an asynchronous manner, so let's simplify MTD users that call mtd_erase(). All they need to do is check the value returned by mtd_erase() and assume that != 0 means failure. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NRichard Weinberger <richard@nod.at>
-
由 Boris Brezillon 提交于
mtd_erase() can return an error before ->fail_addr is initialized to MTD_FAIL_ADDR_UNKNOWN. Move this initialization at the very beginning of the function. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NRichard Weinberger <richard@nod.at>
-
由 Antonio Cardace 提交于
Use %*ph format to print small buffer as hex string. Suggested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NAntonio Cardace <anto.cardace@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Colin Ian King 提交于
Pointer bdev is being initialized however this value is never read as bdev is assigned an updated value from the returned call to blkdev_get_by_path. Remove the redundant assignment. Cleans up clang warning: drivers/mtd/devices/block2mtd.c:228:23: warning: Value stored to 'bdev' during its initialization is never read Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
- 12 2月, 2018 3 次提交
-
-
由 Rafał Miłecki 提交于
This simplifies code a bit by: 1) Avoiding an extra (tiny) function 2) Checking for amount of parsed (found) partitions just once 3) Avoiding clearing/filling struct mtd_partitions manually With this commit proper functions are called directly from the mtd_device_parse_register(). It doesn't need to use minor tricks like memsetting struct to 0 to trigger an expected mtd_add_device_partitions() behavior. Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Rafał Miłecki 提交于
This change is a small cleanup of mtd_device_parse_register(). When using MTD_PARTITIONED_MASTER it makes sure a master MTD is registered before dealing with partitions. The advantage of this is not mixing code handling master MTD with code handling partitions. This commit doesn't change any behavior except from a slightly different failure code path. The new code may need to call del_mtd_device when something goes wrong. Signed-off-by: NRafał Miłecki <rafal@milecki.pl> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
由 Boris Brezillon 提交于
Some devices do not implement ->_erase() or have an invalid ->erasesize value. In this case, mtd_erase() should return -ENOTSUPP. Note that the test is not done on the MTD_NO_ERASE flag because this flag means 'erasing a block before writing to it is unnecessary', not 'the erase operation is not supported'. Actually, some drivers are setting the MTD_NO_ERASE flag but still implementing the ->_erase() hook and setting a valid ->erasesize value. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
-
- 25 1月, 2018 2 次提交
-
-
由 Miquel Raynal 提交于
When the requested ECC strength does not exactly match the strengths supported by the ECC engine, the driver is selecting the closest strength meeting the 'selected_strength > requested_strength' constraint. Fix the fact that, in this particular case, ecc->strength value was not updated to match the 'selected_strength'. For instance, one can encounter this issue when no ECC requirement is filled in the device tree while the NAND chip minimum requirement is not a strength/step_size combo natively supported by the ECC engine. Fixes: 1fef62c1 ("mtd: nand: add sunxi NAND flash controller support") Cc: <stable@vger.kernel.org> Suggested-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Commit 25f815f6 ("mtd: nand: force drivers to explicitly send READ/PROG commands") added a call to nand_read_page_op() in gpmi_ecc_read_page(), which means this function now sends a READ0 command and place the data pointer at the beginning of the page. This logic is breaking gpmi_ecc_read_subpage() which was calling gpmi_ecc_read_page() and expected it to only retrieve the data without sending the READ0 command. Create a gpmi_ecc_read_page_data() helper which only does the data retrieval and ECC correction steps and implement gpmi_ecc_read_page() as a wrapper that calls nand_read_page_op()+gpmi_ecc_read_page_data(). This way, gpmi_ecc_read_subpage() can call gpmi_ecc_read_page_data() which restores the logic we had before commit 25f815f6 ("mtd: nand: force drivers to explicitly send READ/PROG commands"). Fixes: 25f815f6 ("mtd: nand: force drivers to explicitly send READ/PROG commands") Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Acked-by: NHan Xu <han.xu@nxp.com>
-
- 20 1月, 2018 2 次提交
-
-
由 Miquel Raynal 提交于
GCC-4.4.4 raises errors when assigning a parameter in an anonymous union, leading to this kind of failure: drivers/mtd/nand/marvell_nand.c:1936: warning: missing braces around initializer warning: (near initialization for '(anonymous)[1].<anonymous>') error: unknown field 'data' specified in initializer error: unknown field 'addr' specified in initializer Work around the situation by naming these unions. Fixes: 8878b126 ("mtd: nand: add ->exec_op() implementation") Reported-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Tested-by: NAndrew Morton <akpm@linux-foundation.org> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Miquel Raynal 提交于
The function marvell_nfc_init_dma() allocates a DMA buffer without the GFP_KERNEL modifier, that triggers this warning: "marvell_nfc_init_dma() error: no modifiers for allocation." Fix this by using (GFP_KERNEL | GFP_DMA) instead of only GFP_DMA as the probe happens in non-interrupt context. Fixes: 02f26ecf ("mtd: nand: add reworked Marvell NAND controller driver") Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 19 1月, 2018 3 次提交
-
-
由 Colin Ian King 提交于
Variable oob_len is assigned and never read, hence it is redundant and can be removed. Cleans up clang warnings: drivers/mtd/nand/marvell_nand.c:1356:6: warning: Value stored to 'oob_len' during its initialization is never read drivers/mtd/nand/marvell_nand.c:1369:4: warning: Value stored to 'oob_len' is never read Signed-off-by: NColin Ian King <colin.king@canonical.com> Acked-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Colin Ian King 提交于
Trivial fix to spelling mistakes in dev_err error message text. Signed-off-by: NColin Ian King <colin.king@canonical.com> Acked-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Wei Yongjun 提交于
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 18 1月, 2018 9 次提交
-
-
由 Bradley Bolen 提交于
This fixes a race with idr_alloc where gd->first_minor can be set to the same value for two simultaneous calls to ubiblock_create. Each instance calls device_add_disk with the same first_minor. device_add_disk calls bdi_register_owner which generates several warnings. WARNING: CPU: 1 PID: 179 at kernel-source/fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x88 sysfs: cannot create duplicate filename '/devices/virtual/bdi/252:2' WARNING: CPU: 1 PID: 179 at kernel-source/lib/kobject.c:240 kobject_add_internal+0x1ec/0x2f8 kobject_add_internal failed for 252:2 with -EEXIST, don't try to register things with the same name in the same directory WARNING: CPU: 1 PID: 179 at kernel-source/fs/sysfs/dir.c:31 sysfs_warn_dup+0x68/0x88 sysfs: cannot create duplicate filename '/dev/block/252:2' However, device_add_disk does not error out when bdi_register_owner returns an error. Control continues until reaching blk_register_queue. It then BUGs. kernel BUG at kernel-source/fs/sysfs/group.c:113! [<c01e26cc>] (internal_create_group) from [<c01e2950>] (sysfs_create_group+0x20/0x24) [<c01e2950>] (sysfs_create_group) from [<c00e3d38>] (blk_trace_init_sysfs+0x18/0x20) [<c00e3d38>] (blk_trace_init_sysfs) from [<c02bdfbc>] (blk_register_queue+0xd8/0x154) [<c02bdfbc>] (blk_register_queue) from [<c02cec84>] (device_add_disk+0x194/0x44c) [<c02cec84>] (device_add_disk) from [<c0436ec8>] (ubiblock_create+0x284/0x2e0) [<c0436ec8>] (ubiblock_create) from [<c0427bb8>] (vol_cdev_ioctl+0x450/0x554) [<c0427bb8>] (vol_cdev_ioctl) from [<c0189110>] (vfs_ioctl+0x30/0x44) [<c0189110>] (vfs_ioctl) from [<c01892e0>] (do_vfs_ioctl+0xa0/0x790) [<c01892e0>] (do_vfs_ioctl) from [<c0189a14>] (SyS_ioctl+0x44/0x68) [<c0189a14>] (SyS_ioctl) from [<c0010640>] (ret_fast_syscall+0x0/0x34) Locking idr_alloc/idr_remove removes the race and keeps gd->first_minor unique. Fixes: 2bf50d42 ("UBI: block: Dynamically allocate minor numbers") Cc: stable@vger.kernel.org Signed-off-by: NBradley Bolen <bradleybolen@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Wei Yongjun 提交于
Fix to return error code -ENOMEM from the kmem_cache_alloc() error handling case instead of 0, as done elsewhere in this function. Fixes: f78e5623 ("ubi: fastmap: Erase outdated anchor PEBs during attach") Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Sascha Hauer 提交于
The function documentation of leb_write_trylock is copied from leb_write_lock. Replace the function name with the correct one. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Sascha Hauer 提交于
Fix misspelling of 'available' in function name. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Sascha Hauer 提交于
The fastmap update code might erase the current fastmap anchor PEB in case it doesn't find any new free PEB. When a power cut happens in this situation we must not have any outdated fastmap anchor PEB on the device, because that would be used to attach during next boot. The easiest way to make that sure is to erase all outdated fastmap anchor PEBs synchronously during attach. Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de> Reviewed-by: NRichard Weinberger <richard@nod.at> Fixes: dbb7d2a8 ("UBI: Add fastmap core") Cc: <stable@vger.kernel.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Colin Ian King 提交于
The pointer p is being initialized with one value and a few lines later being set to a newer replacement value. Clean up the code by using the latter assignment to p as the initial value. Cleans up clang warning: drivers/mtd/ubi/fastmap.c:217:19: warning: Value stored to 'p' during its initialization is never read Signed-off-by: NColin Ian King <colin.king@canonical.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Pan Bian 提交于
Memory allocated by kmem_cache_alloc() should not be deallocated with kfree(). Use kmem_cache_free() instead. Signed-off-by: NPan Bian <bianpan2016@163.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Clay McClure 提交于
Similar to commit 714fb87e ("ubi: Fix race condition between ubi device creation and udev"), we should make the volume active before registering it. Signed-off-by: NClay McClure <clay@daemons.net> Cc: <stable@vger.kernel.org> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
由 Jeff Westfahl 提交于
If the user has not set max_beb_per1024 using either the cmdline or Kconfig options for doing so, use the MTD function 'max_bad_blocks' to compute the UBI bad_peb_limit. 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: NRichard Weinberger <richard@nod.at> Signed-off-by: NRichard Weinberger <richard@nod.at>
-
- 16 1月, 2018 4 次提交
-
-
由 Boris Brezillon 提交于
Some of the check done in custom ->_read/write_oob() implementation are already done by the core (in mtd_check_oob_ops()). Suggested-by: NPeter Pan <peterpansjtu@gmail.com> [Remove redundant checks done in mtdpart.c] Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NLadislav Michl <ladis@linux-mips.org>
-
由 Boris Brezillon 提交于
Some MTD sublayers/drivers are implementing ->_read/write_oob() and provide dummy wrappers for their ->_read/write() implementations. Let the core handle this case instead of duplicating the logic. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NRobert Jarzmik <robert.jarzmik@free.fr> Acked-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Tested-by: NLadislav Michl <ladis@linux-mips.org>
-
由 Boris Brezillon 提交于
part_read() and part_read_oob() were counting ECC failures and bitflips differently. Adjust part_read_oob() to mimic what is done in part_read(). This is needed to use ->_read_oob() as a fallback when when ->_read() is not implemented. Note that bitflips and ECC failure accounting on MTD partitions is broken by design, because nothing prevents concurrent accesses to the underlying master MTD device between the moment we save the stats in a local variable and the moment master->_read[_oob]() returns. It's not something that can easily be fixed, so leave it like that for now. Suggested-by: NBrian Norris <computersforpeace@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Tested-by: NLadislav Michl <ladis@linux-mips.org>
-
由 Arnd Bergmann 提交于
The omap2 onenand driver is now available for compile-testing, which uncovers a warning in configurations that have a 64-bit resource_size_t: drivers/mtd/onenand/omap2.c: In function 'omap2_onenand_probe': drivers/mtd/onenand/omap2.c:536:54: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=] dev_err(dev, "Cannot reserve memory region at 0x%08x, size: 0x%x\n", drivers/mtd/onenand/omap2.c:536:66: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t {aka long long unsigned int}' [-Werror=format=] Changing the format string to the special %pR simplifies the code and lets it do the right thing in that configuration, while avoiding the warning. Fixes: a758f50f ("mtd: onenand: omap2: Configure driver from DT") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 14 1月, 2018 2 次提交
-
-
由 Guochun Mao 提交于
Since more and more Mediatek's SoC can use this driver to control spi-nor flash, functions' name with "mt8173_" is no longer properly. Replacing "mt8173_" with "mtk_" will be more accurate to describe these functions' usable scope. Signed-off-by: NGuochun Mao <guochun.mao@mediatek.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@wedev4u.fr>
-
由 Christophe JAILLET 提交于
'page_buf' and 'oob_buf' are allocated with 'devm_kzalloc()' and should not have __iomem decoration. Remove these decorations and some useless casting. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 12 1月, 2018 11 次提交
-
-
由 Ladislav Michl 提交于
Move away from platform data configuration and use pure DT approach. Use generic probe function to deal with OneNAND node and remove now useless gpmc_probe_onenand_child function. Import sync mode timing calculation function from mach-omap2/gpmc-onenand.c Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Acked-by: NRoger Quadros <rogerq@ti.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
INT pin (gpio_irq) is not really needed for DMA but only for notification when a command that needs wait has completed. DMA memcpy can be still used even without gpio_irq available, so enable it unconditionally. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Acked-by: NRoger Quadros <rogerq@ti.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
Second commit in driver history (782b7a36: "[MTD] [OneNAND] OMAP3: add delay for GPIO") added quirk for waiting until GPIO line settle. As DMA was disabled for OMAP2 boards, chances are this problem was not OMAP3 specific and as it is just one register read, previous test for SoC type is approximately as expensive as read itself. Make delay unconditional, which allows removing SoC specific code alltogether. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Peter Ujfalusi 提交于
Do not use the legacy and deprecated omap-dma interface for setting up the memcpy. Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
Since the very first commit (36cd4fb5: "[MTD] [OneNAND] Add OMAP2 / OMAP3 OneNAND driver") DMA is disabled for OMAP2. Later fixes thus went only into OMAP3 specific DMA functions which turned out not to be so OMAP3 specific, so merge those two implementations. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Peter Ujfalusi 提交于
We have 4 functions containing almost identical DMA setup code. Create one function which can set up the DMA for both read and write and use this in place for the setup code in the driver. The new function will use wait_for_completion_io_timeout() and it will figure out the best data_type to be used for the transfer instead of hardwiring 32 or 16 bit data. Signed-off-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
Use wait_for_completion_io_timeout, which has an impact on how the task is accounted in scheduling stats. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
No platform data user setups partitioning information, so remove. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
No platform data user sets skip_initial_unlocking, so remove test for this field. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Ladislav Michl 提交于
As no platform data user sets regulator_can_sleep, regulator code is no-op and can be deleted. Signed-off-by: NLadislav Michl <ladis@linux-mips.org> Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk> Acked-by: NRoger Quadros <rogerq@ti.com> Tested-by: NTony Lindgren <tony@atomide.com> Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Miquel Raynal 提交于
Add marvell_nand driver which aims at replacing the existing pxa3xx_nand driver. The new driver intends to be easier to understand and follows the brand new NAND framework rules by implementing hooks for every pattern the controller might support and referencing them inside a parser object that will be given to the core at each ->exec_op() call. Raw accessors are implemented, useful to test/debug memory/filesystem corruptions. Userspace binaries contained in the mtd-utils package may now be used and their output trusted. Most of the DT nodes using the old driver kept non-optimal timings from the bootloader (even if there was some mechanisms to derive them if the chip was ONFI compliant). The new default is to implement ->setup_data_interface() and follow the core's decision regarding the chip. Thanks to the improved timings, implementation of ONFI mode 5 support (with EDO managed by adding a delay on data sampling), merging the commands together and optimizing writes in the command registers, the new driver may achieve faster throughputs in both directions. Measurements show an improvement of about +23% read throughput and +24% write throughput. These measurements have been done with an Armada-385-DB-AP (4kiB NAND pages forced in 4-bit strength BCH ECC correction) using the userspace tool 'flash_speed' from the MTD test suite. Besides these important topics, the new driver addresses several unsolved known issues in the old driver which: - did not work with ECC soft neither with ECC none ; - relied on naked read/write (which is unchanged) while the NFCv1 embedded in the pxa3xx platforms do not implement it, so several NAND commands did not actually ever work without any notice (like reading the ONFI PARAM_PAGE or SET/GET_FEATURES) ; - wrote the OOB data correctly, but was not able to read it correctly past the first OOB data chunk ; - did not retrieve ECC bytes ; - used device tree bindings that did not allow more than one NAND chip, and did not allow to choose the correct chip select if not incrementing from 0. Plus, the Ready/Busy line used had to be 0. Old device tree bindings are still supported but deprecated. A more hierarchical view has to be used to keep the controller and the NAND chip structures clearly separated both inside the device tree and also in the driver code. Signed-off-by: NMiquel Raynal <miquel.raynal@free-electrons.com> Tested-by: NSean Nyekjaer <sean.nyekjaer@prevas.dk> Tested-by: NWilly Tarreau <w@1wt.eu> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-