linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* rearrangements in linuxppc_2_4_devel
@ 2001-06-27  6:46 Paul Mackerras
  2001-06-27 11:51 ` Adrian Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2001-06-27  6:46 UTC (permalink / raw)
  To: linuxppc-commit, linuxppc-dev


I just checked in a change into linuxppc_2_4_devel that changes the
way we deal with the large and increasing variety of platforms that
PPC/Linux supports.  The aim with these changes is to reduce the
number of places where we have to change stuff to add support for a
new platform.

When I say "platform" I'm talking about a class of machines that can
all run a single vmlinux binary.  So the CONFIG_ALL_PPC machines count
as a single platform, and each of the choices under the various
'Machine type' questions also count as a platform.

The first change is to make each platform export a procedure called
platform_init.  This is called from machine_init (which used to be
called identify_machine) early on.  So for example I renamed
m8xx_setup to platform_setup.  That removed a whole pile of #ifdefs in
setup.c.

The second change is to make MMU_init call a platform-specific
function to set up any I/O mappings that the platform needs, namely
ppc_md.setup_io_mappings().  This will typically call
io_block_mapping(), which is like setbat except that it will add ptes
instead of setting a BAT if there is no BAT available.  I have moved
the code from MMU_init into the various xxx_setup.c files and made it
call io_block_mapping instead of setbat or ioremap.

That means that ioremap now doesn't need to do virtual = physical
mappings any more AFAICS.  If there are other places where you call
ioremap and you need virtual == physical, please either change the
code so it doesn't assume that or else use io_block_mapping.

The next thing I would like to do, which I haven't done yet, is to
avoid the need to have a separate _MACH_xxx define for each platform.
I would see _machine as distinguishing between different types of
machine that count as a single platform, rather than distinguishing
between platforms.  (We distinguish between platforms by their config
options.)  Thus I don't see any need for anything more than
_MACH_prep, _MACH_Pmac and _MACH_chrp.

With those changes, I think that adding a new platform should only
require adding stuff to arch/ppc/config.in, arch/ppc/kernel/Makefile,
and adding a new xxx_setup.c file.

Comments?

Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-06-27 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-27  6:46 rearrangements in linuxppc_2_4_devel Paul Mackerras
2001-06-27 11:51 ` Adrian Cox
2001-06-27 12:43   ` Paul Mackerras
2001-06-27 13:52     ` Adrian Cox
2001-06-27 22:00       ` Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).