Skip to content
Snippets Groups Projects
  1. Jul 07, 2021
    • Tom Rini's avatar
      ppc: Remove sbc8641d board · 1c58857a
      Tom Rini authored
      
      This board has not been converted to CONFIG_DM_PCI by the deadline and is
      also missing conversion to CONFIG_DM.  Remove it.  This is also the last
      of the ARCH_MPC8641/MPC8610 platforms, so remove that support as well.
      
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Priyanka Jain <priyanka.jain@nxp.com>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      1c58857a
    • Tom Rini's avatar
      ppc: Remove xpedite boards · ed7fe2be
      Tom Rini authored
      
      These boards have not been converted to CONFIG_DM_PCI by the deadline and is
      also missing conversion to CONFIG_DM.  Remove them.  As this includes
      the last ARCH_MPC8572 platform, remove that as well.
      
      Cc: Peter Tyser <ptyser@xes-inc.com>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      Acked-by: default avatarPeter Tyser <ptyser@xes-inc.com>
      ed7fe2be
    • Tom Rini's avatar
      m68k: Remove M5475x boards · 9b7993bb
      Tom Rini authored
      
      These board has not been converted to CONFIG_DM_PCI by the deadline.
      Remove them.  As this is the last of the mcf547x_8x family of boards,
      remove that support as well.
      
      Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      9b7993bb
  2. May 04, 2021
    • Rasmus Villemoes's avatar
      env: allow environment to be amended from control dtb · 95fd9772
      Rasmus Villemoes authored and Tom Rini's avatar Tom Rini committed
      
      It can be useful to use the same U-Boot binary for multiple purposes,
      say the normal one, one for developers that allow breaking into the
      U-Boot shell, and one for use during bootstrapping which runs a
      special-purpose bootcmd. Or one can have several board variants that
      can share almost all boot logic, but just needs a few tweaks in the
      variables used by the boot script.
      
      To that end, allow the control dtb to contain a /config/enviroment
      node (or whatever one puts in fdt_env_path variable), whose
      property/value pairs are used to update the run-time environment after
      it has been loaded from its persistent location.
      
      The indirection via fdt_env_path is for maximum flexibility - for
      example, should the user wish (or board logic dictate) that the values
      in the DTB should no longer be applied, one simply needs to delete the
      fdt_env_path variable; that can even be done automatically by
      including a
      
        fdt_env_path = "";
      
      property in the DTB node.
      
      Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Acked-by: Joe Hershberger's avatarJoe Hershberger <joe.hershberger@ni.com>
      95fd9772
  3. Apr 23, 2021
  4. Apr 16, 2021
    • Patrick Delaunay's avatar
      env: sf: remove the static env_flash variable · ecf15442
      Patrick Delaunay authored and Tom Rini's avatar Tom Rini committed
      
      As the the SPI flash is probed and is released in each ENV sf function
      the env_flash no more need to be static.
      
      This patch move this device handle as local variable of each function and
      simplify the associated code (env_flash is never == NULL when
      setup_flash_device is called).
      
      Signed-off-by: Patrick Delaunay's avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
      ecf15442
    • Patrick Delaunay's avatar
      env: sf: add missing spi_flash_free · c2d00364
      Patrick Delaunay authored and Tom Rini's avatar Tom Rini committed
      
      Free the SPI resources by calling spi_flash_free() in each env sf
      function to avoid issue for other SPI users.
      
      Signed-off-by: Patrick Delaunay's avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
      c2d00364
    • Patrick Delaunay's avatar
      env: sf: add support of command env erase · 25d90ad4
      Patrick Delaunay authored and Tom Rini's avatar Tom Rini committed
      
      Add support of opts erase for env in SPI flash;
      this opts is used by command 'env erase'.
      
      This command only fills the env offset by 0x0 (bit flip to 0) and
      the saved environment becomes invalid (with bad CRC).
      
      It doesn't erase the sector here to avoid issue when the sector
      is larger than the env (i.e. embedded when
      CONFIG_ENV_SECT_SIZE > CONFIG_ENV_SIZE).
      
      The needed sector erase will be managed in the next "env save" command,
      using the opt ".save", before to update the environment in SPI flash.
      
      Signed-off-by: Patrick Delaunay's avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
      25d90ad4
    • Patrick Delaunay's avatar
      env: sf: update the use of macro ENV_SAVE_PTR · e41f55b3
      Patrick Delaunay authored and Tom Rini's avatar Tom Rini committed
      
      Remove CONFIG_IS_ENABLED(SAVEENV) as it is already tested in
      the ENV_SAVE_PTR macro.
      
      Signed-off-by: Patrick Delaunay's avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
      e41f55b3
    • Patrick Delaunay's avatar
      env: add ENV_ERASE_PTR macro · 1af031ac
      Patrick Delaunay authored and Tom Rini's avatar Tom Rini committed
      
      Add ENV_ERASE_PTR macro to handle erase opts and remove the associated
      ifdef.
      
      This patch is a extension of previous commit 82b2f413 ("env_internal.h:
      add alternative ENV_SAVE_PTR macro").
      
      Signed-off-by: Patrick Delaunay's avatarPatrick Delaunay <patrick.delaunay@foss.st.com>
      1af031ac
    • Marek Vasut's avatar
      env: Fix invalid env handling in env_init() · 5557eec0
      Marek Vasut authored and Tom Rini's avatar Tom Rini committed
      
      This fixes the case where there are multiple environment drivers, one of
      them is the default environment one, and it is followed by an environment
      driver which does not implement .init() callback. The default environment
      driver sets gd->env_valid to ENV_INVALID and returns 0 from its .init()
      callback implementation, which is valid behavior for default environment.
      
      Since the subsequent environment driver does not implement .init(), it
      also does not modify the $ret variable in the loop. Therefore, the loop
      is exited with gd->env_valid=ENV_INVALID and ret=0, which means that the
      code further down in env_init() will not reset the environment to the
      default one, which is incorrect.
      
      This patch sets the $ret variable back to -ENOENT in case the env_valid
      is set to ENV_INVALID by an environment driver, so that the environment
      would be correctly reset back to default one, unless a subsequent driver
      loads a valid environment.
      
      Signed-off-by: default avatarMarek Vasut <marex@denx.de>
      Tested-By: default avatarTim Harvey <tharvey@gateworks.com>
      5557eec0
    • Brandon Maier's avatar
      env/fat.c: support redund environment · 2339f01a
      Brandon Maier authored and Tom Rini's avatar Tom Rini committed
      
      Signed-off-by: default avatarBrandon Maier <brandon.maier@rockwellcollins.com>
      CC: Joe Hershberger <joe.hershberger@ni.com>
      CC: Wolfgang Denk <wd@denx.de>
      2339f01a
    • Martin Fuzzey's avatar
      env: Fix warning when forcing environment without ENV_ACCESS_IGNORE_FORCE · 9636bf8b
      Martin Fuzzey authored and Tom Rini's avatar Tom Rini committed
      
      Since commit 0f036bf4 ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set")
      a warning message is displayed when setenv -f is used WITHOUT
      CONFIG_ENV_ACCESS_IGNORE_FORCE, but the variable is set anyway, resulting
      in lots of log pollution.
      
      env_flags_validate() returns 0 if the access is accepted, or non zero
      if it is refused.
      
      So the original code
      	#ifndef CONFIG_ENV_ACCESS_IGNORE_FORCE
      		if (flag & H_FORCE)
      			return 0;
      	#endif
      
      was correct, it returns 0 (accepts the modification) if forced UNLESS
      IGNORE_FORCE is set (in which case access checks in the following code
      are applied). The broken patch just added a printf to the force accepted
      case.
      
      To obtain the intent of the patch we need this:
      	if (flag & H_FORCE) {
      	#ifdef CONFIG_ENV_ACCESS_IGNORE_FORCE
      		printf("## Error: Can't force access to \"%s\"\n", name);
      	#else
      		return 0;
      	#endif
      	}
      
      Fixes: 0f036bf4 ("env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set")
      
      Signed-off-by: default avatarMartin Fuzzey <martin.fuzzey@flowbird.group>
      9636bf8b
    • Brandon Maier's avatar
      env: increment redund flag on read fail · b9c3052f
      Brandon Maier authored and Tom Rini's avatar Tom Rini committed
      
      If one of the reads fails when importing redundant environments (a
      single read failure), the env_flags wouldn't get initialized in
      env_import_redund(). If a user then calls saveenv, the new environment
      will have the wrong flags value. So on the next load the new environment
      will be ignored.
      
      While debugging this, I also noticed that env/sf.c was not correctly
      handling a single read failure, as it would not check the crc before
      assigning it to gd->env_addr.
      
      Having a special error path for when there is a single read failure
      seems unnecessary and may lead to future bugs. Instead collapse the
      'single read failure' error to be the same as a 'single crc failure'.
      That way env_check_redund() either passes or fails, and if it passes we
      are guaranteed to have checked the CRC.
      
      Signed-off-by: default avatarBrandon Maier <brandon.maier@rockwellcollins.com>
      CC: Joe Hershberger <joe.hershberger@ni.com>
      CC: Wolfgang Denk <wd@denx.de>
      CC: Heiko Schocher <hs@denx.de>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      b9c3052f
    • Rasmus Villemoes's avatar
      env: add CONFIG_ENV_SECT_SIZE_AUTO · bcb44f62
      Rasmus Villemoes authored and Tom Rini's avatar Tom Rini committed
      
      This is roughly the U-Boot side equivalent to commit
      e282c422 (tools: fw_env: use erasesize from MEMGETINFO ioctl). The
      motivation is the case where one has a board with several revisions,
      where the SPI flashes have different erase sizes.
      
      In our case, we have an 8K environment, and the flashes have erase
      sizes of 4K (newer boards) and 64K (older boards). Currently, we must
      set CONFIG_ENV_SECT_SIZE to 64K to make the code work on the older
      boards, but for the newer ones, that ends up wasting quite a bit of
      time reading/erasing/restoring the last 56K.
      
      At first, I wanted to allow setting CONFIG_ENV_SECT_SIZE to 0 to mean
      "use the erase size the chip reports", but that config
      option is used in a number of preprocessor conditionals, and shared
      between ENV_IS_IN_FLASH and ENV_IS_IN_SPI_FLASH.
      
      So instead, introduce a new boolean config option, which for now can
      only be used with ENV_IS_IN_SPI_FLASH. If left off, there's no change
      in behaviour.
      
      The only slightly annoying detail is that, when selected, the compiler
      is apparently not smart enough to see that the the saved_size and
      saved_offset variables are only used under the same "if (sect_size >
      CONFIG_ENV_SIZE)" condition as where they are computed, so we need to
      initialize them to 0 to avoid "may be used uninitialized" warnings.
      
      On our newer boards with the 4K erase size, saving the environment now
      takes 0.080 seconds instead of 0.53 seconds, which directly translates
      to that much faster boot time since our logic always causes the
      environment to be written during boot.
      
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      bcb44f62
    • Rasmus Villemoes's avatar
      env/sf.c: use a variable to hold the sector size · 4da7347d
      Rasmus Villemoes authored and Tom Rini's avatar Tom Rini committed
      
      As preparation for the next patch, use a local variable to represent
      the sector size. No functional change.
      
      Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
      4da7347d
  5. Feb 02, 2021
    • Simon Glass's avatar
      common: Drop asm/global_data.h from common header · 401d1c4f
      Simon Glass authored and Tom Rini's avatar Tom Rini committed
      
      Move this out of the common header and include it only where needed.  In
      a number of cases this requires adding "struct udevice;" to avoid adding
      another large header or in other cases replacing / adding missing header
      files that had been pulled in, very indirectly.   Finally, we have a few
      cases where we did not need to include <asm/global_data.h> at all, so
      remove that include.
      
      Signed-off-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
      Signed-off-by: default avatarTom Rini <trini@konsulko.com>
      401d1c4f
  6. Jan 29, 2021
  7. Jan 20, 2021
    • Michal Simek's avatar
      env: Remove all dependencies for SYS_REDUNDAND_ENVIRONMENT · 4e3fc5ef
      Michal Simek authored
      
      CONFIG_SYS_REDUNDAND_ENVIRONMENT is changing in env_internal.h how u-boot
      works with variables. struct environment_s has one byte flags property
      which also affects ENV_SIZE macro.
      
      I have reached the case where CONFIG_ENV_IS_NOWHERE is default setup
      but custom scripts can be designed in a way that u-boot is asked to
      import/export variables from/to file which can be in certain format.
      That's why also for this configuration make sense to enable
      CONFIG_SYS_REDUNDAND_ENVIRONMENT because it depends on environment file
      format.
      
      The patch is removing dependency on this configuration to support selecting
      environment file format without any specific dependency where variables are
      stored.
      
      Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Reviewed-by: default avatarTom Rini <trini@konsulko.com>
      4e3fc5ef
  8. Nov 19, 2020
  9. Nov 18, 2020
  10. Nov 03, 2020
    • Heiko Schocher's avatar
      env: sf: fix init function behaviour · 46ce9e77
      Heiko Schocher authored and Tom Rini's avatar Tom Rini committed
      
      Michael wrote:
      commit 92765f45 ("env: Access Environment in SPI flashes before
      relocation") at least breaks the Kontron sl28 board. I guess it also
      breaks others which use a (late) SPI environment.
      
      reason is, that env_init() sets the init bit, if there
      is no init function defined in an environment driver,
      and use default return value -ENOENT in this case
      later for setting the default environment.
      
      Change:
      Environment driver can now implement an init
      function and return, if this function does nothing,
      simply -ENOENT.
      
      env_init() now handles -ENOENT correct by setting the
      inited bit for the environment driver. And if there
      is no other environment driver whose init function
      returns 0, load than the default environment.
      
      This prevents that each environment driver needs to set the
      default environment.
      
      Fixes: 92765f45 ("env: Access Environment in SPI flashes before relocation")
      Reported-by: default avatarMichael Walle <michael@walle.cc>
      Tested-by: Michael Walle <michael@walle.cc> [For the SF environment]
      Signed-off-by: default avatarHeiko Schocher <hs@denx.de>
      46ce9e77
  11. Oct 30, 2020
  12. Oct 14, 2020
  13. Oct 09, 2020
  14. Sep 23, 2020
  15. Aug 27, 2020
  16. Aug 08, 2020
  17. Jul 31, 2020
Loading