summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/raw/gpmi-nand
Commit message (Collapse)AuthorAgeFilesLines
* mtd: rawnand: gpmi: remove unnecessary variablesSascha Hauer2018-04-291-10/+5
| | | | | | | | | Use this->auxiliary_virt and this->auxiliary_phys directly rather than creating extra local variables for them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: return valid value from bch_set_geometry()Sascha Hauer2018-04-291-2/+3
| | | | | | | | | | The caller of bch_set_geometry() expects the return value to be an error code, so !0 is not valid. return the error from the just called function instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: remove direct_dma_map_ok from driver data structSascha Hauer2018-04-293-14/+11
| | | | | | | | | Instead of putting direct_dma_map_ok into driver struct pass it around between functions to make the code more readable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: put only once used functions inlineSascha Hauer2018-04-291-66/+23
| | | | | | | | | | | read_page_prepare(), read_page_end() and read_page_swap_end() are trivial functions that are used only once and take 8 arguments each. De-obfuscate the code by open coding these functions in gpmi_ecc_read_page() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: pass buffer and len aroundSascha Hauer2018-04-293-26/+19
| | | | | | | | | | | Instead of putting the buffer and len passed in from the mtd core into the private data struct, just pass it around in the GPMI drivers functions. This makes the lifetime of the variables more clear and the code easier to follow. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: drop dma_ops_typeSascha Hauer2018-04-293-55/+23
| | | | | | | | | | | | The GPMI nand driver puts dma_ops_type in its private data struct. Based on the ops type the DMA callback handler unmaps previously mapped buffers. Instead of unmapping the buffers in the DMA callback handler, do this in the caller directly which waits for the DMA transfer to finish. This makes the whole dma_ops_type mechanism unnecessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: add support for specific ECC strengthStefan Agner2018-04-291-10/+20
| | | | | | | | | Add support for specified ECC strength/size using device tree properties nand-ecc-strength/nand-ecc-step-size. Signed-off-by: Stefan Agner <stefan@agner.ch> Acked-by: Han Xu <han.xu@nxp.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: use core timings instead of an empirical derivationMiquel Raynal2018-03-204-655/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GPMI driver timings derivation looks very empirical and does not use the known timings that the core wants to use with the NAND chip, by using local defined constants that have no special meaning from the outside world. Simplify the way all of this is computed and use the NAND core's SDR timings. Integrity of the reads/writes has been checked with nandbiterrs, speed improvements with flash_speed on a Freescale i.MX6 DualLite/Solo SABRE Automotive Board. Measures are below, variations of less than 150kiB/s between tests are common and then not significant. Speeds using mode 5 are the same, while speeds using mode 0 are quite improved (+40/50% from non-optimal computation). Forcing timings mode 0: ======================= Before this patch: ------------------ eraseblock write speed is 2298 KiB/s eraseblock read speed is 3636 KiB/s page write speed is 2136 KiB/s page read speed is 3316 KiB/s 2 page write speed is 2199 KiB/s 2 page read speed is 3468 KiB/s After this patch: ----------------- eraseblock write speed is 3232 KiB/s eraseblock read speed is 5663 KiB/s page write speed is 2915 KiB/s page read speed is 4904 KiB/s 2 page write speed is 3084 KiB/s 2 page read speed is 5267 KiB/s Forcing timings mode 5: ======================= Before this patch: ------------------ eraseblock write speed is 4338 KiB/s eraseblock read speed is 14883 KiB/s page write speed is 3786 KiB/s page read speed is 12800 KiB/s 2 page write speed is 4076 KiB/s 2 page read speed is 14065 KiB/s After this patch: ----------------- eraseblock write speed is 4309 KiB/s eraseblock read speed is 14712 KiB/s page write speed is 3764 KiB/s page read speed is 12673 KiB/s 2 page write speed is 4076 KiB/s 2 page read speed is 14065 KiB/s Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: gpmi: support ->setup_data_interface()Miquel Raynal2018-03-203-250/+150
| | | | | | | | | | | | | | | | | Until now the GPMI driver had its own timings logic while the core already handles that and request the NAND controller drivers to support the ->setup_data_interface() hook. Implement that hook by reusing the already existing function. No real glue is necessary between core timing delays and GPMI registers because the driver already translates the ONFI timing modes into register values. Make use of the core's tREA, tRLOH and tRHOH values that allow computing more precise timings for mode [0-3] and get significantly better values (+20% with an i.MX6 Sabre Auto board). Otherwise use the existing logic. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Han Xu <han.xu@nxp.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: prepare the removal of the ONFI parameter pageMiquel Raynal2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | The NAND chip parameter page is statically allocated within the nand_chip structure, which reserves a lot of space. Even not ONFI nor JEDEC chips have it embedded. Also, only a few parameters are actually read from the parameter page after the detection. ONFI-related parameters that will be used outside from the identification function are stored in a separate onfi_parameters structure embedded in nand_parameters, this small structure that already hold generic parameters. For now, the onfi_parameters structure is allocated statically. However, after some deep rework in the NAND framework, it will be possible to do dynamic allocations from the NAND identification phase, and this strcuture will then be dynamically allocated when needed. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: use wrappers to call onfi GET/SET_FEATURESMiquel Raynal2018-03-201-4/+2
| | | | | | | | | Prepare the fact that some features managed by GET/SET_FEATURES could be overloaded by vendor code. To handle this logic, use new wrappers instead of directly call the ->get/set_features() hooks. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: rawnand: rename SET/GET FEATURES related functionsMiquel Raynal2018-03-201-4/+4
| | | | | | | | | | SET/GET FEATURES are flagged ONFI-compliant because of their name. This is not accurate as non-ONFI NAND chips support it and use it. Rename the hooks and helpers to remove the "onfi" prefix. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
* mtd: nand: move raw NAND related code to the raw/ subdirBoris Brezillon2018-02-166-0/+4325
As part of the process of sharing more code between different NAND based devices, we need to move all raw NAND related code to the raw/ subdirectory. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
OpenPOWER on IntegriCloud