[RFC PATCH 0/2] Bootmode override on i.MX6

Philipp Zabel philipp.zabel at gmail.com
Wed Jan 22 18:01:29 EST 2014


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




More information about the barebox mailing list