
Some comments about what I'm doing to the PPCBoot / ARMBoot sources,
and why:
====================================================================

The major cause for starting a reorganization of the PPCBoot code is
the fact that the PPC and ARM versions of this bootloader stated
diverging more and more; other ports already exist (like for the
Coldfire) or are in the planning (like for x86).

Making the code less architecture-dependend was one issue, making it
more flexible at the same time another one.

For example, it turned out that the sequence in which certain
initialization steps are performed often depends on the hardware
architecture of the board: some boards must initialize par A first
before they can access part B, while other boards need to have part B
working first. You all know the result: a mess of #ifdef's which is
nearly impossible to understand.

I had to solve the following problems with the current code:

* As it happens when things get added step by step, without prior
  design, the functions which were called to perform certain
  initialization steps were all different: parameters and return
  values were extremely inconsistent.

* The "bord info" data structure (bd_t), once borrowed from the Linux
  kernel code as the interface to be used to pass board information
  from the bootloader to the Linux kernel, more and more degraded
  into a garbage dump for any global data which needed to be passed
  around.


I attacked these problems first - the solution in not finalized yet,
but I felt it was changes enough to get some of the code running
first before cleaning it up.

What I did:

* I created a new data structure for global data (gd_t), which
  replaces what once used to be "initial data" (init_data_t). I tried
  to add only those stuff which was really needed there - with the
  exception that I included a pointer to the old, now mostly
  obsolete, bd_t structure.

  As soon as the C environment has been set up, a gd_t structure gets
  initialized, and is passed as global register variable (see
  gcc.info, Node: Global Reg Vars) to _all_ functions. All fields
  start initialized as zero, and it is up to the initialization
  sequence to fill them in as needed.

  Also, all init functions now return an interger  return  code  with
  the very simple meaning: 0 = continue, != 0 : fatal error, halt the
  system.

* This allows to initialize an array of function pointers, and simply
  run all these functions in sequence. Changing the order, or adding
  new functions now only needs modifications to this array.

  The idea is to allow for each architecture, or even each board (at
  least the more exotic ones) to provide it's own list of initializa-
  tion functions, which - for example - can be #defined in the
  architecture's or the board's config file.
  
  



At the moment, the code is compile-clean for all PowerPC systems, and
actually running on one or two.
