23 May, 2019
2 commits
-
Solve compilation issue when cli_simple.o is used in SPL
and CONFIG_SPL_ENV_SUPPORT is not defined.env/built-in.o:(.data.env_htab+0xc): undefined reference to `env_flags_validate'
u-boot/scripts/Makefile.spl:384: recipe for target 'spl/u-boot-spl' failed
make[2]: *** [spl/u-boot-spl] Error 1
u-boot/Makefile:1649: recipe for target 'spl/u-boot-spl' failed
make[1]: *** [spl/u-boot-spl] Error 2Signed-off-by: Patrick Delaunay
-
Add arch stm32mp for ENV migration step and drop more
items from include/configs/xxx.h.Signed-off-by: Patrick Delaunay
10 May, 2019
1 commit
-
Fix the max frequency entry description, it's incorrect.
Signed-off-by: Marek Vasut
Cc: Chris Brandt
Cc: Jagan Teki
Cc: Tom Rini
12 Apr, 2019
1 commit
-
When booting using an SPL on am335x, if we want to support booting with
the boot ROM loader via USB (which uses RNDIS, making bootp and tftp
calls) we need to enable gadget eth in the SPL to load the main U-Boot
image. To enable CONFIG_SPL_ETH_SUPPORT, we must enable
CONFIG_SPL_ENV_SUPPORT as the environment is used by the eth support, but
we don't actually need to have environment variables saved in the SPL
environment. We do however have environment variables saved in the main
U-Boot image and enable CONFIG_ENV_OFFSET_REDUND (we are storing in raw
NAND). In such instances, even with the build config enabling both
CONFIG_CMD_SAVEENV and CONFIG_CMD_NAND, these options aren't set when
building the SPL, but CONFIG_ENV_OFFSET_REDUND still is.Don't check this configuration option for SPL builds to enable the above
configuration.Signed-off-by: Martyn Welch
Reviewed-by: Tom Rini
10 Apr, 2019
1 commit
-
Re-use the functions used to write/create a file, to support creation of a
symbolic link.
The difference with a regular file are small:
- The inode mode is flagged with S_IFLNK instead of S_IFREG
- The ext2_dirent's filetype is FILETYPE_SYMLINK instead of FILETYPE_REG
- Instead of storing the content of a file in allocated blocks, the path
to the target is stored. And if the target's path is short enough, no block
is allocated and the target's path is stored in ext2_inode.b.symlinkAs with regulars files, if a file/symlink with the same name exits, it is
unlinked first and then re-created.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Tom Rini
[trini: Fix ext4 env code]
Signed-off-by: Tom Rini
26 Mar, 2019
1 commit
-
This converts the following to Kconfig:
CONFIG_ENV_SPI_BUS
CONFIG_ENV_SPI_CS
CONFIG_ENV_SPI_MAX_HZ
CONFIG_ENV_SPI_MODEMost of time these value are not needed, CONFIG_SF_DEFAULT
with same value is used, so I introduced CONFIG_USE_ENV_SPI_*
to force the associated value for the environment.Signed-off-by: Patrick Delaunay
14 Mar, 2019
1 commit
-
This reverts commit 9a9d66f5eff0f443de4c2c6ca3e27771ed14b1b4.
because it breaks fw_setenv and U-Boot interworking, if
U-Boot environment is stored in a SPI-NOR.Reproduce it with:
boot linux with empty Environment and store a variable
with fw_setenv into it, the Environment is now filled
with 0xff:root@ckey5e:10:8e:~# hexdump -C /dev/mtd4
00000000 e9 e8 07 fa 01 62 6f 6f 74 63 6d 64 3d 72 75 6e |.....bootcmd=run|
[...]
00000f30 7d 00 75 62 69 62 6f 6f 74 76 6f 6c 3d 32 00 00 |}.ubibootvol=2..|
00000f40 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|Boot now U-Boot prints:
Loading Environment from SPI Flash... SF: Detected s25fl128l with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environmentReason is the above commit, as it only reads until \0\0
is found, and assumes the rest of the Environment
space is filled with 0x00, which is not the case when
saving an Environment under linux with fw_setenv.Signed-off-by: Heiko Schocher
Acked-by: Stefano Babic
27 Jan, 2019
1 commit
-
- snapdragon 820c improvements
- poplar updates
- DFU + SPL cleanups
- Improve the mediatek mmc driver
- Other minor cleanups / improvements
26 Jan, 2019
2 commits
-
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 d30ba2315ae3 ("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: d30ba2315ae3 ("u-boot: remove driver lookup loop from env_save()")
Signed-off-by: Sam Protsenko
Reviewed-by: Simon Goldschmidt -
Callers of env_import*() functions might want to check the case when we
have incorrect environment (with bad CRC). For example, when environment
location is being defined in env_load(), call chain may look like this:env_load() -> drv->load() = env_mmc_load() -> env_import()
Return code will be passed from env_import() all way up to env_load().
Right now both env_mmc_load() and env_import() return -EIO error code,
so env_load() can't differentiate between two cases:
1. Driver reports the error, because device is not accessible
2. Device is actually accessible, but environment is brokenLet's return -ENOMSG in env_import(), so we can distinguish two cases
mentioned above. It will make it possible to continue working with "bad
CRC" environment (like doing "env save"), instead of considering it not
functional (implemented in subsequent patch).Signed-off-by: Sam Protsenko
Reviewed-by: Simon Goldschmidt
25 Jan, 2019
1 commit
-
Join the party of some ARM boards and drop more
items from include/configs/xxx.h.Signed-off-by: Alexey Brodkin
Cc: Michal Simek
Cc: Simon Glass
Reviewed-by: Tom Rini
22 Jan, 2019
1 commit
-
Per Heiko the original changes were correct and something is misbehaving
on his hardware.This reverts commit 3d5931e5986a49c44cdab845c6751d845812e8d8.
Signed-off-by: Tom Rini
19 Jan, 2019
1 commit
-
commit 9a9d66f5eff0 ("env: add spi_flash_read_env function")
breaks Environment functionality, as it reads only
until 2 \0 are found, but fills the buffer with 0x0
instead 0xff which leads in an incorrect crc sum.Fix: init the read buffer with 0xff instead 0x00
Signed-off-by: Heiko Schocher
17 Jan, 2019
1 commit
-
The spi_flash_read_env function is a wrapper over spi_flash_read, which
enables the env to read multiple flash page size from flash until '\0\0'
is read or the end of env partition is reached. Instead of reading the
entire env size. When it reads '\0\0', it stops reading further the env
and assumes that the rest of env is '\0'.This is an optimization for large environments that contain few bytes
environment variables. In this case it doesn't need to read the entire
environment and only few pages.Signed-off-by: Horatiu Vultur
16 Jan, 2019
1 commit
-
Add the dollar_complete() function to auto-complete arguments starting
with a '$' and use it in the cmd_auto_complete() path such that all
args starting with a $ can be auto-completed based on the available env
vars.Signed-off-by: Boris Brezillon
[trini: Fix some linking problems]
Signed-off-by: Tom Rini
09 Jan, 2019
2 commits
-
Wrong env buffer was passed into sata write function, cause the saveenv
not work.Signed-off-by: Ye Li
-
The env location label ENVL_ESATA is missed in location tables, so
when we configure the ENV in SATA, u-boot fails to get correct env
location and cause boot hang in board_f.Signed-off-by: Ye Li
Reviewed-by: Peng Fan
05 Dec, 2018
2 commits
-
Defines env_sf_get_env_addr API to override sf environment address,
required to support multiple environment.Signed-off-by: Rajesh Bhagat
Reviewed-by: York Sun -
Define env_ptr as static in flash and nand env driver to
allow these to compile together.Signed-off-by: Rajesh Bhagat
Reviewed-by: York Sun
16 Oct, 2018
1 commit
-
Xilinx is introducing Versal, an adaptive compute acceleration platform
(ACAP), built on 7nm FinFET process technology. Versal ACAPs combine
Scalar Processing Engines, Adaptable Hardware Engines, and Intelligent
Engines with leading-edge memory and interfacing technologies to deliver
powerful heterogeneous acceleration for any application. The Versal AI
Core series has five devices, offering 128 to 400 AI Engines. The series
includes dual-core Arm Cortex™-A72 application processors, dual-core Arm
Cortex-R5 real-time processors, 256KB of on-chip memory with ECC, more
than 1,900 DSP engines optimized for high-precision floating point with
low latency.The patch is adding necessary infrastructure in place without enabling
platform which is done in separate patch.Signed-off-by: Michal Simek
19 Sep, 2018
1 commit
-
For some reason the spi_flash_probe_bus_cs() is called
inside the setup_flash_device() with zero values in place
of configurated SPI flash mode and maximum flash speed.
This code causes HALT error during startup environment
relocation on some platforms - namely Armada-38x-GP board.
Fix the function call by replacing zeros with the appropriate
values - CONFIG_ENV_SPI_MAX_HZ and CONFIG_ENV_SPI_MODE.Signed-off-by: Konstantin Porotchkin
Cc: Igal Liberman
Cc: Stefan Roese
Signed-off-by: Stefan Roese
25 Aug, 2018
1 commit
-
Add missing environment name for UBI, to prevent this NULL in output:
Loading Environment from ...
and rather have a valid UBI there:
Loading Environment from UBI...Signed-off-by: Marek Vasut
20 Aug, 2018
1 commit
-
There is no reason to have the same Kconfig options for different SoCs
separately. The patch is merging them together.Signed-off-by: Michal Simek
Acked-by: Maxime Ripard
[trini: Fix ENV_SIZE around ENV_IS_NOWHERE]
Signed-off-by: Tom RiniSigned-off-by: Tom Rini
11 Aug, 2018
1 commit
-
"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: Sam Protsenko
30 Jul, 2018
1 commit
-
When called with ENVOP_SAVE, env_get_location() only returns the
gd->env_load_location variable without actually checking for
the environment location and priority.This behaviour causes env_save() to fall into an infinite loop when
the low-level drv->save() call fails.The env_save() function should not loop through the environment
location list but it should save the environment into the location
stored in gd->env_load_location by the last env_load() call.Signed-off-by: Nicholas Faustini
Reviewed-by: Simon Goldschmidt
22 Jul, 2018
2 commits
-
Add Kconfig options SPL_ENV_* and TPL_ENV_* and simplify Makefile.
This allows SPL/TPL image has different environment setting from
full feature U-Boot.Signed-off-by: York Sun
-
%s/remove/remote/
Signed-off-by: Heinrich Schuchardt
21 Jul, 2018
1 commit
-
The error message should start with `## Error: ` so that it's easily
detectable by tests without needing to have a complex regexp for
matching all possible error message patterns.Let's add the `## Error: ` prefix to the error messages since it's the
one already in use.Suggested-by: Stephen Warren
Signed-off-by: Quentin Schulz
Reviewed-by: Simon Glass
Reviewed-by: Stephen Warren
Tested-by: Stephen Warren
20 Jul, 2018
3 commits
-
The function set_default_env() sets the hashtable flags for import_r().
Formally set_default_env() doesn't accept flags from its callers. In
practice the caller can (un)set the H_INTERACTIVE flag, but it has to be
done using the first character of the function's string argument. Other
flags like H_FORCE can't be set by the caller.Change the function to accept flags argument. The benefits are:
1. The caller will have to explicitly set the H_INTERACTIVE flag,
instead of un-setting it using a special char in a string.
2. Add the ability to propagate flags from the caller to himport(),
especially the H_FORCE flag from do_env_default() in nvedit.c that
currently gets ignored for "env default -a -f" commands.
3. Flags and messages will not be coupled together. A caller will be
able to set flags without passing a string and vice versa.Please note:
The propagation of H_FORCE from do_env_default() does not introduce any
functional changes, because currently himport_r() is set to destroy the
old environment regardless if H_FORCE flag is set or not. More changes
are needed to utilize the propagation of H_FORCE.Signed-off-by: Yaniv Levinsky
Acked-by: Igor Grinberg -
The function set_default_vars() in common.c adds H_INTERACTIVE to the
h_import() flag, but the function has no way of telling if the command
actually was user directed like this flag suggest. The flag should be
set by the calling function do_env_default() in nvedit.c instead, where
the command is certainty user directed.Move the H_INTERACTIVE flag from set_default_vars() to do_env_default().
Signed-off-by: Yaniv Levinsky
Acked-by: Igor Grinberg -
The env_flag in do_env_default() doesn't get propagated and therefore
gets ignored by himport_r(). This breaks to ability to "forcibly" reset
variables to their default values using the environment command.Scenario example of the problem:
# setenv kernel uImage
# setenv .flags kernel:so
# env default -f kernel
## Error: Can't overwrite "kernel"
himport_r: can't insert "kernel=zImage" into hash tableChange the call path so it will pass the flag correctly.
Signed-off-by: Yaniv Levinsky
Acked-by: Igor Grinberg
19 Jul, 2018
1 commit
-
This patch added support to enable CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET
and CONFIG_ENV_SECT_SIZE through Kconfig for Zynq and Zynqmp.Signed-off-by: Vipul Kumar
Signed-off-by: Michal Simek
13 Jun, 2018
2 commits
-
If ENV_IS_IN_EXT4 is set you shouldn't be able to select ENV_IS_NOWHERE.
Signed-off-by: Alex Kiernan
Reviewed-by: Simon Glass
Tested-by: Petr Vorel -
's/environemnt/environment/' and
's/Environemnt/Environment/'Signed-off-by: Shyam Saini
07 May, 2018
1 commit
-
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: Tom Rini
28 Apr, 2018
1 commit
-
We have a large number of places where while we historically referenced
gd in the code we no longer do, as well as cases where the code added
that line "just in case" during development and never dropped it.Signed-off-by: Tom Rini
17 Apr, 2018
2 commits
-
For CONFIG_ENV_FAT_INTERFACE != 'mmc' a link error
env/fat.c:93: undefined reference to `mmc_initialize'
occurs if CONFIG_MMC_SUPPORT is not enabled.Fixes: 26862b4a40c3 ("env: mmc/fat/ext4: make sure that the MMC sub-system
is initialized before using it")
Signed-off-by: Heinrich Schuchardt -
Relocate env drivers if manual relocation is enabled. This
patch fixes the issue of u-boot hang incase if env is
present in any of the flash devices.Signed-off-by: Siva Durga Prasad Paladugu
Signed-off-by: Michal Simek
Reviewed-by: Simon Glass
09 Apr, 2018
1 commit
-
Convert CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG to Kconfig
Signed-off-by: Alex Kiernan
Reviewed-by: Lukasz Majewski
Reviewed-by: Petr Vorel
Reviewed-by: Petr Vorel
07 Apr, 2018
1 commit
-
Use CONFIG_IS_ENABLED to see if CONFIG_BLK is enabled. Otherwise
SPL compilation breaks on boards which do have CONFIG_BLK enabled but
not DM_MMC for the SPL as follows:env/mmc.c: In function ‘init_mmc_for_env’:
env/mmc.c:164:6: warning: implicit declaration of function ‘blk_get_from_parent’; did you mean ‘efi_get_ram_base’? [-Wimplicit-function-declaration]
if (blk_get_from_parent(mmc->dev, &dev))
^~~~~~~~~~~~~~~~~~~
efi_get_ram_base
env/mmc.c:164:29: error: ‘struct mmc’ has no member named ‘dev’
if (blk_get_from_parent(mmc->dev, &dev))
^~Signed-off-by: Sjoerd Simons
Reviewed-by: Simon Glass