[U-Boot] [PATCH 1/4] gpio: Adds GPIO driver support for Armada100
Lei Wen
adrian.wenl at gmail.com
Wed Jul 20 12:08:47 CEST 2011
Hi Ajay,
On Wed, Jul 20, 2011 at 2:36 PM, Ajay Bhargav
<ajay.bhargav at einfochips.com> wrote:
> Dear Wolfgang,
>
>>
>> Is there any specific reason for not using u32 for the padding as
>> well?
>>
> nothing specific. It makes easy to find number of bytes than words.
>
>>
>> Why would you need this BASE + OFFSET notation when using a C struct
>> for the registers? Thi smakes little sense to me.
>>
>
> Well I did use the C struct method, if you see my patches submitted earlier
> but according to Prafulla and Lie structure size is too big. so they want me
> to use a mix of C struct and BASE + OFFSET notation. so I thought to break the big
> C struct into smaller grouped structures pointing each group with GPIO base + group
> offset. I would be glad if you can suggest me something better or smarter.
>
I think we make thing complicated here. For GPIO driver, the only
structure we need to
define is the GPIO register itself, like GPIO_PLR, GPIO_PDR, etc...
For the previous long huge structure and include your recent short
version is still not good
enough. What we want to get is the base address, and based on the
register structure
to do explicit work. So either get the base address based on MACRO, or
get from a function
I think both should be ok for me. But please not continue work on how
to define the base
address into a structure.
Best regards,
Lei
More information about the U-Boot
mailing list