summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/ecc-sw-bch.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* mtd: nand: ecc-bch: Use the public nsteps fieldMiquel Raynal2021-03-111-5/+4
| | | | | | | | | | | | The software BCH ECC engine stores the nsteps variable in its own private structure while it is also exported as a public ECC field. Let's get rid of the redundant private one and let's use the nand_ecc_context structure when possible. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Adam Ford <aford173@gmail.com> #logicpd Torpedo Link: https://lore.kernel.org/linux-mtd/20210127203020.9574-9-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Populate the public nsteps fieldMiquel Raynal2021-03-111-0/+1
| | | | | | | | | Advertize the actual number of steps that will actually be used by the driver by populating the public field. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Adam Ford <aford173@gmail.com> #logicpd Torpedo Link: https://lore.kernel.org/linux-mtd/20210127203020.9574-3-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Create the software BCH engineMiquel Raynal2020-12-101-63/+270
| | | | | | | | | | | | | | Let's continue introducing the generic ECC engine abstraction in the NAND subsystem by instantiating a first ECC engine: the software BCH one. While at it, make a very tidy ecc_sw_bch_init() function and move all the sanity checks and user input management in nand_ecc_sw_bch_init_ctx(). This second helper will be called from the raw RAND core. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-10-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Stop using raw NAND structuresMiquel Raynal2020-11-301-74/+40
| | | | | | | | | | This code is meant to be reused by the SPI-NAND core. Now that the driver has been cleaned and reorganized, use a generic ECC engine object to store the driver's data instead of accessing members of the nand_chip structure. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-9-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Update the prototypes to be more genericMiquel Raynal2020-11-301-20/+27
| | | | | | | | | | | | | | These functions must be usable by the main NAND core, so their names must be technology-agnostic as well as the parameters. Hence, we pass a generic nand_device instead of a raw nand_chip structure. As it seems that changing the raw NAND functions to always pass a generic NAND device is a lost of time, we prefer to create dedicated raw NAND wrappers that will be useful in the near future to do the translation. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-8-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Stop exporting the private structureMiquel Raynal2020-11-301-17/+21
| | | | | | | | | | The NAND BCH control structure has nothing to do outside of this driver, all users of the nand_bch_init/free() functions just save it to chip->ecc.priv so do it in this driver directly and return a regular error code instead. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-5-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Cleanup and style fixesMiquel Raynal2020-11-301-26/+29
| | | | | | | | | | Fix function headers, capitals and reword a little bit the comments to make this driver more readable. There is not functional change. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-4-miquel.raynal@bootlin.com
* mtd: nand: ecc-bch: Move BCH code to the generic NAND layerMiquel Raynal2020-11-301-0/+219
BCH ECC code might be later re-used by the SPI NAND layer. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20200929230124.31491-3-miquel.raynal@bootlin.com