[U-Boot] [PATCH v3 3/7] [REPOST-1] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs
Prafulla Wadaskar
prafulla at marvell.com
Thu Dec 2 08:18:49 CET 2010
> -----Original Message-----
> From: Lei Wen [mailto:adrian.wenl at gmail.com]
> Sent: Thursday, December 02, 2010 12:29 PM
> To: Prafulla Wadaskar
> Cc: u-boot at lists.denx.de; Eric Miao; Manas Saksena; Lei Wen; Yu Tang;
> Ashish Karkare; Kiran Vedere; Prabhanjan Sarnaik
> Subject: Re: [U-Boot] [PATCH v3 3/7] [REPOST-1] gpio: Add Multi-Function-
> Pin configuration driver for Marvell SoCs
>
> Hi Prafulla,
>
> On Thu, Dec 2, 2010 at 2:54 PM, Prafulla Wadaskar <prafulla at marvell.com>
> wrote:
> >
> >
> >> -----Original Message-----
> >> From: Lei Wen [mailto:adrian.wenl at gmail.com]
> >> Sent: Wednesday, December 01, 2010 7:51 PM
> >> To: Prafulla Wadaskar
> >> Cc: u-boot at lists.denx.de; Eric Miao; Manas Saksena; Lei Wen; Yu Tang;
> >> Ashish Karkare; Kiran Vedere; Prabhanjan Sarnaik
> >> Subject: Re: [U-Boot] [PATCH v3 3/7] [REPOST-1] gpio: Add Multi-
> Function-
> >> Pin configuration driver for Marvell SoCs
> >>
> >> Hi Prafulla,
> > ...snip...
> >> > +
> >> > + /* the offset address are divided in three regions
> and
> >> not
> >> > + * consecutive, this corrects the same (Ref: Specs:
> >> A1.1) */
> >> > + p_mfpr = (u32 *)MFPR_BASE;
> >> > + if ( mfpr_no < 37)
> >> > + p_mfpr += (0x004c / 4) + mfpr_no;
> >> > + else if ( mfpr_no >= 56)
> >> > + p_mfpr += (0x00e0 / 4) + (mfpr_no - 56);
> >> > + else
> >> > + p_mfpr += (mfpr_no - 37);
> >>
> >> This three regions is only meaningful for armada100, so when we use
> >> the mfp.c to other cpu, like pxa920,
> >> how could we reuse this setting? Obviously, pxa920 is different with
> >> armada100 regions arrangement, with
> >> the start mfp of ND_IO[15].
> >
> > Currently mfp is added for armada100, I don't know what will be diffs
> with other SoCs.
> > When other SoC will come up, we will modify this file :-)
>
> Since the mfp.c is for generic case, and should be made as generic at
> the beginning...
Sure.. but I don't know how it will be on other SoCs?
Apart from that what would be other impact?
So in my opinion, let's keep it for future updates.
With reference to your precise concern, I will create a macro in asm/arch/mfp.h moving below code there.
+ if ( mfpr_no < 37)
+ p_mfpr += (0x004c / 4) + mfpr_no;
+ else if ( mfpr_no >= 56)
+ p_mfpr += (0x00e0 / 4) + (mfpr_no - 56);
+ else
+ p_mfpr += (mfpr_no - 37)
This will help to isolate it as SoC specific implementation, I will post REPOST-2 for the same
Thanks and Regards..
Prafulla . .
More information about the U-Boot
mailing list