[U-Boot] [PATCH 1/1] ppc4xx: add support for alternate format for ndfc

Feng Kan fkan at amcc.com
Fri Feb 19 01:08:49 CET 2010


Dear Wolfgang:

The problem goes back a bit. The ordering you see in the ndfc file has been changed a
few times, back and forth and cause quite a bit of problem. The define we speak of is
in the driver/mtd/nand/nand_ecc.c file. The nand_correct_data function uses two ways
of check ECC correctness. However the ndfc calculate only supports one ordering, although
both placement method in the patch would work. It also serves to nail down the ordering
depending on the define is used or not.

There is also the following in the code, should you agree, this will also need to be removed
as well.

/* The PPC4xx NDFC uses Smart Media (SMC) bytes order */
#ifdef CONFIG_NAND_NDFC
#define CONFIG_MTD_NAND_ECC_SMC
#endif


Feng Kan

On 02/18/2010 03:13 PM, Wolfgang Denk wrote:
> Dear fkan at amcc.com,
>
> In message<1266531913-20756-1-git-send-email-fkan at amcc.com>  you wrote:
>> From: Feng Kan<fkan at amcc.com>
>>
>> This is to lock down the ordering in the correction routine against
>> the calculate routine. Otherwise, incorrect define would cause ECC errors.
>>
>> Signed-off-by: Feng Kan<fkan at amcc.com>
>> Acked-by: Victor Gallardo<vgallardo at amcc.com>
>> ---
>>   drivers/mtd/nand/ndfc.c |    6 ++++++
>>   1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
>> index 0dd6789..88e341d 100644
>> --- a/drivers/mtd/nand/ndfc.c
>> +++ b/drivers/mtd/nand/ndfc.c
>> @@ -89,9 +89,15 @@ static int ndfc_calculate_ecc(struct mtd_info *mtdinfo,
>>
>>   	/* The NDFC uses Smart Media (SMC) bytes order
>>   	 */
>> +#ifdef CONFIG_MTD_NAND_ECC_SMC
>>   	ecc_code[0] = p[1];
>>   	ecc_code[1] = p[2];
>>   	ecc_code[2] = p[3];
>> +#else
>> +	ecc_code[0] = p[2];
>> +	ecc_code[1] = p[1];
>> +	ecc_code[2] = p[3];
>> +#endif
>
> This patch seems wrong to me as CONFIG_MTD_NAND_ECC_SMC is nowhere
> defined.  [Also, it's not documented anywhere.]
>
> If this is fixing a bug, then please describe the exact problem, how
> to reproduce it, and how this patch is supposed to fix this problem.
>
> As is, this makes no sense to me.
>
>
> Best regards,
>
> Wolfgang Denk
>



More information about the U-Boot mailing list