public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vagrant Cascadian <vagrant@aikidev.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [U-Boot, v3, 5/5] mx6cuboxi: Load the correct 'fdt_file' variable
Date: Sat, 25 Apr 2015 10:02:56 -0700	[thread overview]
Message-ID: <87tww4p2db.fsf@aikidev.net> (raw)
In-Reply-To: <CAOMZO5CuteWHxjhQuzX2rCq_+E27xQnN8et-v+a2iofOG_HyaQ@mail.gmail.com>

On 2015-04-25, Fabio Estevam wrote:
> On Sat, Apr 25, 2015 at 3:05 AM, Stefano Babic <sbabic@denx.de> wrote:
>
>> Are you sure ? I think Fabio's intention is to have setenv fdt_file as
>> part of check_suffix, and it is not if you add a trailing \0
>
> That's correct.

Yes, I understood that intention, but there's no \0 in check_suffix now,
which means that whatever comes after the check_suffix code will be
appended to check_suffix. The check_suffix code needs a \0 to define
where it ends and the next line begins...


>>> and maybe should
>>> be indented to line up with the if statement:
>>>
>>>   +           "setenv fdt_file ${dts_prefix}${dts_suffix}\0" \
>>
>> If checkpatch does not complain...
>
> checkpatch did not complain, but for better readability I could do as
> Vagrant suggested and write it like:
>
>   #define CONFIG_EXTRA_ENV_SETTINGS \
>        "script=boot.scr\0" \
>        "image=zImage\0" \
>  -     "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
>  +     "check_suffix=" \
>  +             "if is_hummingboard; then " \
>  +                     "setenv dts_suffix -hummingboard.dtb;" \
>  +             "else " \
>  +                     "setenv dts_suffix -cubox-i.dtb;" \
>  +             "fi; "\
>  +             "setenv fdt_file ${dts_prefix}${dts_suffix};" \

Just to be clearer about my earlier point, I think you really want the
\0 at the end of check_suffix:

 #define CONFIG_EXTRA_ENV_SETTINGS \
      "script=boot.scr\0" \
      "image=zImage\0" \
-     "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+     "check_suffix=" \
+             "if is_hummingboard; then " \
+                     "setenv dts_suffix -hummingboard.dtb;" \
+             "else " \
+                     "setenv dts_suffix -cubox-i.dtb;" \
+             "fi; "\
+             "setenv fdt_file ${dts_prefix}${dts_suffix}\0" \


I'm also wondering if "check_suffix" is a good description for the code;
It's actually setting the dts_suffix and fdt_file variables. Some of the
ti boards call their corresponding code "findfdt" which seems more
accurate, although something like "set_fdt_vars" might even more
appropriate.

Another minor point: the variables are actually working with dtb files,
not dts files. I think the dts_prefix/dts_suffix should probably be
named dtb_prefix/dtb_suffix or fdt_prefix/fdt_suffix.

And while I'm at it, Dare I make the case again for fdtfile
vs. fdt_file?


Thanks for working on getting hummingboard/cubox-i support into mainline
u-boot!

live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150425/10ff1a40/attachment.sig>

  reply	other threads:[~2015-04-25 17:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 11:46 [U-Boot] [PATCH v3 1/5] mx6cuboxi: Fix the defconfig name Fabio Estevam
2015-04-24 11:46 ` [U-Boot] [PATCH v3 2/5] mx6cuboxi: Prepare for multi SoC support Fabio Estevam
2015-04-24 11:46 ` [U-Boot] [PATCH v3 3/5] mx6cuboxi: Introduce multi-SoC support Fabio Estevam
2015-04-24 12:27   ` Stefano Babic
2015-04-24 12:29     ` Fabio Estevam
2015-04-24 11:46 ` [U-Boot] [PATCH v3 4/5] mx6cuboxi: Differentiate Cubox-i and Hummingboard Fabio Estevam
2015-04-24 11:46 ` [U-Boot] [PATCH v3 5/5] mx6cuboxi: Load the correct 'fdt_file' variable Fabio Estevam
2015-04-24 23:47   ` [U-Boot] [U-Boot, v3, " Vagrant Cascadian
2015-04-25  6:05     ` Stefano Babic
2015-04-25 15:30       ` Fabio Estevam
2015-04-25 17:02         ` Vagrant Cascadian [this message]
2015-04-25 16:22       ` Vagrant Cascadian
2015-04-25 16:58   ` [U-Boot] [PATCH v3 " Tom Rini

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=87tww4p2db.fsf@aikidev.net \
    --to=vagrant@aikidev.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox