[PATCH] [OneNAND] OTP support re-implementation 1/1

Amul Kumar Saha amul.saha at samsung.com
Wed Sep 2 01:55:56 EDT 2009


>
> @@ -2717,16 +2927,21 @@ static int onenand_otp_walk(struct mtd_info
> *mtd, loff_t from, size_t len,
>       if (density < ONENAND_DEVICE_DENSITY_512Mb)
>               otp_pages = 20;
>       else
> -               otp_pages = 10;
> +               otp_pages = 50;
>
> Is it always 50 pages? Is it right? why I think it's 10. please check
> the previous OneNAND spec.
> At least the latest OneNAND spec say it's 50. flex or not.
>

I've checked different OneNAND specs and 50 pages have been allocated for the User Area in all of 
those.

>> +       if (FLEXONENAND(this)) {
>> +
>> +#ifdef CONFIG_ONENAND_OTP_AREA
>> +               buf[FLEXONENAND_OTP_LOCK_OFFSET] = 0xFC;
>> +#elif defined(CONFIG_ONENAND_OTP_BLOCK0)
>> +               buf[FLEXONENAND_OTP_LOCK_OFFSET] = 0xF3;
>> +#elif defined(CONFIG_ONENAND_OTP_AREA_BLOCK0)
>> +               buf[FLEXONENAND_OTP_LOCK_OFFSET] = 0xF0;
>> +#endif /* ONENAND_OTP_AREA | ONENAND_OTP_BLOCK0 | ONENAND_OTP_AREA_BLOCK0 */
>> +       } else {
>> +
>> +#ifdef CONFIG_ONENAND_OTP_AREA
>> +               buf[ONENAND_OTP_LOCK_OFFSET] = 0xFC;
>> +#elif defined(CONFIG_ONENAND_OTP_BLOCK0)
>> +               buf[ONENAND_OTP_LOCK_OFFSET] = 0xF3;
>> +#elif defined(CONFIG_ONENAND_OTP_AREA_BLOCK0)
>> +               buf[ONENAND_OTP_LOCK_OFFSET] = 0xF0;
>> +#endif /* ONENAND_OTP_AREA | ONENAND_OTP_BLOCK0 | ONENAND_OTP_AREA_BLOCK0 */
>> +       }
>> +
>
> it's too much #ifdef, #endif. Introuduce the opt_lock_offset and set
> the proper offset based on flex or not.
>
> And the set the buf[otp_lock_offset] = proper value.
>
Accepted and corrected.

Please find the patch in the following mail.

Regards,
Amul





More information about the linux-mtd mailing list