mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Bootmode override on i.MX6
@ 2014-01-22 23:01 Philipp Zabel
  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
  0 siblings, 2 replies; 4+ messages in thread
From: Philipp Zabel @ 2014-01-22 23:01 UTC (permalink / raw)
  To: barebox; +Cc: Troy Kisky

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-27  8:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-22 23:01 [RFC PATCH 0/2] Bootmode override on i.MX6 Philipp Zabel
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox