All of lore.kernel.org
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] A bit about board.c, board.c
Date: Fri, 28 Oct 2011 20:09:10 +0200	[thread overview]
Message-ID: <4EAAEFC6.7050805@aribaud.net> (raw)
In-Reply-To: <CAPnjgZ3ZdkF-dnLnC8=L55ZDWznWW6wqu0eJ7puTAT=3rcMcPQ@mail.gmail.com>

Hi Simon,

Le 22/10/2011 18:40, Simon Glass a ?crit :
> Hi Albert,
>
> On Sat, Oct 22, 2011 at 12:17 AM, Albert ARIBAUD
> <albert.u.boot@aribaud.net>  wrote:
>> Le 22/10/2011 07:11, Simon Glass a ?crit :
>>>
>>> Hi,
>>>
>>> Each architecture has its own board.c but they are mostly quite similar.
>>>
>>> New features such as fdt, boot timing, trace, profiling, etc. must be
>>> done separately for each arch, even if there are no
>>> architecture-specific bits.
>>>
>>> What would you say to adding something like lib/board.c which is a
>>> simplified cleaned-up copy of one of the existing board.c files, and a
>>> CONFIG_ARCH_GENERIC_BOARD option to select that in preference to the
>>> architecture-specific one. Then perhaps people could try it out and we
>>> could slowly move to it over time...
>>
>> I'd say anything that factorizes ARM code is a good thing. :)
>>
>> However I'm not in favor of a CONFIG option that would force the board code
>> to provide some functions just in odrer to override one, not if weak
>
> My suggestion was:
>
> CONFIG_ARCH_GENERIC_BOARD - you get lib/board.c
> not CONFIG_ARCH_GENERIC_BOARD - you get arch/xxx/lib/board.c
>
>> definitions can do a finer job. I am looking into that already for cache
>> management function specialization, and it seems like there is the same kind
>> of possibility here, with lib functions defined weak and the board code
>> overriding the ones it deems necessary to.
>
> ok. Just one little point. Weak symbols are the punishment our C++
> overlords gave us for not having to understand what code is executed
> when we instantiate a C++ subclass. It is nice to know what code is
> being linked in and avoid having to disassemble to find out. I think
> using weak symbols to avoid a OBJS-$(CONFIG_ARCH_GENERIC_BOARD) in a
> couple of Makefiles risks going too far.

The problem I see with a config option is that it is all-or-nothing: 
either all cache functions are defined at the lib level, or none is. I 
want a finer-grain, function-by-function, approach. For the moment I 
think weak symbols are a nice solution, although I do recognize that it 
will be less visible than configuration options.

> Regards,
> Simon

Amicalement,
-- 
Albert.

  parent reply	other threads:[~2011-10-28 18:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-22  5:11 [U-Boot] A bit about board.c, board.c Simon Glass
2011-10-22  7:17 ` Albert ARIBAUD
2011-10-22 16:40   ` Simon Glass
2011-10-23  8:14     ` Wolfgang Denk
2011-11-16  6:45       ` Simon Glass
2011-10-28 18:09     ` Albert ARIBAUD [this message]
     [not found] ` <CALButCLfLekoJzsnnL_pmxgBERQYdGJFCrhjvsWNvn4_9H_fDw@mail.gmail.com>
     [not found]   ` <CAPnjgZ2AeXwhR+hAN9UGL1USuvCTtNHjJrXd-cyYRwm_zum6uw@mail.gmail.com>
2011-10-22 21:41     ` Graeme Russ
2011-10-22 21:52       ` Graeme Russ

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=4EAAEFC6.7050805@aribaud.net \
    --to=albert.u.boot@aribaud.net \
    --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.