Skip to content
Snippets Groups Projects
  1. May 19, 2024
  2. May 17, 2024
    • Fiona Klute's avatar
      Init virtio before loading ENV from EXT4 or FAT · 3be9f399
      Fiona Klute authored and Tom Rini's avatar Tom Rini committed
      
      Specifying a file in an EXT4 or FAT partition on a virtio device as
      environment location failed because virtio hadn't been initialized by
      the time the environment was loaded. This patch mirrors commit
      54ee5ae8 ("Add SCSI scan for ENV in EXT4 or FAT") in issue and
      fix, just for a different kind of block device.
      
      The additional include in include/virtio.h is needed so all functions
      called there are defined, the alternative would have been to include
      dm/device.h separately in the env/ sources.
      
      Checkpatch suggests using "if (IS_ENABLED(CONFIG...))" instead of
      "#if defined(CONFIG_...)", I'm sticking to the style of the existing
      code here.
      
      Signed-off-by: default avatarFiona Klute <fiona.klute@gmx.de>
      CC: Joe Hershberger <joe.hershberger@ni.com>
      CC: Bin Meng <bmeng.cn@gmail.com>
      CC: Rogier Stam <rogier@unrailed.org>
      3be9f399
  3. May 06, 2024
  4. Apr 18, 2024
    • Quentin Schulz's avatar
      env: mmc: print MMC device being read · 97b34f6a
      Quentin Schulz authored and Tom Rini's avatar Tom Rini committed
      
      This prints the MMC device being read similar to how we print the MMC
      device we write to when e.g. calling saveenv.
      
      One of the side effects is that the boot log now shows from which MMC
      device the env was loaded:
      
      Loading Environment from MMC... Reading from MMC(1)... OK
      
      This is useful to identify which MMC device the environment was loaded
      from for boards where there are more than one (e.g. eMMC and SD card)
      without adding some debug messages manually.
      
      Sadly, there's no way to know which of the default or redundant
      environment is being read from env_mmc_load before env_import_redund is
      called so it is printing a bit later (and possibly after error/warning
      messages).
      
      Cc: Quentin Schulz <foss+uboot@0leil.net>
      Signed-off-by: default avatarQuentin Schulz <quentin.schulz@theobroma-systems.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: default avatarDragan Simic <dsimic@manjaro.org>
      97b34f6a
  5. Mar 22, 2024
  6. Jan 29, 2024
    • Ralph Siemsen's avatar
      env: sf: report malloc error to caller · 04add62e
      Ralph Siemsen authored and Tom Rini's avatar Tom Rini committed
      
      In the non-redundant code for env_sf_save(), a failure to malloc() the
      temporary buffer produces the following output:
      
          Saving Environment to SPIFlash... OK
      
      This is misleading as the flash has neither been erased nor written.
      
      Fix it to return an error to the caller, so the output will be:
      
          Saving Environment to SPIFlash... Failed (-12)
      
      Note that there is another copy of env_sf_save() in the same file, for
      handling redundant environment, and it already has the same logic.
      
      Signed-off-by: default avatarRalph Siemsen <ralph.siemsen@linaro.org>
      04add62e
  7. Jan 22, 2024
  8. Jan 19, 2024
  9. Jan 18, 2024
  10. Dec 21, 2023
    • Tom Rini's avatar
      global: Restrict use of '#include <linux/kconfig.h>' · b106961c
      Tom Rini authored
      
      In general terms, we -include include/linux/kconfig.h and so normal
      U-Boot code does not need to also #include it. However, for code which
      is shared with userspace we may need to add it so that either our full
      config is available or so that macros such as CONFIG_IS_ENABLED() can be
      evaluated. In this case make sure that we guard these includes with a
      test for USE_HOSTCC so that it clear as to why we're doing this.
      
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      b106961c
  11. Dec 13, 2023
  12. Nov 16, 2023
  13. Nov 07, 2023
    • Tom Rini's avatar
      env: Move env_set() out of cmd/nvedit.c and in to env/common.c · d9721925
      Tom Rini authored
      
      Inside of env/common.c we already have our helper env_set_xxx functions,
      and even have a comment that explains why env_set() itself wasn't moved.
      We now handle that move. This requires that we rename the previous
      _do_env_set() to env_do_env_set() and note it as an internal env
      function. Add comments about this function to explain why we do this
      when we add the prototype. Add a new function, env_inc_id() to allow for
      the counter to be updated by both commands and callers, and document
      this as well by the prototype.
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      d9721925
  14. Oct 11, 2023
  15. Oct 10, 2023
  16. Sep 24, 2023
  17. Sep 14, 2023
  18. Aug 09, 2023
    • Tom Rini's avatar
      Kconfigs: Correct default of "0" on hex type entries · a077ac13
      Tom Rini authored
      
      It is not a parse error to have a default value of "0" for a "hex" type
      entry, instead of "0x0".  However, "0" and "0x0" are not treated the
      same even by the tools themselves. Correct this by changing the default
      value from "0" to "0x0" for all hex type questions that had the
      incorrect default. Fix one instance (in two configs) of a default of "0"
      being used on a hex question to be "0x0". Remove the cases where a
      defconfig had set a value of "0x0" to be used as the default had been
      "0".
      
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      a077ac13
  19. Jul 17, 2023
    • Ashok Reddy Soma's avatar
      env: Fix default environment saving issue · 4dc5e262
      Ashok Reddy Soma authored and Tom Rini's avatar Tom Rini committed
      
      When CONFIG_SYS_REDUNDAND_ENVIRONMENT is enabled, by default env is
      getting saved to redundant environment irrespective of primary env is
      present or not.
      
      It means even if primary and redundant environment are not present, by
      default, env is getting stored to redundant environment. Even if primary
      env is present, it is choosing to store in redudndant env.
      
      Ideally it should look for primary env and choose to store in primary env
      if it is present. If both primary and redundant env are not present then
      it should save in to primary env area.
      
      Fix the issue by making env_valid = ENV_INVALID when both the
      environments are not present.
      
      Signed-off-by: default avatarAshok Reddy Soma <ashok.reddy.soma@amd.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      4dc5e262
  20. Jul 14, 2023
    • Emmanuel Di Fede's avatar
      env: mmc: statically set the environment partition name · 9e70676c
      Emmanuel Di Fede authored and Tom Rini's avatar Tom Rini committed
      
      The new opt-out setting, CONFIG_ENV_MMC_PARTITION, statically sets
      the MMC environment partition name. Prior to this patch, the only way
      to declare this partition name was by creating a
      'u-boot,mmc-env-partition' parameter in the device-tree's /config node.
      
      This setting provides additional flexibility, particularly in cases
      where accessing the device-tree is not straightforward (e.g. QEMU).
      
      If undeclared, the device-tree's setting will be used.
      
      Signed-off-by: default avatarEmmanuel Di Fede <emmanuel.difede@cysec.com>
      Cc: Joe Hershberger <joe.hershberger@ni.com>
      Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
      9e70676c
  21. May 16, 2023
  22. May 09, 2023
  23. Mar 02, 2023
  24. Feb 23, 2023
    • Marek Vasut's avatar
      env: mmc: Apply GPT only on eMMC user HW partition · 5b4acb0f
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      Apply the GPT U-Boot environment GUID type look up only on eMMC user
      HW partition, do not apply the look up on eMMC boot HW partitions as
      mmc_offset_try_partition() assumes either SD partitions or eMMC user
      HW partition.
      
      This fixes environment operation on systems where CONFIG_SYS_MMC_ENV_PART
      is non-zero and CONFIG_SYS_REDUNDAND_ENVIRONMENT is set.
      
      Fixes: 80105d8f ("env: mmc: select GPT env partition by type guid")
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      5b4acb0f
  25. Feb 10, 2023
  26. Feb 07, 2023
  27. Feb 06, 2023
  28. Jan 11, 2023
  29. Jan 10, 2023
Loading