- 23 9月, 2016 1 次提交
-
-
由 Marc Gonzalez 提交于
The code to initialize a struct nand_hw_control is duplicated across several drivers. Factorize it using an inline function. Signed-off-by: NMarc Gonzalez <marc_gonzalez@sigmadesigns.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 11 7月, 2016 7 次提交
-
-
由 Dan Carpenter 提交于
I moved the sanity check on ecc->size before the allocation so that we don't leak memory on error. Fixes: 05af074a4b73 ('mtd: nand: sunxi: check ecc->size values') Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Icenowy Zheng 提交于
The NAND controller on some sun8i chips needs its reset line to be deasserted before they can enter working state. Signed-off-by: NIcenowy Zheng <icenowy@aosc.xyz> Acked-by: NMaxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Implement ecc->write_subpage() to prevent core code from assigning this hook to nand_write_subpage_hwecc(). This default implementation tries to call ecc->hwctl() which in our case is NULL, thus leading to a NULL pointer dereference. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Verify that the ecc->size value is either 512 or 1024 bytes. This should always be the case if this field was assigned to the nand->ecc_step_size_ds value, but can be wrong when the user overloaded this value with the nand-ecc-step-size DT property. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Switching to 1k ECC blocks when possible provides better resistance against concentrated bitflips. Say you have those two configurations: 1/ 16bits/512bytes 2/ 32bits/1024bytes Both of them require the same amount of ECC bytes (only true for this specific engine), but the second config allows you to correct the case where most of your bitflips are concentrated in a single 512bytes portion. This fact makes the 1k ECC block size more advantageous than the 512bytes one. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The column address passed to the RNDOUT operation was missing the page size offset. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Fixes: 614049a8 ("mtd: nand: sunxi: add support for DMA assisted operations")
-
由 Wei Yongjun 提交于
In case of error, the function dmaengine_prep_slave_sg() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Fixes: 614049a8 ("mtd: nand: sunxi: add support for DMA assisted operations") Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 06 6月, 2016 1 次提交
-
-
由 Boris Brezillon 提交于
The sunxi NAND controller is able to pipeline ECC operations only when operated in DMA mode, which improves a lot NAND throughput while keeping CPU usage low. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 06 5月, 2016 2 次提交
-
-
由 Rafał Miłecki 提交于
This value should not be part of nand_ecc_modes_t as it specifies algorithm not a mode. We successfully managed to introduce new "algo" field which is respected now. Signed-off-by: NRafał Miłecki <zajec5@gmail.com> Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Implementing the mtd_ooblayout_ops interface is the new way of exposing ECC/OOB layout to MTD users. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 20 4月, 2016 19 次提交
-
-
由 Boris Brezillon 提交于
Allow for NULL cur_offs values when the caller does not know where the NAND page register pointer points to. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
sunxi_nfc_hw_ecc_read_chunk() always retrieves the ECC and protected free bytes, no matter if the user really asked for it or not. This can take a non negligible amount of time, especially on NAND chips exposing large OOB areas (> 1KB). Make it optional. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
In order to support DMA operations in a clean way we need to extract some of the logic coded in sunxi_nfc_hw_ecc_read/write_page() into their own function. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Some NAND operations are so fast that it doesn't make any sense to use interrupt based waits (the scheduling overhead is not worth it). Rename sunxi_nfc_wait_int() into sunxi_nfc_wait_events() and add a parameter to specify whether polling should be used or not. Note that all sunxi_nfc_wait_int() are moved to the polling approach now, but this should change as soon as we have more information about the approximate time we are about to wait (can be extracted from the NAND timings, and the type of operation). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Replace open coded polling loops by readl_poll_timeout() calls. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
->dev_ready() is not supposed to wait for busy to ready solution (this is the role of ->waitfunc()). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
When the NAND controller operates in DMA mode it can pipeline ECC operations which improves the throughput. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
mod and ahb clocks are not disabled when the NAND controller device is removed. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
NFC_PAGE_SHIFT() already takes the real page_shift value and subtract 10 to it. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
NFC_ECC_ERR_CNT() is not taking into account the case when the NAND chip contains more than 4 ECC blocks (NANDs with 4kB+ pages). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
We don't need to manually toggle the CE line since the controller handles it for us. Moreover, keeping the CE line low when interacting with a DDR NAND can be problematic (data loss in some corner cases). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Try to pack address and command cycles into a single NAND controller command to avoid polling the status register for each single change on the NAND bus. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Being able to read subpages can greatly improve read performances if the MTD user is only interested in a small section of a NAND page. This is particularly true with large pages (>= 8k). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Allwinner's ECC engine is capable of protecting a few bytes of the OOB area. Implement specific OOB functions to benefit from this capability. Also, when in raw mode, the randomizer is disabled, which means you'll only be able to retrieve randomized data, which is not really useful for most applications. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Adapt the NAND controller clk rate to the tWB, tADL, tWHR and tRHW timings instead of returning an error when the maximum clk divisor is not big enough to provide an appropriate timing. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
The ONFI spec says that EDO should be enabled if the host drives tRC less than 30ns, but the code just tests for the tRC_min value extracted from the timings exposed by the NAND chip not the timings actually configured in the NAND controller. Fix that by first rounding down the requested clk_rate with clk_round_rate() and then checking if tRC is actually smaller than 30ns. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Unlike what is specified in the Allwinner datasheets, the NAND clock rate is not equal to 2/T but 1/T. Fix the clock rate selection accordingly. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
sunxi_nand_chip_set_timings() is extracting a pointer to the nfc from the nand->controller field, but this field is initialized after sunxi_nand_chip_set_timings() call. Reorder the calls to avoid any problem. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Boris Brezillon 提交于
Some drivers are including linux/of_mtd.h even if they don't use any of the of_get_nand_xxx() helpers. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Acked-by: NHarvey Hunt <harvey.hunt@imgtec.com>
-
- 05 3月, 2016 1 次提交
-
-
由 Boris BREZILLON 提交于
mtd->priv is no longer pointing to the struct nand_chip it is attached to. Replace those accesses by mtd_to_nand() calls. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Fixes: 4be4e03e ("mtd: nand: sunxi: add randomizer support") Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 24 1月, 2016 1 次提交
-
-
由 Brian Norris 提交于
Suggested-by: NRichard Weinberger <richard@nod.at> Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 23 1月, 2016 1 次提交
-
-
由 Boris BREZILLON 提交于
Add support for the randomizer engine available in Allwinner's NFC IP. Randomization is useful to support modern NAND chips which are sensitive to repeated patterns. On such NANDs you might experience an unexpectedly high number of bitflips when you repeat the same pattern all over a given NAND block. Randomizing input data mitigate this problem by avoiding such repeated patterns. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 19 12月, 2015 2 次提交
-
-
由 Boris BREZILLON 提交于
mtd_to_nand() now uses the container_of() approach to transform an mtd_info pointer into a nand_chip one. Drop useless mtd->priv assignments from NAND controller drivers. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
由 Boris BREZILLON 提交于
struct nand_chip now embeds an mtd device. Make use of this mtd instance. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 09 12月, 2015 1 次提交
-
-
由 Boris BREZILLON 提交于
mtd_to_nand() was recently introduced to avoid direct accesses to the mtd->priv field. Update all NAND drivers to use it. Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 01 12月, 2015 1 次提交
-
-
由 Julia Lawall 提交于
for_each_child_of_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ expression root,e; local idexpression child; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child ( return child; | + of_node_put(child); ? return ...; ) ... } // </smpl> Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr> Acked-by: NChen-Yu Tsai <wens@csie.org> Acked-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-
- 12 11月, 2015 2 次提交
-
-
由 Brian Norris 提交于
All of these drivers set up a parser data struct just to communicate DT partition data. This field has been deprecated and is instead supported by telling nand_scan_ident() about the 'flash_node'. This patch: * sets chip->flash_node for those drivers that didn't already (but used OF partitioning) * drops the parser data * switches to the simpler mtd_device_register() where possible, now that we've eliminated one of the auxiliary parameters Now that we've assigned chip->flash_node for these drivers, we can probably rely on nand_dt_init() to do more of the DT parsing for us, but for now, I don't want to fiddle with each of these drivers. The parsing is done in duplicate for now on some drivers. I don't think this should break things. (Famous last words.) (Rolled in some changes by Boris Brezillon) Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
由 Brian Norris 提交于
Used semantic patch with 'make coccicheck MODE=patch COCCI=script.cocci': ---8<---- virtual patch @@ struct nand_chip *c; struct device_node *d; @@ -(c)->flash_node = (d) +nand_set_flash_node(c, d) ---8<---- Signed-off-by: NBrian Norris <computersforpeace@gmail.com> Reviewed-by: NMarek Vasut <marex@denx.de> Reviewed-by: NBoris Brezillon <boris.brezillon@free-electrons.com>
-
- 03 11月, 2015 1 次提交
-
-
由 Boris BREZILLON 提交于
The in-band data are copied twice: before ECC correction and after the ECC engine has fixed all the fixable bitflips. Drop the useless memcpy_fromio operation by passing a NULL pointer when calling sunxi_nfc_read_buf(). Signed-off-by: NBoris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
-