public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] i.MX6: nitrogen6x/sabrelite: override set_board_name()
Date: Tue, 19 Nov 2013 10:02:59 +0100	[thread overview]
Message-ID: <528B2943.1050804@denx.de> (raw)
In-Reply-To: <528ADD95.3050205@boundarydevices.com>

Hi Eric,

On 19/11/2013 04:40, Eric Nelson wrote:

>> I have a major question: if it is possible to detect at runtime, as you
>> have already implemented, which is the board where code is running, why
>> is it possible to override it for the operator ?
>>
> First off, I want to clarify things. There are two levels of override
> possible here:
>     - weak functions can be over-ridden by board files
>     - environment variables can be overridden through saveenv()
> 
> The first is to allow auto-detection of a "board" as shown in
> nitrogen6x.c. I assume you're okay with that bit.

Right.

>> I agree that forcing environment variables inside code is bad, but
>> in this case it is a hardware related stuff. It is like to the
>> processor type or the serial-id of the processor (variable dieid#
>> on OMAP). Overriding seems weird.
>>
> There is a reason for this, and it mostly involves custom pin-muxing.
> 
> All of our boards support a wide variety of peripherals, and we make
> assumptions about what the various connectors will be used for.
> 
> For instance, we define a particular connector for use as a parallel
> (RGB) display.
> 
> Lots of customers have other needs though, and through the magic of
> pin-muxing, they build their own "board" files in the kernel and
> use the parallel display pins for connecting SPI devices or additional
> I2C or RS-232 pins. Or simply as GPIOs.
> 
> The easiest, most maintainable way to do that is by cloning our board
> files and editing the pin muxes.
> 
> With the addition of device tree support, this becomes even easier.
> 
> So is it a different board? Maybe not, but it's useful to name things
> differently in the kernel tree so you can easily perform a diff
> against the original or boot to the original DTB for comparison.
> 
> SOM customers blur the lines even further, and it's not uncommon
> for someone to boot a different carrier with our stock U-Boot if
> the changes are minor or their needs are modest.

ok, understood, thanks for clarification.

> 
> Re-reading the patch, it seems that there's no good reason to have
> set_imx_type(void) declared __weak.

Agree.

Best regards,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2013-11-19  9:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17 17:17 [U-Boot] [PATCH V3 0/5] imx: Define common routines to set cpu and board environment variables Eric Nelson
2013-11-17 17:17 ` [U-Boot] [PATCH V3 1/5] i.MX5x: define cpu_type() to return processor portion of cpu rev Eric Nelson
2013-11-17 19:24   ` Marek Vasut
2013-11-18 10:42   ` Stefano Babic
2013-11-19  3:25     ` Eric Nelson
2013-11-19  9:12       ` Stefano Babic
2013-11-17 17:17 ` [U-Boot] [PATCH 2/5] imx: Define common routines to set cpu and board environment variables Eric Nelson
2013-11-17 17:17 ` [U-Boot] [PATCH 3/5] i.MX6: nitrogen6x/sabrelite: override set_board_name() Eric Nelson
2013-11-18 10:57   ` Stefano Babic
2013-11-19  3:40     ` Eric Nelson
2013-11-19  9:02       ` Stefano Babic [this message]
2013-11-17 17:17 ` [U-Boot] [PATCH 4/5] i.MX6: nitrogen6x/sabrelite: initialize imx_type and board_name values Eric Nelson
2013-11-17 17:17 ` [U-Boot] [PATCH 5/5] i.MX6: mx6*sabre*: " Eric Nelson

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=528B2943.1050804@denx.de \
    --to=sbabic@denx.de \
    --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