[U-Boot] [PATCH V4 1/6] io: add and* and or* operation api to set and clear bit

Lei Wen adrian.wenl at gmail.com
Wed Mar 30 16:08:17 CEST 2011


Hi Scott,

On Wed, Mar 30, 2011 at 12:03 AM, Scott Wood <scottwood at freescale.com> wrote:
> On Tue, 29 Mar 2011 10:47:04 +0800
> Lei Wen <adrian.wenl at gmail.com> wrote:
>
>> Hi Scott,
>>
>> On Tue, Mar 29, 2011 at 12:05 AM, Scott Wood <scottwood at freescale.com> wrote:
>> > What does this do that setbits*/clrbits* don't?
>>
>> Those and*/or* include the dmb() operation included in the read*/write*, which
>> is not included in the __raw_read*/__raw_write* that setbits*/clrbits* refer to.
>> I think it's better to keep another instance to set the bit, since
>> there is read* and __raw_read*
>> exist and have difference.
>
> But why are setbits/clrbits using raw accesses?  That's not how they're
> defined on powerpc, which is where these accessors originated.  I suspect
> they were defined that way out of laziness from before ARM made a
> distinction between raw and non-raw accessors, and it is now a bug in
> setbits/clrbits (and out_be*, in_le*, etc) which should be fixed rather
> than introducing an alternative.
>
> And then if you want a raw version of these functions, introduce
> raw_setbits_le32, raw_in_le16, etc.
>


Yep, that make sense to me. But since this patch is tend to be more discussion.
I'm going to remove this change out of this patch set, and post seperately.
Meanwhile, just use the writel(readl* style in this patch set for current stage.

Best regards,
Lei


More information about the U-Boot mailing list