Re: [PATCH v4 2/2] mtd: mediatek: driver for MTK Smart Device Gen1 NAND

Jorge Ramirez
2016-05-10T15:37:27Z

On 05/10/2016 11:13 AM, Boris Brezillon wrote:
>> >just as needed by the hardware:
>> >the config is in bits, the encoder register requires bytes, the decoder
>> >register requires bits.
>> >
> Are you sure about that? Cause it seems to me that the NAND controller
> drivers put a length in bits in ->dec_len and a length in bytes in
> ->enc_len, and then you have an extra conversion in the ECC engine
> driver code for enc_len to convert it into a value in bits.

yes you are right (was reading at the spec before to be sure but the
spec is wrong since the driver works...yes I remember now discussing
this with mediatek).
"ENC_MS: indicates the total bytes size of message block. the message
block can only be in byte unit." - yes, this line of the spec is wrong.

will fix the code to make it consistent on the config interface (both
enc_len or dec_len should be the same unit); and in fact as you also
pointed out we only need one len parameter since the decoder len can be
deduced from the encoder using the strength and the number of parity bits.

thanks!