Subject: Re: [PATCH 4/5] [POWERPC] QE: implement support for the GPIO LIB API

From: Anton Vorontsov <[email-masked]>
Date: Tue, 22 Apr 2008 01:33:49 +0400

On Mon, Apr 21, 2008 at 01:01:12PM -0700, David Brownell wrote:
> On Monday 21 April 2008, Anton Vorontsov wrote:
> >  From: J. Random Hacker
> >  Subject: [POWERPC] cleanup board initialization code
> > 
> >  This patch removes vast amount of machine_arch_initcall()s that were
> >  used to solely initialize some hardware, like this:
> > 
> >  qe_add_gpio_chips();
> >  fsl_gtm_init();
> >  fsl_spi_init();
> >  ...
> > 
> >  So, instead of calling this stuff from the board files, we implement
> >  own arch_initcalls for these functions.
> 
> The way other platforms do this is to hav SOC-specific
> init code, and have board-specific initcalls call the
> relevant SOC-specific setup.

I don't know about other platforms other than PowerPC and some ARM,
of course. For example, PXA boards don't call any SOC specific code.
Instead, looking into reworked PXA code, I can see that there are
separate arch_initcalls() for the pxa25x, pxa27x, and pxa3xx SOCs.
The same for s3cxxxx. So, at least not every platform out there doing
this.

Yes, I can see AVR32. But there are only two boards, and when you'll
have more, probably later you'd want to eliminate some repetitive
code, if possible.

Here, with OF, it's quite simple because we have methods of "probing" SOC
devices instead of placing init code into board files (think arch/ppc/).

> Among other things that facilitates kernels that handle
> multiple SOCs (if they're closely-enough related).  That
> may not be used by many distros (handhelds.org being at
> least a partial exception), but it certainly helps cut
> the number of configurations that need build-testing.

Is this about QE_GPIO being user-selectable? Yes, verbose Konfig option
have its own drawbacks. Though, I don't actually have any objections
for making it silent.

And well, I'm not objecting for placing qe gpio code under arch/, too.
I'll resend this patch once again reverting its placement to arch/.

-- 
Anton Vorontsov
email: [email-masked]
irc://irc.freenode.net/bd2