All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Faith <jfaith7@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Unbricking process with separate environment binary?
Date: Mon, 10 Apr 2017 12:03:43 -0700	[thread overview]
Message-ID: <CAM17CwdiF1V5mvbDjCFxLziwG20i0uK+weEMW8fOm6baBVMUkw@mail.gmail.com> (raw)

 Hello,
I am putting together a factory bring-up/unbrick procedure for a blank
iMX7 board with eMMC and no SD card.  I'd like to use the USB port
with something like imx_usb_loader to drive the whole process and not
have the flashing script also use the serial console to expect-edly
talk to u-boot.

I ran across this nicely-documented example:
http://free-electrons.com/blog/factory-flashing-with-u-boot-and-fastboot-on-freescale-i-mx6/
, which requires a specially-built u-boot with CONFIG_BOOTCOMMAND set
to "fastboot" so the first binary loaded on the target can be used to
flash the rest of the bits.

Instead of having 2 builds of u-boot, one which defaults to fastboot
and one for normal booting, is it possible to have one u-boot binary
and a separate environment piece (especially for bootcmd, but maybe
also for some scripts)?  This would be similar to how
CONFIG_OF_SEPARATE allows for dtb cat'ed with the u-boot binary that
gives the device tree at $fdtcontroladdr.

One implementation might be: put environment variables in their own
dts file, not in the u-boot source tree, but used post-build with a
deploy/unbrick script.  A bit of code added to u-boot, enabled with
CONFIG_ENV_SEPARATE, could setenv variables based on a "uboot-env"
node, like:
/ {
   uboot-env {
       bootcmd = "fastboot";
       other_env_vars = "other values...";
   };
};

The first binary run on the target would be made with "cat
u-boot-nodtb.bin first_boot_env.dtb > u-boot-first-boot.bin", and the
normal boot binary that gets flashed would not have the environment
piece "cp u-boot-nodtb.bin u-boot.bin".

Or, instead of trying to reuse the current dtb mechanism and possibly
changing process_fdt_options() and CONFIG_OF_CONTROL etc. #ifdefs,
would it make more sense to add code to read an appended environment
binary produced with mkenvimage?

Thanks!,
John

             reply	other threads:[~2017-04-10 19:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 19:03 John Faith [this message]
2017-04-11  7:40 ` [U-Boot] Unbricking process with separate environment binary? Lukasz Majewski
     [not found]   ` <CAM17CwcveDR3fERHSHHkym4OJRbeFT92nf3E1ocevozMec721A@mail.gmail.com>
2017-04-12  8:59     ` Lukasz Majewski

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=CAM17CwdiF1V5mvbDjCFxLziwG20i0uK+weEMW8fOm6baBVMUkw@mail.gmail.com \
    --to=jfaith7@gmail.com \
    --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.