08 Apr, 2017

1 commit

  • SPL has been restricted to use only dev 0 based on the assumption that only
    one MMC device is registered. This is not always the case and many
    platforms now register several devices as expected by the spl mmc boot code
    For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0.

    A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that
    do not register the same MMC controllers in SPL and in u-boot (mostly iMX6
    based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in
    their default configuration.

    Signed-off-by: Jean-Jacques Hiblot

    Jean-Jacques Hiblot
     

28 May, 2016

1 commit


17 May, 2016

1 commit


25 Jan, 2016

1 commit

  • This enables boards to choose where to/from the environment should be
    saved/loaded. They can then for example support using the same device
    (dynamically) from which the bootloader was launched to load and save
    env data and do not have to define CONFIG_SYS_MMC_ENV_DEV statically.

    In my use case, the environment needs to be on the same device I
    booted from. It can be the eMMC or an optional SD card.
    I therefore would override mmc_get_env_dev in the board code, read the
    CPU registers to determine where we booted from and return the
    corresponding device index.

    Cc: Tom Rini
    Cc: Stephen Warren
    Cc: Tim Harvey
    Cc: Simon Glass
    Cc: Hans de Goede

    Signed-off-by: Clemens Gruber
    Reviewed-by: Stephen Warren
    Reviewed-by: Tom Rini

    Clemens Gruber
     

14 Jan, 2016

2 commits

  • This will allow us to have multiple block device structs each referring
    to the same eMMC device, yet different HW partitions.

    For now, there is still a single block device per eMMC device. As before,
    this block device always accesses whichever HW partition was most recently
    selected. Clients wishing to make use of multiple block devices referring
    to different HW partitions can simply take a copy of this block device
    once it points at the correct HW partition, and use each one as they wish.
    This feature will be used by the next patch.

    In the future, perhaps get_device() could be enhanced to return a
    dynamically allocated block device struct, to avoid the client needing to
    copy it in order to maintain multiple block devices. However, this would
    require all users to be updated to free those block device structs at some
    point, which is rather a large change.

    Most callers of mmc_switch_part() wish to permanently switch the default
    MMC block device's HW partition. Enhance mmc_switch_part() so that it does
    this. This removes the need for callers to do this. However,
    common/env_mmc.c needs to save and restore the current HW partition. Make
    it do this more explicitly.

    Replace use of mmc_switch_part() with mmc_select_hwpart() in order to
    remove duplicate code that skips the call if that HW partition is already
    selected.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini

    Stephen Warren
     
  • This will allow the implementation to make use of data in the block_dev
    structure beyond the base device number. This will be useful so that eMMC
    block devices can encompass the HW partition ID rather than treating this
    out-of-band. Equally, the existence of the priv field is crying out for
    this patch to exist.

    Signed-off-by: Stephen Warren
    Reviewed-by: Tom Rini

    Stephen Warren
     

12 Sep, 2015

1 commit


29 Aug, 2015

1 commit

  • The set_default_env() function from env_common.c expects either
    a fully formatted error msg, e.g.: "## Resetting to default environment\n"
    or an error msg prefixed with an !, in which case it will format it.

    Fix the init_mmc_for_env() error messages to be prefixed with a !
    this changes the bootup-log on sunxi when no mmc card is found from:

    MMC: SUNXI SD/MMC: 0
    No MMC card foundIn: serial
    Out: serial

    To:

    MMC: SUNXI SD/MMC: 0
    *** Warning - No MMC card found, using default environment

    In: serial
    Out: serial

    Which clearly is how things should look.

    Signed-off-by: Hans de Goede

    Hans de Goede
     

28 May, 2015

1 commit


03 Oct, 2014

1 commit

  • The code to set the MMC partition uses an weak function to obtain the
    correct partition number. Use that instead of the compile-time default
    when deciding whether it needs to switch back.

    Fixes: 6e7b7df4df43574 ("env_mmc: support env partition setup in runtime")
    Signed-off-by: Peter A. Bigot
    Acked-by: Dmitry Lifshitz
    Acked-by: Pantelis Antoniou

    Peter Bigot
     

02 Aug, 2014

1 commit

  • Add callback with __weak annotation to allow setup of environment
    partition number in runtime from a board file.

    Propagate mmc_switch_part() return value into init_mmc_for_env() instead
    of -1 in case of failure.

    Signed-off-by: Dmitry Lifshitz
    Signed-off-by: Igor Grinberg
    Acked-by: Pantelis Antoniou

    Dmitry Lifshitz
     

09 May, 2014

1 commit


18 Apr, 2014

2 commits


22 Mar, 2014

1 commit

  • Implement env_export() wrapper, so that all implementers of saveenv() don't
    have to call hexport_r(), crc32() etc. sequence . This trims down a bit of
    code duplication.

    Signed-off-by: Marek Vasut

    Marek Vasut
     

15 Oct, 2013

2 commits

  • Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     
  • commit d196bd880347373237d73e0d115b4d51c68cf2ad adds
    redundand environment to mmc. The usage of malloc in
    env_relocate_spec triggers cache errors on armv7.

    Tested on a not mainlined i.MX53 board:

    Board: TQMa53
    I2C: ready
    DRAM: 512 MiB
    MMC: FSL_SDHC: 0, FSL_SDHC: 1
    ERROR: v7_dcache_inval_range - start address is not aligned - 0x8f57c2d8
    ERROR: v7_dcache_inval_range - stop address is not aligned - 0x8f57e2d8
    ERROR: v7_dcache_inval_range - start address is not aligned - 0x8f57e2e0
    ERROR: v7_dcache_inval_range - stop address is not aligned - 0x8f5802e0
    Using default environment

    Signed-off-by: Markus Niebel

    Markus Niebel
     

24 Jul, 2013

1 commit


14 Jun, 2013

1 commit

  • A negative value of CONFIG_ENV_OFFSET is treated as a backwards offset
    from the end of the eMMC device/partition, rather than a forwards offset
    from the start.

    This is useful when a single board may be stuffed with different eMMC
    devices, each of which has a different capacity, and you always want the
    environment to be stored at the very end of the device (or eMMC boot
    partition for example).

    One example of this case is NVIDIA's Ventana reference board.

    Signed-off-by: Stephen Warren
    Signed-off-by: Andy Fleming

    Stephen Warren
     

02 May, 2013

1 commit


06 Apr, 2013

1 commit


03 Apr, 2013

1 commit


04 Feb, 2013

1 commit


14 Dec, 2012

1 commit

  • When printing all variables with env print, don't print variables that
    begin with '.'. If env print is called with a '-a' switch, then
    include variables that begin with '.' (just like the ls command).

    Variables printed explicitly will be printed even without the -a.

    Signed-off-by: Joe Hershberger

    Joe Hershberger
     

06 Sep, 2012

1 commit

  • eMMC devices may have hardware-level partitions: 2 boot partitions,
    up to 4 general partitions, plus the user area. This change introduces
    optional config variable CONFIG_SYS_MMC_ENV_PART to indicate which
    partition the environment should be stored in: 0=user, 1=boot0, 2=boot1,
    4..7=general0..3. This allows the environment to be kept out of the user
    area, which simplifies the management of OS-/user-level (MBR/GPT)
    partitions within the user area.

    Signed-off-by: Stephen Warren
    Signed-off-by: Andy Fleming

    Stephen Warren
     

07 Jul, 2012

1 commit


05 Jan, 2012

1 commit


22 Nov, 2011

3 commits


08 Nov, 2011

1 commit

  • New syntax:
    env export [-t | -b | -c] [-s size] addr [var ...]

    With this change it is possible to provide a list of variables names
    that shall be exported. Whenno arguments are given, the whole
    environment gets exported.

    NOTE: The new handling of the "size" argument means a change to the
    user API.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     

05 Apr, 2011

1 commit

  • On some boards the environment may not be located at a fixed address in
    the MMC/SDHC card. This allows those boards to implement their own
    means to report what address the environment is located at.

    Signed-off-by: Mingkai Hu
    Signed-off-by: Jerry Huang
    Signed-off-by: Zhao Chenhui
    Acked-by: Andy Fleming
    Signed-off-by: Kumar Gala

    Mingkai Hu
     

18 Dec, 2010

1 commit

  • The non-reentrant versions of the hashtable functions operate on a single
    shared hashtable. So if two different people try using these funcs for
    two different purposes, they'll cause problems for the other.

    Avoid this by converting all existing hashtable consumers over to the
    reentrant versions and then punting the non-reentrant ones.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

15 Nov, 2010

1 commit

  • hexport would complain implicit declaration, if we don't add the
    include file.

    env_mmc.c: In function 'saveenv':
    env_mmc.c:109: warning: implicit declaration of function 'hexport'

    Signed-off-by: Lei Wen

    Lei Wen
     

18 Oct, 2010

1 commit


14 Oct, 2010

2 commits

  • The env change its implementation after this log, while env mmc
    didn't change it immediately, which cause issue. Follow to the
    new style to fix it.

    commit ea882baf9c17cd142c99e3ff640d3ab01daa5cec
    Author: Wolfgang Denk
    Date: Sun Jun 20 23:33:59 2010 +0200

    New implementation for internal handling of environment variables.

    Signed-off-by: Lei Wen

    Lei Wen
     
  • The crash was occuring in env_relocate because it was being called prior
    to mmc_initialize. This patch moves the MMC initialization earlier in
    the init process.

    This patch also cleans up the env_relocate_spec code in env_mmc.c

    Signed-off-by: Steve Sakoman
    Acked-by: Stefano Babic

    Steve Sakoman
     

07 Oct, 2010

1 commit


19 Sep, 2010

1 commit