public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] arm: add CONFIG_MACH_TYPE option and	documentation
Date: Wed, 13 Jul 2011 08:52:07 +0300	[thread overview]
Message-ID: <4E1D3287.1030407@compulab.co.il> (raw)
In-Reply-To: <4E161FD9.2050205@compulab.co.il>

Hi Albert,

On 07/08/11 00:06, Igor Grinberg wrote:
> On 07/07/11 20:46, Albert ARIBAUD wrote:
>> Le 07/07/2011 18:51, Igor Grinberg a ?crit :
>>
>>>>> If we have this option and it is documented, then any new board can use it
>>>>> instead of thinking (although it is simple) where and how to dereference
>>>>> the bi_arch_number.
>>>> Not sure I get you there. Can you elaborate on a more precise example that would show the benefits of it?
>>> For example, if you think of Christopher's patch (ARM: Warn when the machine ID isn't set.),
>>> If you need Christopher's patch, then there are cases when the machid is not set, right?
>>> When someone gets this warning, he thinks: "Ah, I forgot the machid!" and then
>>> goes to fix the code, but again he thinks, where is the best place to put it?
>>> For us, it is trivial, that it should be in board_init() function, but for newbies, it is not that trivial.
>>> With this patch, you get the explanation and also a place to put the machid definition.
>>> With this patch, you just define the configuration "variable" and the whole thing will be done for you.
>>> Another example would be the board/nvidia/*, the code is shared as much as possible,
>>> and the mach_type is set in the common code. That is something I would expect to be done
>>> for all ARM boards, not just for nvidia...
>> I see your point.
>>
>> Now the issue I foresee is that this commonalization has benefits only for boards which currently set their bi_arch_number in board_init_f(),
> Vast majority of boards set their bi_arch_number in board_init().
> I went through all the boards and there is only one that set it in board_early_init_f()
> and several that do this in checkboard().
>
> This makes me think of v2 of this patch which will set the bi_arch_number in board_init_f()
> just before the init_sequence[] array is run.
>
>> but has no incentive -- that's a code that will be used only in a few places and could stay that way for quite long, because boards that will not adhere to it will still build unchanged.
> Well, I don't like to force people do something by breaking their builds...
> In general, I think that any change should not break any existing code (at least not on purpose).
> At least, this is how it works in Linux.
>
>> IOW, there is no benefit for e.g. ED Mini V2, to use CONFIG_MACH_TYPE, so why would it? Thus instead of simplifying and commonalizing, this feature will *add* to the code base complexity.
>>
>> Unless the goal is to add this macro *and* change all related board codes in the same patchset? I don't see it as feasible either.
> Well, I can do the change board/* wide, but it will take some time to accomplish.
> Also, we still don't have an exact list of boards for removal, so I'd like to wait until
> the removal takes place, so there will be less boards to consider.
>
>> Any suggestion for ensuring adoption of the feature wherever it can be used?
> Currently, I can think of:
> 1) Changing all relevant boards to use it - will eliminate "bad" examples.
> 2) Pointing to the use of CONFIG_MACH_TYPE during code review.
> 3) Introduce one more config option, like CONFIG_DYNAMIC_MACH_TYPE
> and change the patch to something like:
> #ifndef CONFIG_DYNAMIC_MACH_TYPE
> bi_arch_number = CONFIG_MACH_TYPE;
> #endif
>
> If we decide to go for 3), it would integrate nicely with Christopher's patch.

So, what will it be?
If it will be 1 and 2, then I'd like to get this patch in, so I can start working on 1.

If it will be 3, then I want to make the change and resubmit,
hoping for current merge window...



-- 
Regards,
Igor.

  reply	other threads:[~2011-07-13  5:52 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04  9:00 [U-Boot] [PATCH 1/3] arm: add CONFIG_MACH_TYPE option and documentation Igor Grinberg
2011-07-04  9:00 ` [U-Boot] [PATCH 2/3] arm: nvidia and smdk6400: use common code for machine type Igor Grinberg
2011-07-04  9:00 ` [U-Boot] [PATCH 3/3] arm: omap: innovator: " Igor Grinberg
2011-07-04 21:06 ` [U-Boot] [PATCH 1/3] arm: add CONFIG_MACH_TYPE option and documentation Christopher Harvey
2011-07-04 22:03   ` Albert ARIBAUD
2011-07-04 22:03     ` Albert ARIBAUD
2011-07-04 22:16   ` Wolfgang Denk
2011-07-05 14:08     ` charvey at matrox.com
2011-07-05 15:12       ` Igor Grinberg
2011-07-05  7:10   ` Igor Grinberg
2011-07-06 18:53 ` Albert ARIBAUD
2011-07-06 20:05   ` Igor Grinberg
2011-07-07 16:07     ` Albert ARIBAUD
2011-07-07 16:51       ` Igor Grinberg
2011-07-07 17:46         ` Albert ARIBAUD
2011-07-07 21:06           ` Igor Grinberg
2011-07-13  5:52             ` Igor Grinberg [this message]
2011-07-14 14:10               ` Albert ARIBAUD
2011-07-14 14:20                 ` Albert ARIBAUD
2011-07-14 14:57                   ` Igor Grinberg
2011-07-14 15:45                     ` [U-Boot] [PATCH v2 1/3] arm: add CONFIG_MACH_TYPE setting " Igor Grinberg
2011-07-17  6:56                       ` Igor Grinberg
2011-07-17  9:10                         ` Albert ARIBAUD
2011-07-17  9:08                       ` Albert ARIBAUD
2011-07-27 10:31                       ` Chander Kashyap
2011-07-27 13:04                         ` Igor Grinberg
2011-07-28  6:41                           ` Chander Kashyap
2011-07-28  7:59                             ` Igor Grinberg
2011-07-28  8:19                               ` Chander Kashyap
2011-07-28  8:58                                 ` Igor Grinberg
2011-08-04 12:05                                   ` Albert ARIBAUD
2011-08-11  4:16                                     ` Chander Kashyap

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=4E1D3287.1030407@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --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