[PATCH] mtd: spinand: Add support for XTX XT26xxxDxxxxx

Miquel Raynal miquel.raynal at bootlin.com
Wed Oct 11 00:09:48 PDT 2023


Hi Bruce,

> "ECCS3/ECCS2/ECCS1/ECCS0 provides ECC Status as follows:
> XX00b= No bit errors were detected during the previous read algorithm.
> 0001b= Bit errors(≤4) were detected and corrected.
> 0101b= Bit errors(=5) were detected and corrected.
> 1001b= Bit errors(=6) were detected and corrected.
> 1101b= Bit errors(=7) were detected and corrected.
> XX10b= Bit errors greater than ECC capability (8 bits) and not corrected
> XX11b= Bit errors reach ECC capability (8 bits) and corrected"

Nice

> 
> ECCS1,ECCS0 = 00: No bit errors
> ECCS1,ECCS0 = 10: bit errors > 8
> ECCS1,ECCS0 = 11: bit errors = 8
> ECCS1,ECCS0 = 01: 1<=bit errors<=7
> 
> so I use 4 cases to represent it.
> 
> for ECCS1,ECCS0 = 11, bitfilps can be subdivided by ECCS3 ECCS2:
> 
> ECCS3 ECCS2 = 00: bitfip<=4=4+0, I return 4 for this;
> ECCS3 ECCS2 = 01: bitfip=5=4+1, I return 5 for this;
> ECCS3 ECCS2 = 10: bitfip=6=4+2, I return 6 for this;
> ECCS3 ECCS2 = 11: bitfip=7=4+3, I return 7 for this;

Please use FIELD_GET() and create macros to clarify what you are
looking at. Please include all values.

> so,I use "4+((status & XT26XXXD_STATUS_ECC_MASK) >> 6)" to represent it.
> 
> >
> > Also please run checkpatch.pl --strict.  
> I run checkpatch.pl without --strict,there are no checks.
> I run checkpatch.pl --strict,there are 5 checks.
> I'm sorry for that,I will fix it in next version of patch.
> >> +	case XT26XXXD_STATUS_ECC_8_CORRECTED:
> >> +		return 8;
> >> +	default:
> >> +		break;
> >> +	}
> >> +
> >> +	return -EINVAL;
> >> +}

Thanks,
Miquèl



More information about the linux-mtd mailing list