[U-Boot] [PATCH V3 RESEND 2/4] mtd/NAND: Add FSMC driver support
Amit Virdi
amit.virdi at st.com
Thu May 17 14:19:16 CEST 2012
On 5/16/2012 10:24 PM, Scott Wood wrote:
> On 05/16/2012 07:06 AM, Amit Virdi wrote:
>> + if ((bits_ecc + bits_data)<= 8) {
>> + if (bits_data)
>> + memset(dat, 0xff, 512);
>> + return bits_data;
>
> return bits_data + bits_ecc;
>
Ok.
>> + i = 0;
>> + while (num_err--) {
>> + change_bit(0,&err_idx[i]);
>> + change_bit(1,&err_idx[i]);
>
> Where is change_bit defined? I see __change_bit in
> arch/arm/include/asm/bitops.h, but change_bit is defined as an extern
change_bit is defined in this patchset.
> prototype. In Linux change_bit (without the __) is defined as an atomic
> operation, which probably isn't appropriate here.
>
Yes, as the interrupts are not enabled in the u-boot so this has
virtually no effect. So effectively, I need to use __change_bit here.
Since __change_bit was not exported so we defined a wrapper "change_bit"
to use it. Any other suggestion?
> These two in particular could just be err_idx[i] ^= 3, right?
>
Correct. I'll take it.
>> + if (err_idx[i]< 512 * 8) {
>> + change_bit(err_idx[i], dat);
>> + i++;
>> + }
>
> Increment i unconditionally.
>
Yeah, you are correct. Thanks for your inputs.
Regards
Amit Virdi
More information about the U-Boot
mailing list