linux/drivers/mtd/devices
Miquel Raynal 1759279ad1 lib/bch: Allow easy bit swapping
It seems that several hardware ECC engine use a swapped representation
of bytes compared to software. This might having to do with how the
ECC engine is wired to the NAND controller or the order the bits are
passed to the hardware BCH logic.

This means that when the software BCH engine is working in conjunction
with data generated with hardware, sometimes we might need to swap the
bits inside bytes, eg:

    0x0A = b0000_1010 -> b0101_0000 = 0x50

Make it possible by adding a boolean to the BCH initialization routine.

Regarding the implementation itself, this is a rather simple approach
that can probably be enhanced in the future by preparing the
->a_{mod,pow}_tab tables with the swapping in mind.

Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200519074549.23673-3-miquel.raynal@bootlin.com
2020-05-24 20:48:11 +02:00
..
bcm47xxsflash.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
bcm47xxsflash.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
block2mtd.c mtd: Convert fallthrough comments into statements 2020-03-30 10:14:54 +02:00
docg3.c lib/bch: Allow easy bit swapping 2020-05-24 20:48:11 +02:00
docg3.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Kconfig mtd: spi-nor: Move m25p80 code in spi-nor.c 2019-08-12 10:54:12 +03:00
lart.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00
Makefile mtd: spi-nor: Move m25p80 code in spi-nor.c 2019-08-12 10:54:12 +03:00
mchp23k256.c mtd: devices: fix mchp23k256 read and write 2019-11-14 10:58:03 +01:00
ms02-nv.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ms02-nv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mtd_dataflash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
mtdram.c mtd: mtdram: Expose module parameters 2019-01-08 12:42:57 +01:00
phram.c mtd: Convert fallthrough comments into statements 2020-03-30 10:14:54 +02:00
pmc551.c mtd: pmc551: Remove set but not used variable 'soff_lo' 2019-09-15 23:51:07 +02:00
powernv_flash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
serial_flash_cmds.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00
slram.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
spear_smi.c mtd: spear_smi: Fix Write Burst mode 2019-10-29 14:24:55 +01:00
sst25l.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 420 2019-06-05 17:37:15 +02:00
st_spi_fsm.c mtd: st_spi_fsm: remove unused field from struct stfsm 2019-10-08 19:22:03 +02:00