linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Sébastien Chrétien" <sebastien.chretien.enseirb@gmail.com>
Cc: Linuxppc-dev@ozlabs.org
Subject: Re: [MPC7448] machdep_calls
Date: Tue, 19 Aug 2008 07:11:14 +1000	[thread overview]
Message-ID: <1219093874.28339.63.camel@pasglop> (raw)
In-Reply-To: <319b0ac50808180435o4a8e5bebr79f86e17ba2fb9af@mail.gmail.com>

On Mon, 2008-08-18 at 13:35 +0200, Sébastien Chrétien wrote:
> Can somebody explain me the aim of the function  "setup_arch" in the
> machine_call structure ?

This is where most of your arch code gets a chance to initialize before
most of the core is.

The generic core linux code calls the architecture setup_arch() very
early during boot, before most other initializations. The powerpc
architecture code performs various early initialisations there, on
32-bit that includes unflattening the device-tree, looking for legacy
serial ports, etc... and initializing bootmem.

It then calls ppc_md.setup_arch to give the platform a chance to perform
other platform specific early initializations before the rest of the
kernel starts initializing.

This is very early, ie, for memory allocation you can only use bootmem
for example. Interrupts haven't been initialized or switched on yet,
etc...

This is typically the place where your arch code will setup it's SMP ops
if any, will discover the fixed PCI host bridges, and initialize low
level HW components that need early initialization.

Ben.

> 2008/8/18, Sébastien Chrétien <sebastien.chretien.enseirb@gmail.com>:
>         Ok I am going to copy some examples.
>         
>         2008/8/18, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
>                 On Mon, 2008-08-18 at 10:45 +0200, Sébastien Chrétien
>                 wrote:
>                 > Hello,
>                 >
>                 > I am developping a Linux for my PPC Board. I must
>                 write a
>                 > define_machine structure (marchdep_calls). Where can
>                 I find some
>                 > Information about functions of this structure ?
>                 
>                 
>                 It isn't well documented unfortunately. Best is to
>                 look at what others
>                 do... and then find your way through.
>                 
>                 I agree somebody should write dome doco one day ... in
>                 the meantime,
>                 feel free to ask questions here.
>                 
>                 Cheers,
>                 Ben.
>                 
>                 
>         
> 

      parent reply	other threads:[~2008-08-18 21:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-18  8:45 [MPC7448] machdep_calls Sébastien Chrétien
2008-08-18  9:27 ` Benjamin Herrenschmidt
2008-08-18 11:22   ` Sébastien Chrétien
2008-08-18 11:35     ` Sébastien Chrétien
2008-08-18 12:20       ` Michael Ellerman
2008-08-18 14:17         ` Sébastien Chrétien
2008-08-18 21:39           ` Benjamin Herrenschmidt
2008-08-19  7:00             ` Sébastien Chrétien
2008-08-19  7:27               ` Benjamin Herrenschmidt
2008-08-19  9:23                 ` Sébastien Chrétien
2008-08-18 21:11       ` Benjamin Herrenschmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1219093874.28339.63.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=Linuxppc-dev@ozlabs.org \
    --cc=sebastien.chretien.enseirb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).