mtd: rawnand: meson: handle OOB buffer according OOB layout
In case of MTD_OPS_AUTO_OOB mode, MTD/NAND layer fills/reads OOB buffer according current OOB layout so we need to follow it in the driver. Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20231109053953.3863664-1-avkrasnov@salutedevices.com
This commit is contained in:
parent
acb1fd579e
commit
2082b6956c
@ -511,7 +511,7 @@ static void meson_nfc_set_user_byte(struct nand_chip *nand, u8 *oob_buf)
|
||||
__le64 *info;
|
||||
int i, count;
|
||||
|
||||
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) {
|
||||
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += (2 + nand->ecc.bytes)) {
|
||||
info = &meson_chip->info_buf[i];
|
||||
*info |= oob_buf[count];
|
||||
*info |= oob_buf[count + 1] << 8;
|
||||
@ -524,7 +524,7 @@ static void meson_nfc_get_user_byte(struct nand_chip *nand, u8 *oob_buf)
|
||||
__le64 *info;
|
||||
int i, count;
|
||||
|
||||
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += 2) {
|
||||
for (i = 0, count = 0; i < nand->ecc.steps; i++, count += (2 + nand->ecc.bytes)) {
|
||||
info = &meson_chip->info_buf[i];
|
||||
oob_buf[count] = *info;
|
||||
oob_buf[count + 1] = *info >> 8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user