On Tue, 2020-05-19 at 07:45:43 UTC, Miquel Raynal wrote: > 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@xxxxxxxxxxxxx> > Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx> > Reviewed-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next. Miquel ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/