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 v2 7/8] imx: mx6qpsabreauto: Add MX6QP SABREAUTO CPU3 board support
Date: Mon, 29 Jun 2015 09:26:10 +0200	[thread overview]
Message-ID: <5590F312.4070205@denx.de> (raw)
In-Reply-To: <20150629020500.GB13677@shlinux2>

Hi Peng,

On 29/06/2015 04:05, Peng Fan wrote:

>> To be sure I have not misunderstood the other patches: this is ok and
>> this is what I am expecting. Code checks the SOC and provides a
>> different action for QP or Quad or..
>>
>> But if some parts are defined at compile time, the check is losing its
>> original meaning and the behavior is already defined at build time.
> 
> is_mx6dqp is runtime checking, it's behavior is not defined at build time.
> There are some places which has the macro, #ifdef CONFIG_MX6QP, but all in
> header files, not in xx.c files.

Exactly, this is what I mean - here there is a runtime check, but this
can be vanified by some #ifdef in header.

>> The same here
> 
> Since this is board header files, different SOCs needs different dtbs.
> The behavior is defined at build time.

You're wrong. We accepted some code to detect at runtime which is the
correct DTB to be selected. In fact, one goal is to have a single kernel
as image, using the correct DTB to select the hardware.

This work if we have the same U-Boot is running on different SOC
variants. If U-Boot is hardcoded, why do we need to detect the right DTB
? It could be also hard-coded.

> I think it is not good to add
> such piece of code in board file:
> int board_late_init()
> {
> 	if (is_mx6dqp())
> 		setenv(fdt_file, "imx6qp-sabreauto.dtb") /* Just an example */

It must be checked if fdt_file is already set, because the customer can
decide to use its own, but well, yes, this is done by other boards -
check in code.

> }
> So I prefer to use "#if defined CONFIG_MX6QP" in board header file.

There is an important goal: having a single U-Boot image running on
boards that can have different (pin compatible) SOCs. We get this
managing the different layout of the IOMUXC, that was maybe the most
difficult part - why do we go back when we can't ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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:[~2015-06-29  7:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11 10:30 [U-Boot] [PATCH v2 1/8] imx: mx6 correct is_soc_rev usage Peng Fan
2015-06-11 10:30 ` [U-Boot] [PATCH v2 2/8] imx: mx6 correct get_cpu_rev Peng Fan
2015-06-27 16:22   ` Stefano Babic
2015-06-11 10:30 ` [U-Boot] [PATCH v2 3/8] imx: mx6 introuduce macro is_mx6dqp Peng Fan
2015-06-27 16:22   ` Stefano Babic
2015-06-11 10:30 ` [U-Boot] [PATCH v2 4/8] imx: mx6: ccm: Change the clock settings for i.MX6QP Peng Fan
2015-06-27 16:44   ` Stefano Babic
2015-06-29  1:50     ` Peng Fan
2015-06-11 10:30 ` [U-Boot] [PATCH v2 5/8] imx: mx6: hab : Remove the cache issue workaroud in hab " Peng Fan
2015-06-11 10:30 ` [U-Boot] [PATCH v2 6/8] imx: mx6qp Enable PRG clock and AQoS setting for IPU Peng Fan
2015-06-27 17:04   ` Stefano Babic
2015-06-27 21:10   ` Fabio Estevam
2015-06-11 10:30 ` [U-Boot] [PATCH v2 7/8] imx: mx6qpsabreauto: Add MX6QP SABREAUTO CPU3 board support Peng Fan
2015-06-27 17:08   ` Stefano Babic
2015-06-29  2:05     ` Peng Fan
2015-06-29  7:26       ` Stefano Babic [this message]
2015-06-29  8:06         ` Peng Fan
2015-06-29  8:19           ` Stefano Babic
2015-06-29 12:02           ` Fabio Estevam
2015-06-29 12:26             ` Peng Fan
2015-06-27 17:11   ` Fabio Estevam
2015-06-11 10:30 ` [U-Boot] [PATCH v2 8/8] imx: mx6qp: Adjust AQos settings for peripherals Peng Fan
2015-06-27 17:09   ` Stefano Babic
2015-06-27 16:17 ` [U-Boot] [PATCH v2 1/8] imx: mx6 correct is_soc_rev usage Stefano Babic

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=5590F312.4070205@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