06 Jul, 2018

1 commit


01 Jun, 2018

1 commit

  • When env save is failed, 2018 u-boot will loop infinitely to save the env,
    and each time returns failure. The root cause is env_driver_lookup only returns
    current env location for ENVOP_SAVE, no matter what the prio is. So the loop
    can't exit until the save is successful.

    Signed-off-by: Ye Li

    Ye Li
     

17 Feb, 2018

2 commits

  • With multiple environments, the 'get_char' callback for env
    drivers does not really make sense any more because it is
    only supported by two drivers (eeprom and nvram).

    To restore single character loading for these drivers,
    override 'env_get_char_spec'.

    Signed-off-by: Simon Goldschmidt
    Acked-by: Maxime Ripard

    Goldschmidt Simon
     
  • Commit 7d714a24d725 ("env: Support multiple environments") added
    static variable env_load_location. When saving environmental
    variables, this variable is presumed to have the value set before.
    In case the value was set before relocation and U-Boot runs from a
    NOR flash, this variable wasn't writable. This causes failure when
    saving the environment. To save this location, global data must be
    used instead.

    Signed-off-by: York Sun
    CC: Maxime Ripard

    York Sun
     

27 Jan, 2018

8 commits

  • Allow boards and architectures to override the default environment lookup
    code by overriding env_get_location.

    Reviewed-by: Andre Przywara
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • Since we want to have multiple environments, we will need to initialise
    all the environments since we don't know at init time what drivers might
    fail when calling load.

    Let's init all of them, and only consider for further operations the ones
    that have not reported any errors at init time.

    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • Now that we have everything in place to support multiple environment, let's
    make sure the current code can use it.

    The priority used between the various environment is the same one that was
    used in the code previously.

    At read / init times, the highest priority environment is going to be
    detected, and we'll use the same one without lookup during writes. This
    should implement the same behaviour than we currently have.

    Reviewed-by: Andre Przywara
    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • Since we can have multiple environments now, it's better to provide a
    decent indication on what environments were tried and which were the one to
    fail and succeed.

    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • Since we'll soon have support for multiple environments, the environment
    saving message might end up being printed multiple times if the higher
    priority environment cannot be used.

    That might confuse the user, so let's make it explicit if the operation
    failed or not.

    Reviewed-by: Andre Przywara
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • In preparation for the multiple environment support, let's introduce two
    new parameters to the environment driver lookup function: the priority and
    operation.

    The operation parameter is meant to identify, obviously, the operation you
    might want to perform on the environment.

    The priority is a number passed to identify the environment priority you
    want to retrieve. The lowest priority parameter (0) will be the primary
    source.

    Combining the two parameters allow you to support multiple environments
    through different priorities, and to change those priorities between read
    and writes operations.

    This is especially useful to implement migration mechanisms where you want
    to always use the same environment first, be it to read or write, while the
    common case is more likely to use the same environment it has read from to
    write it to.

    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • The env_driver_lookup_default and env_get_default_location functions are
    about to get refactored to support loading from multiple environment.

    The name is therefore not really well suited anymore. Drop the default
    part to be a bit more relevant.

    Reviewed-by: Andre Przywara
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     
  • The nvedit command is the only user of env_driver_lookup_default outside of
    the environment code itself, and it uses it only to print the environment
    it's about to save to during env save.

    As we're about to rework the environment to be able to handle multiple
    environment sources, we might not have an idea of what environment backend
    is going to be used before trying (and possibly failing for some).

    Therefore, it makes sense to remove that message and move it to the
    env_save function itself. As a side effect, we also can get rid of the call
    to env_driver_lookup_default that is also about to get refactored.

    Reviewed-by: Andre Przywara
    Reviewed-by: Lukasz Majewski
    Reviewed-by: Simon Glass
    Signed-off-by: Maxime Ripard

    Maxime Ripard
     

16 Jan, 2018

1 commit

  • For example to store the environment in a file named "/uboot.env" in MMC
    "0", where partition "1" contains the EXT4 filesystem, the following
    configs should be added to the board's default config:

    CONFIG_ENV_IS_IN_EXT4=y
    CONFIG_ENV_EXT4_DEVICE_AND_PART="0:1"
    CONFIG_ENV_EXT4_FILE="/uboot.env"
    CONFIG_ENV_EXT4_INTERFACE="mmc"

    Signed-off-by: Jorge Ramirez-Ortiz
    [trini: Fix some line over 80 chars issues]
    Signed-off-by: Tom Rini

    Jorge Ramirez-Ortiz
     

16 Oct, 2017

1 commit


21 Aug, 2017

3 commits

  • Some of these were missed in the conversion.
    Signed-off-by: Simon Glass

    Simon Glass
     
  • Now that we have errors available in the environment driver's load()
    method, check the return valid.

    Signed-off-by: Simon Glass

    Simon Glass
     
  • With the change to the environment code to remove the common init stage
    of pointing to the default environment and setting it as valid, combined
    with the change to switch gd->env_valid from 0/1/2 to an enum we now
    must set env_valid to one of the enum values rather than an int. And in
    this case, not only was setting it to an int wrong, it was now the wrong
    value. Finally, in the case of ENV_IS_NOWHERE we must still say that
    our envionrment is invalid after init for things to continue to
    function.

    Fixes: 7938822a6b75 ("env: Drop common init() functions")
    Tested-by: Marek Vasut
    Reported-by: Marek Vasut
    Reported-by: Andy Shevchenko
    Signed-off-by: Tom Rini
    ---
    Changes in v3:
    - Actually include changes for env/nowhere.c

    Tom Rini
     

16 Aug, 2017

8 commits