hc
2023-11-06 9df731a176aab8e03b984b681b1bea01ccff6644
u-boot/drivers/mtd/nand/spi/unim.c
....@@ -71,12 +71,13 @@
7171 static int tx25g01_ecc_get_status(struct spinand_device *spinand,
7272 u8 status)
7373 {
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;
7576
76
- if (eccsr <= 7)
77
+ if (eccsr < 4)
7778 return eccsr;
78
- else if (eccsr == 12)
79
- return 8;
79
+ else if (eccsr == 4)
80
+ return nand->eccreq.strength;
8081 else
8182 return -EBADMSG;
8283 }