1. 26 Jan, 2019 1 commit
    • Sam Protsenko's avatar
      env: Fix saving environment to "bad CRC" location · 293a172b
      Sam Protsenko authored
      In case when the environment on some location is malformed (CRC isn't
      matching), there is a chance we won't be able to save the environment to
      that location. For example, consider the case when we only have the
      environment on eMMC, but it's zeroed out. In that case, we won't be able
      to "env save" to it, because of "bad CRC" error. That's happening
      because in env_load() function we consider malformed environment as
      incorrect one, and  defaulting to the location with highest (0)
      priority, which can be different from one we are dealing with right now
      (e.g., highest priority can be ENV_FAT on SD card, which is not
      inserted, but we want to use ENV_MMC on eMMC, where we were booted
      from).
      
      This issue began to reproduce after commit d30ba231 ("u-boot: remove
      driver lookup loop from env_save()") on BeagleBone Black, but that
      commit didn't introduce the wrong logic, it just changed the behavior
      for default location to use, merely revealing this issue.
      
      To fix that, let's implement next logic in env_load():
        1. Try to find out correct environment; if found -- use it
        2. If working environment wasn't found, but we found malformed one
           (with bad CRC), let's use it for further "env save". But make sure
           to use malformed environment location with highest priority.
        3. If neither correct nor malformed environment was found, let's
           default to environment location with highest priority (0)
      
      Steps to reproduce mentioned issue on BeagleBone Black (fixed in this
      patch):
      
      1. Boot from SD card and erase eMMC in U-Boot shell:
         => mmc dev 1
         => mmc erase 0 100000
         => gpt write mmc 1 $partitions
      2. Write new SPL and U-Boot to eMMC; the rest of eMMC will stay filled
         with zeroes
      3. Boot from eMMC; try to do:
         => env save
      4. Observe the error (incorrect behavior). Correct behavior: environment
         should be stored correctly on eMMC, in spite of it has "bad CRC"
      
      Fixes: d30ba231 ("u-boot: remove driver lookup loop from env_save()")
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      Reviewed-by: default avatarSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
      293a172b
  2. 09 Jan, 2019 1 commit
  3. 10 Aug, 2018 1 commit
    • Sam Protsenko's avatar
      env: Don't show "Failed" error message · 13bbfb4a
      Sam Protsenko authored
      "Failed" error message from env_load() only clutters the log with
      unnecessary details, as we already have all needed warnings by that
      time. Example:
      
          Loading Environment from FAT... MMC: no card present
          ** Bad device mmc 0 **
          Failed (-5)
      
      Let's only print it in case when DEBUG is defined to keep log clear.
      Signed-off-by: default avatarSam Protsenko <semen.protsenko@linaro.org>
      13bbfb4a
  4. 30 Jul, 2018 1 commit
  5. 07 May, 2018 1 commit
    • Tom Rini's avatar
      SPDX: Convert all of our single license tags to Linux Kernel style · 83d290c5
      Tom Rini authored
      When U-Boot started using SPDX tags we were among the early adopters and
      there weren't a lot of other examples to borrow from.  So we picked the
      area of the file that usually had a full license text and replaced it
      with an appropriate SPDX-License-Identifier: entry.  Since then, the
      Linux Kernel has adopted SPDX tags and they place it as the very first
      line in a file (except where shebangs are used, then it's second line)
      and with slightly different comment styles than us.
      
      In part due to community overlap, in part due to better tag visibility
      and in part for other minor reasons, switch over to that style.
      
      This commit changes all instances where we have a single declared
      license in the tag as both the before and after are identical in tag
      contents.  There's also a few places where I found we did not have a tag
      and have introduced one.
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      83d290c5
  6. 17 Apr, 2018 1 commit
  7. 16 Feb, 2018 2 commits
  8. 27 Jan, 2018 8 commits
  9. 15 Jan, 2018 1 commit
  10. 16 Oct, 2017 1 commit
  11. 21 Aug, 2017 3 commits
  12. 16 Aug, 2017 8 commits