All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 01/19] Introduce generic global_data
Date: Sat, 7 Jan 2012 14:33:17 -0800	[thread overview]
Message-ID: <CAPnjgZ0H3JHkTFNRxt-TXqGhSixo+a3J2ACGSktirZqLVDNXnQ@mail.gmail.com> (raw)
In-Reply-To: <4EFC1B02.1070607@googlemail.com>

Hi Andreas,

On Wed, Dec 28, 2011 at 11:47 PM, Andreas Bie?mann
<andreas.devel@googlemail.com> wrote:
> Dear Simon,
>
> On 28.12.11 07:35, Simon Glass wrote:
>> We want to unify the global_data structure. Most fields are common across
>> architectures, but there are a fair number of SOC-specific additions. It
>> isn't clear how best to deal with these, but for now we just use #ifdef.
>

Sorry your email got a little buried this week.

> I would like to see some more 'clustering' here. Especially the timer
> stuff is implementation specific and should therefore not coded directly
> but with some pointer to the specific stuff i.e. introduce some timer_t
> which is specific for arm in general and maybe has some more
> specialization for atmel devices or what else and just save a pointer to
> that struct in gd_t like it is done with bd_t.

Actually I wonder if we should an architecture-specific structure,
something like

struct global_data {
   /* generic things first */
   ulong baud_rate;
   ulong ram_size;
   /* hopefully lots of other things that are mostly common */

   /* architecture-specific things */
   struct arch_global_data arch;
};

struct arch_global_data  can be defined in include/asm/global_data.h
before it includes include/asm-generic/global_data.h, or the other way
around might be better.

One thing I notice is that some architectures share some fields, and
others omit them.I feel we should include them at the global level if
at least 2 architectures need them. This means that the 'minimal'
architectures with hardly any fields will have quite a few unused
fields in global_data. I don't think that matters, and the use will
increase as that arch gets more functionality.

> Well maybe having a pointer here is stated critical so we could just
> insert the struct directly and let the compiler decide about the size
> (BTW this could be done with bd_t now too cause we have a pre-calculated
> size of gd_t since some time, saves some little steps when instantiating
> gd_t when running).

Yes I agree that just including the structure seems better. A pointer
is slower and we just point to a place very close anyway.

It would be nice to subsume bd_t into global_data.

> Beside that we could also introduce some more structs holding specific
> stuff i.e. console_t, reloc_t, ...
> (but yes, it should be done in a second step ...)
>
> What do you think about that?

Certainly agree for reloc and perhaps there are other cases too. It is
far too long at present. Something to think about.

For now I would prefer to do nothing on either point, since bringing
everything into one place shows up the conflicts and similarities.
Part of the purpose of the generic board effort is to minimise these,
and they are hard to spot if they are all in separate files.

But when we get through this, and find that there are things which
genuinely are specific to a single arch, then I think breaking them
out is reasonable, hopefully combined with joining global_data and
bd_t.

Regards,
Simon

>
> best regards
>
> Andreas Bie?mann

  reply	other threads:[~2012-01-07 22:33 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28  6:35 [U-Boot] [RFC PATCH 0/19] Create generic board init and move ARM and x86 to it Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 01/19] Introduce generic global_data Simon Glass
2011-12-29  7:47   ` Andreas Bießmann
2012-01-07 22:33     ` Simon Glass [this message]
2012-01-08 10:48       ` Graeme Russ
2012-01-08 18:13         ` Simon Glass
2012-01-09 11:21           ` Andreas Bießmann
2012-01-09 18:17             ` Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 02/19] Make relocation functions global Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 03/19] Add basic initcall implementation Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 04/19] define CONFIG_SYS_LEGACY_BOARD everywhere Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 05/19] Add generic post-relocation board_r.c Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 06/19] Add generic pre-relocation board_f.c Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 07/19] Add spl load feature Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 08/19] switch ARM over to generic board Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 09/19] arm: Remove unused code in board.c, global_data.h Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 10/19] Add CONFIG_SYS_SYM_OFFSETS to support offset symbols Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 11/19] x86: Remove compiler warning in sc520_timer.c Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 12/19] x86: Remove dead code in eNET Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 13/19] x86: Add processor library and relocation functions Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 14/19] Tidy up asm/generic sections.h to include x86 symbols Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 15/19] Add fields required by x86 to global_data Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 16/19] x86: Change stub example to use asm-generic/sections.h Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 17/19] x86: Add initial memory barrier macros Simon Glass
2011-12-28  6:35 ` [U-Boot] [RFC PATCH 18/19] Bring in x86 to unified board architecture Simon Glass
2011-12-28  6:36 ` [U-Boot] [RFC PATCH 19/19] x86: Remove unused board/global_data code Simon Glass
2011-12-28 17:30 ` [U-Boot] [RFC PATCH 0/19] Create generic board init and move ARM and x86 to it Wolfgang Denk
2011-12-28 18:13   ` Simon Glass
2011-12-30 15:49 ` Graeme Russ
2011-12-31  0:03   ` Wolfgang Denk
2011-12-31  2:02   ` Simon Glass
2011-12-31 11:52     ` Graeme Russ
2012-01-01 23:48       ` Simon Glass
2012-01-02 11:26         ` Graeme Russ
2012-01-02 14:46           ` Wolfgang Denk
2012-01-03  5:33             ` Simon Glass
2012-01-03  8:12               ` Wolfgang Denk
2012-01-03  9:15                 ` Graeme Russ
2012-01-03 15:55                 ` Simon Glass
2012-01-03 22:35                   ` Wolfgang Denk
2012-01-03 22:52                     ` Simon Glass
2012-01-03  5:28           ` Simon Glass
2012-01-01  1:54     ` Wolfgang Denk
2012-01-01 23:47       ` Simon Glass
2012-01-02  6:50         ` 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=CAPnjgZ0H3JHkTFNRxt-TXqGhSixo+a3J2ACGSktirZqLVDNXnQ@mail.gmail.com \
    --to=sjg@chromium.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.