[PATCH] powerpc: consolidate mpc83xx platform files
Benjamin Herrenschmidt
benh at kernel.crashing.org
Tue Dec 19 08:22:40 EST 2006
On Fri, 2006-12-15 at 12:23 -0500, Dan Malek wrote:
> On Dec 15, 2006, at 11:09 AM, Kumar Gala wrote:
>
> >
> >> + if (machine_is(mpc83xx))
> >> + of_platform_bus_probe(NULL, NULL, NULL);
> >> +
> >
> > Does this every get called, meaning does anything match machine_is
> > (mpc83xx)?
>
>
> I truly dislike this "machine_is" method. Other architectures
> do this and it becomes a real PITA. It seems to evolve
> into something that never has the proper, useful granularity.
> Surprisingly, it often ends up as a guarantee you can't boot
> common kernels on similar boards, which is what
> I suspect you are trying to achieve.
Well, machine_is(mpc83xx) is certainly wrong, it should be
machine_is(whatver_my_board_name_is). It's a way to test for a given bsp
and nothing else. It's served us well for powermac/prep/chrp though I
agree that abusing it is often a sign that something is wrong with the
design.
There is one area on which is needs right now is when a platform adds
initcalls as those will be called regardless of wether that platform was
actually selected at boot or not, though I've been thinking about a way
to add board_xxx_initcall() thingies to fix that.
In general, for better granularity, code shall test specific properties
in the device-tree exposing a given feature.
> This is a case where your board specific initialization
> should call this, or fill in a ppc_md indirect pointer that
> if set is called at the proper time.
Agreed.
Ben.
More information about the Linuxppc-dev
mailing list