mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Philipp Zabel <philipp.zabel@gmail.com>
To: barebox@lists.infradead.org
Cc: Troy Kisky <troy.kisky@boundarydevices.com>
Subject: [RFC PATCH 0/2] Bootmode override on i.MX6
Date: Thu, 23 Jan 2014 00:01:29 +0100	[thread overview]
Message-ID: <1390431691-5090-1-git-send-email-philipp.zabel@gmail.com> (raw)

The i.MX6 boot rom copies parts of the (persistent across reset) GPR9
register into SMBR1 if the GPR10[28] bit is set.
This allows to override the boot mode bits which are otherwise sampled
from fuses or gpios, and can be used to temporarily (until the next
power cycle) boot from a different device.
This patchset adds a bootmode command that conveniently writes to the
GPR9/10 registers to tell the boot rom from which device to boot.

Example:
    <power-on reset, boot ROM loads barebox from mmc3 as fused>
    # bootmode -l
      mmc2
    * mmc3
    # barebox_update -t mmc2 /path/to/barebox.img
    # bootmode mmc2
    # reset
    <boot ROM loads untested barebox from mmc2>
    # barebox_update -t mmc3 /path/to/barebox.img
    <either power cycle, or>
    # bootmode mmc3 ; reset
    <boot ROM loads tested barebox from mmc3>

Philipp Zabel (2):
  ARM i.MX6: Add bootmode setting code
  commands: add bootmode command

 arch/arm/mach-imx/boot.c                 |  75 ++++++++++++++++
 arch/arm/mach-imx/imx6.c                 |   2 +
 arch/arm/mach-imx/include/mach/generic.h |   6 ++
 commands/Kconfig                         |   9 ++
 commands/Makefile                        |   1 +
 commands/bootmode.c                      | 143 +++++++++++++++++++++++++++++++
 common/Kconfig                           |   3 +
 common/Makefile                          |   1 +
 common/bootmode.c                        |  39 +++++++++
 include/bootmode.h                       |  34 ++++++++
 10 files changed, 313 insertions(+)
 create mode 100644 commands/bootmode.c
 create mode 100644 common/bootmode.c
 create mode 100644 include/bootmode.h

The SBMR1 override using GPR9/10 is based on the U-Boot rsmode
patch by Troy Kisky:
    http://lists.denx.de/pipermail/u-boot/2012-May/125283.html

Tested on GK802 and BD-SL with mmc and spi nor flash.

I chose to use device names as parameter to the bootmode command,
but I'm unsure about that. Maybe reusing the bbu target name list
would be better for consistency?

regards
Philipp


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2014-01-22 23:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 23:01 Philipp Zabel [this message]
2014-01-22 23:01 ` [RFC PATCH 1/2] ARM i.MX6: Add bootmode setting code Philipp Zabel
2014-01-22 23:01 ` [RFC PATCH 2/2] commands: add bootmode command Philipp Zabel
2014-01-27  8:46   ` Sascha Hauer

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=1390431691-5090-1-git-send-email-philipp.zabel@gmail.com \
    --to=philipp.zabel@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=troy.kisky@boundarydevices.com \
    /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