public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] RFC: Aligning arch initialisation sequences
Date: Sun, 07 Nov 2010 21:06:26 +1100	[thread overview]
Message-ID: <4CD67A22.9040802@gmail.com> (raw)

Hi All,

I've been looking at how x86 does things compared to other arches, and it
seems to have one big difference - Very little is initialised prior to
relocation. The general order for x86 is:

 - ultra-low level board initialisation
 - DRAM controller initialisation
 - DRAM sizing
 - low-level board initialisation
 - Relocation
 - init_sequence[] (including timers, serial console

Now ARM, m68k and PPC all call relocate_code well after init_sequence[]

Now I'm wondering if I should change x86 to align with these other arch's.
I think it can be done, but there are a few technicalities that make it a
non-trival task. Two big problems I foresee are timers and the global data
pointer.

Timers for x86 use interrupts which use function hooks for the interrupt
handlers - I can change all the call-back functions to use global data, and
I will have to 're-hook' the call-back functions after relocation.

The global data pointer is worse - x86 does not have a spare register to
effectively use as a global variable. I would have to do all sorts of
trickery probably involving putting the global data pointer at the very top
of the stack segment and doing some very fancy shuffling of registers which
will make global data suffer a pretty severe performance hit.

On the other hand, if I leave things the way they are, there is beauty to
be uncovered in board_init_r() - At the moment, board_init_r() consists of
the init_sequence[] loop, followed by a whole raft of function calls
wrapped around #idefs. That whole mess could all be converted to a unified
init_sequence[]. Along with current discussions on weak functions, I think
this might be a cleaner solution.

So the question is, what does everyone think I should do?
Should all architectures strive to look as much like one another as possible?
Should we accept that maybe this particular issue be thrown in the too hard
basket?

Regards,

Graeme

             reply	other threads:[~2010-11-07 10:06 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-07 10:06 Graeme Russ [this message]
2010-11-09 23:35 ` [U-Boot] RFC: Aligning arch initialisation sequences Mike Frysinger
2010-11-13  4:16   ` Graeme Russ
2010-11-13  4:58     ` Mike Frysinger
2010-11-13  6:31     ` Reinhard Meyer
2010-11-13  6:38       ` Reinhard Meyer
2010-11-13  9:51         ` Graeme Russ
2010-11-13  8:17       ` Wolfgang Denk
2010-11-13 21:35         ` Reinhard Meyer
2010-11-13 21:53           ` Wolfgang Denk
2010-11-13 22:38             ` Reinhard Meyer
2010-11-13 22:45               ` Wolfgang Denk
2010-11-13 22:48                 ` Reinhard Meyer
2010-11-14  0:07                   ` Wolfgang Denk
2010-11-14  0:25                     ` Graeme Russ
2010-11-14  0:35                       ` Wolfgang Denk
2010-11-14  1:09                         ` Graeme Russ
2010-11-14  9:04                           ` Wolfgang Denk
2010-11-14 10:21                             ` Graeme Russ
2010-11-14 19:43                               ` Graeme Russ
2010-11-14  4:07                         ` Reinhard Meyer
2010-11-14  9:07                           ` Wolfgang Denk
2010-11-14 13:46                           ` Reinhard Meyer
2010-11-14 19:36                             ` Graeme Russ
2010-11-14 20:16                               ` Reinhard Meyer
2010-11-14 21:01                                 ` Graeme Russ
2010-11-13  8:20     ` Albert ARIBAUD
2010-11-13 11:18       ` Graeme Russ
2010-11-14  5:10         ` Graeme Russ
2010-11-14  5:48           ` Graeme Russ
2010-11-14  9:16             ` Albert ARIBAUD
2010-11-14 10:30               ` Wolfgang Denk
2010-11-14 12:10                 ` Albert ARIBAUD
2010-11-14 15:01                   ` Wolfgang Denk
2010-11-14 17:53                     ` Albert ARIBAUD
2010-11-14 19:06                       ` Wolfgang Denk
2010-11-14 19:29                         ` Albert ARIBAUD
2010-11-14 19:55                           ` Wolfgang Denk
2010-11-14 20:10                             ` Albert ARIBAUD
2010-11-14 20:42                               ` Wolfgang Denk
2010-11-14 19:23                       ` Wolfgang Denk
2010-11-14 19:34                         ` Graeme Russ
2010-11-14 20:05                           ` Albert ARIBAUD
2010-11-14 21:27                             ` Graeme Russ
2010-11-15 11:08                             ` Graeme Russ
2010-11-14 21:51   ` Wolfgang Denk

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=4CD67A22.9040802@gmail.com \
    --to=graeme.russ@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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