u-boot/drivers/mtd/nand/spi/unim.c
.. .. @@ -71,12 +71,13 @@ 71 71 static int tx25g01_ecc_get_status(struct spinand_device *spinand, 72 72 u8 status) 73 73 { 74 - u8 eccsr = (status & GENMASK(6, 4)) >> 2;74 + struct nand_device *nand = spinand_to_nand(spinand);75 + u8 eccsr = (status & GENMASK(6, 4)) >> 4;75 76 76 - if (eccsr <= 7)77 + if (eccsr < 4)77 78 return eccsr; 78 - else if (eccsr == 12)79 - return 8;79 + else if (eccsr == 4)80 + return nand->eccreq.strength;80 81 else 81 82 return -EBADMSG; 82 83 }