summaryrefslogtreecommitdiff
path: root/env
Commit message (Collapse)AuthorAgeFilesLines
* env: Allow VPL environment to be nowhereSimon Glass2023-03-021-0/+10
| | | | | | Add an option to put the VPL environment nowhere (not in storage). Signed-off-by: Simon Glass <sjg@chromium.org>
* env: mmc: Apply GPT only on eMMC user HW partitionMarek Vasut2023-02-231-4/+8
| | | | | | | | | | | | | | 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: 80105d8fd52 ("env: mmc: select GPT env partition by type guid") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Couple networking-related variable flags to CONFIG_NETJan Kiszka2023-02-101-5/+5
| | | | | | | | | Boards may set networking variables programmatically, thus may have CONFIG_NET on but CONFIG_CMD_NET off. The IOT2050 is an example. CC: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* env: Complete generic support for writable listJan Kiszka2023-02-102-0/+9
| | | | | | | | | | | | | | | | | | This completes what 890feecaab72 started by selecting ENV_APPEND and loading the default env before any other sources. This ensures that load operations pick up all non-writable vars from the default env and only permitted parts from other locations according to the regular priorities. With this change, boards only need to define the list of writable variables but no longer have to provide a custom env_get_location implementation. CC: Joe Hershberger <joe.hershberger@ni.com> CC: Marek Vasut <marex@denx.de> CC: Stefan Herbrechtsmeier <stefan.herbrechtsmeier-oss@weidmueller.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Marek Vasut <marex@denx.de>
* env: Drop ENV_IS_IN_SATASimon Glass2023-02-073-126/+0
| | | | | | This is not used anywhere, so drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
* env: mmc: Fix offset issue for env saveYe Li2023-02-061-4/+4
| | | | | | | | | Fix the issue in commit 46c9016 ("env: mcc: Drop unnecessary #ifdefs") If CONFIG_SYS_REDUNDAND_ENVIRONMENT is not defined, the offset value becomes undetermined, so write env to unexpected offset. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
* env: add failing trace in env_erasePatrick Delaunay2023-01-111-2/+6
| | | | | | | | | | | | Add trace in env save to indicate any errors to end user and avoid silent output when the command 'env erase' is not executed as it is done in env_save with commit 8968288cb477 ("env: add failing trace in env_save") Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* env: ubi: add support of command env erasePatrick Delaunay2023-01-111-0/+40
| | | | | | | | | | | | | | | | | Add support of opts erase for ubi env backend, this opts is used by command 'env erase'. This command only zero-fill the env UBI volume CONFIG_ENV_UBI_VOLUME and CONFIG_ENV_UBI_VOLUME_REDUND, so the saved environment becomes invalid. This patch introduces a local define ENV_UBI_VOLUME_REDUND only to avoid #if in the code, as CONFIG_ENV_UBI_VOLUME_REDUND is only defined when CONFIG_SYS_REDUNDAND_ENVIRONMENT is defined. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Heiko Schocher <hs@denx.de>
* env: mmc: cosmetic: remove unused macro STR(X)Patrick Delaunay2023-01-101-3/+0
| | | | | | | | Remove the unused macro STR(X) since the commit 2b2f727500dc ("env: mmc: allow support of mmc_get_env_dev with OF_CONTROL") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* env: mmc: add debug message when mmc-env-partition is not foundPatrick Delaunay2023-01-101-0/+1
| | | | | | | | | Add a debug message to indicate a potential issue when "u-boot,mmc-env-partition" is present in config node of device tree but this partition name is not found in the mmc device. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* env: mmc: select GPT env partition by type guidPatrick Delaunay2023-01-101-1/+18
| | | | | | | | | | | | | | | | Since commit c0364ce1c695 ("doc/README.gpt: define partition type GUID for U-Boot environment"), a specific type GUID can be used to indicate the U-Boot environment partition on the device with GPT partition table. This patch uses this type GUID to found the env partition as fallback when the partition name property "u-boot,mmc-env-partition" is not present in config node or if the indicated partition name is not found. The mmc_offset_try_partition() function is reused, it selects the first partition with the correct type GUID when the parameter 'str' is NULL. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* env: mmc: add CONFIG_ENV_MMC_USE_DTPatrick Delaunay2023-01-102-0/+23
| | | | | | | | | | | | | | | | Add a new config CONFIG_ENV_MMC_USE_DT to force configuration of the U-Boot environment offset with device tree config node. This patch avoids issues when several CONFIG_ENV_IS_IN_XXX are activated, the defconfig file uses the same value for CONFIG_ENV_OFFSET or CONFIG_ENV_OFFSET_REDUND for the several ENV backends (SPI_FLASH, EEPROM NAND, SATA, MMC). After this patch a bad offset value is not possible when the selected partition in device tree is not found. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* env: mcc: fix compilation error with ENV_IS_EMBEDDEDPatrick Delaunay2023-01-101-5/+7
| | | | | | | | | | When ENV_IS_EMBEDDED is enabled, ret is not defined but is used as a return value in env_mmc_load(). This patch correct this issue and simplify the existing code, test only one time #if defined(ENV_IS_EMBEDDED) and not in the function. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* env: mcc: Drop unnecessary #ifdefsPatrick Delaunay2023-01-101-56/+64
| | | | | | | | | | | | | | | This file has a lot of conditional code and much of it is unnecessary. Clean this up to reduce the number of build combinations. This patch replaces the test on CONFIG_ENV_OFFSET_REDUND for the more coherent CONFIG_SYS_REDUNDAND_ENVIRONMENT. This patch also corrects a compilation issue in init_mmc_for_env() when CONFIG_SYS_MMC_ENV_PART is not activated, env_mmc_orig_hwpart is not defined. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* env: mmc: introduced ENV_MMC_OFFSETPatrick Delaunay2023-01-101-4/+20
| | | | | | | | Introduce ENV_MMC_OFFSET defines. It is a preliminary step to the next patches to simplify the code. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* global: Migrate CONFIG_EXTRA_ENV_SETTINGS to CFGTom Rini2022-12-231-2/+2
| | | | | | Perform a simple rename of CONFIG_EXTRA_ENV_SETTINGS to CFG_EXTRA_ENV_SETTINGS Signed-off-by: Tom Rini <trini@konsulko.com>
* Convert CONFIG_OVERWRITE_ETHADDR_ONCE to KconfigTom Rini2022-12-221-0/+9
| | | | | | | This converts the following to Kconfig: CONFIG_OVERWRITE_ETHADDR_ONCE Signed-off-by: Tom Rini <trini@konsulko.com>
* env: eeprom: Remove CONFIG_I2C_ENV_EEPROM_BUS supportTom Rini2022-12-222-58/+8
| | | | | | | This functionality is currently unused, and has not been migrated to using DM_I2C, even. Drop this. Signed-off-by: Tom Rini <trini@konsulko.com>
* Convert CONFIG_HOSTNAME et al to KconfigTom Rini2022-12-221-0/+10
| | | | | | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_GATEWAYIP CONFIG_HOSTNAME CONFIG_IPADDR CONFIG_NETMASK CONFIG_ROOTPATH CONFIG_SERVERIP CONFIG_UBOOTPATH To do this, we introduce a CONFIG_USE_ form of each of the above and change include/env_default.h to test for that to be set before setting a value. Further, we don't want to stringify the IP address related values as they are now properly strings via Kconfig. Signed-off-by: Tom Rini <trini@konsulko.com>
* env: nvram: Drop CONFIG_SYS_NVRAM_ACCESS_ROUTINETom Rini2022-12-221-40/+2
| | | | | | | This option is unused anywhere and likely untested for quite a long while. Drop this support code. Signed-off-by: Tom Rini <trini@konsulko.com>
* env: Rework ENV_IS_EMBEDDED and related logic slightlyTom Rini2022-12-222-2/+1
| | | | | | | | | | | | | | | - Drop CONFIG_BUILD_ENVCRC as this is never set directly but instead means ENV_IS_EMBEDDED, so reference that in code and rename the Makefile usage to BUILD_ENVCRC. - Remove extra-$(CONFIG_ENV_IS_EMBEDDED) line as it could never be true, and likely why there is an extra- line for CONFIG_ENV_IS_IN_FLASH (the only use case today of embedded environments). - With these slight changes we can then see that using the calculated symbol of ENV_IS_EMBEDDED is the right thing to use in any code which needs to know this situation and can remove CONFIG_ENV_IS_EMBEDDED entirely. Signed-off-by: Tom Rini <trini@konsulko.com>
* global: Move remaining CONFIG_SYS_* to CFG_SYS_*Tom Rini2022-12-052-2/+2
| | | | | | | | | | The rest of the unmigrated CONFIG symbols in the CONFIG_SYS namespace do not easily transition to Kconfig. In many cases they likely should come from the device tree instead. Move these out of CONFIG namespace and in to CFG namespace. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: core: Rename ofnode_get_property_by_prop()Simon Glass2022-09-291-1/+1
| | | | | | | The current name is quite unwieldy. Change it to use an ofprop_ prefix and shorten it. Fix the return-value comment while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: core: Rename ofnode_get_first/next_property()Simon Glass2022-09-291-2/+2
| | | | | | | Drop the 'get' in these names since it does not fit with the rest of the API. Signed-off-by: Simon Glass <sjg@chromium.org>
* arm64: versal-net: Add support for Versal NET platformMichal Simek2022-09-261-3/+3
| | | | | | | | | | | | Versal NET platform is based on Versal chip which is reusing a lot of IPs. For more information about new IPs please take a look at DT which describe currently supported devices. The patch is adding architecture and board support with soc detection algorithm. Generic setting should be very similar to Versal but it will likely diverge in longer run. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/320206853dc370ce290a4e7b6d0bb26b05206021.1663589964.git.michal.simek@amd.com
* cyclic: Use schedule() instead of WATCHDOG_RESET()Stefan Roese2022-09-181-1/+1
| | | | | | | | | | Globally replace all occurances of WATCHDOG_RESET() with schedule(), which handles the HW_WATCHDOG functionality and the cyclic infrastructure. Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Rini <trini@konsulko.com> [am335x_evm, mx6cuboxi, rpi_3,dra7xx_evm, pine64_plus, am65x_evm, j721e_evm]
* blk: Switch over to using uclass IDsSimon Glass2022-09-161-2/+2
| | | | | | | | | | | | We currently have an if_type (interface type) and a uclass id. These are closely related and we don't need to have both. Drop the if_type values and use the uclass ones instead. Maintain the existing, subtle, one-way conversion between UCLASS_USB and UCLASS_MASS_STORAGE for now, and add a comment. Signed-off-by: Simon Glass <sjg@chromium.org>
* xilinx: Add env redund offsetT Karthik Reddy2022-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ENV_OFFSET_REDUND config is by default set to 0 for flashes. Saving the env variables is overwriting data at 0 offset, which is wrong. So add default redund env offset for Zynq, ZynqMP, Versal and microblaze platforms. Configured ENV_OFFSET_REDUND offsets by ENV_OFFSET + (2 * ENV_SIZE). In case of versal, we configured ENV_OFFSET_REDUND at 0x7F00000 instead of 0x7F80000. As BOOT_SCRIPT_OFFSET is already configured at 0x7F80000. Added ENV_OFFSET_REDUND in Kconfig for microblaze due to dependency of ENV_IS_IN_SPI_FLASH config. Below table specifies platform specific env and env redund offsets. PLAT ENV_OFFSET ENV_OFFSET_REDUND ---- ---------- ----------------- ZYNQ 0xE0000 0xE40000 ZYNQMP 0x1E00000 0x1E80000 VERSAL 0x7F40000 0x7F00000 MICROBLAZE 0x1080000 0x10C0000 Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com> Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/92656dc08f0f5a749d62b71ca6e77fe1be72e9e0.1661340204.git.michal.simek@amd.com
* Audit <flash.h> inclusionTom Rini2022-08-042-2/+1
| | | | | | | | | | | | A large number of files include <flash.h> as it used to be how various SPI flash related functions were found, or for other reasons entirely. In order to migrate some further CONFIG symbols to Kconfig we need to not include flash.h in cases where we don't have a NOR flash of some sort enabled. Furthermore, in cases where we are in common code and it doesn't make sense to try and further refactor the code itself in to new files we need to guard this inclusion. Signed-off-by: Tom Rini <trini@konsulko.com>
* Add SCSI scan for ENV in EXT4 or FATRogier Stam2022-07-082-1/+12
| | | | | | | | | | | | When having environment stored in EXT4 or FAT and using an AHCI or SCSI device / partition the scan would not be performed early enough and hence the device would not be recognized. This change adds the scan when the interface is "scsi" in a similar way to mmc_initialize. Signed-off-by: Rogier Stam <rogier@unrailed.org> Reviewed-by: Pali Rohár <pali@kernel.org>
* Convert CONFIG_ENV_RANGE to KconfigTom Rini2022-06-282-16/+10
| | | | | | | | | | This converts the following to Kconfig: CONFIG_ENV_RANGE Now that this is in Kconfig we can enforce a minimum size and so remove the check in C code to ensure range is larger than size. Signed-off-by: Tom Rini <trini@konsulko.com>
* Convert CONFIG_ENV_MIN_ENTRIES et al to KconfigTom Rini2022-06-281-0/+16
| | | | | | | | | This converts the following to Kconfig: CONFIG_ENV_MIN_ENTRIES CONFIG_ENV_MAX_ENTRIES Cc: Michal Simek <michal.simek@amd.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* env: mmc : align erase address and size on erase_grp_sizePatrick Delaunay2022-06-151-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On eMMC device, the erase_grp_size > 1 so the address and size for the erase block command in env/mmc.c can be unaligned on erase group size and some strange trace occurs and the result is not guarantee by MMC devices. The SD-Card behavior doesn't change as erase_grp_size = 1 for SD-Card. For example, on eMMC present on STM32MP15C-EV1 and before the patch: STM32MP> env erase Erasing Environment on MMC... Caution! Your devices Erase group is 0x400 The erase range would be change to 0x2000~0x27ff 16 blocks erased: OK Caution! Your devices Erase group is 0x400 The erase range would be change to 0x2000~0x23ff 16 blocks erased: OK OK After this patch: STM32MP> env erase Erasing Environment on MMC... 1024 blocks erased at 0x2000: OK 1024 blocks erased at 0x2000: OK OK Here the 2 copies of U-Boot environment are in the same devices Erase group: it is erased twice. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* spi: spi_flash_probe_bus_cs() rely on DT for spi speed and modePatrice Chotard2022-05-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, spi_flash_probe_bus_cs() relies on DT for spi speed and mode and logically calls spi_get_bus_and_cs(). In case spi mode and speed are not read from DT, make usage of spi_flash_probe() instead. To sum-up: - Previous call tree was: spi_flash_probe() -> spi_flash_probe_bus_cs() -> spi_get_bus_and_cs() - Current call tree is: spi_flash_probe() -> _spi_get_bus_and_cs() spi_flash_probe_bus_cs() -> spi_get_bus_and_cs() This patch impacts the following : - cmd/sf.c: if spi mode and/or speed is passed in argument of do_spi_flash_probe(), call spi_flash_probe() otherwise call spi_flash_probe_bus_cs(). - drivers/net/fm/fm.c: as by default spi speed and mode was set to 0 and a comment indicates that speed and mode are read from DT, use spi_flash_probe_bus_cs(). - drivers/net/pfe_eth/pfe_firmware.c: spi speed and mode are not read from DT by all platforms using this driver, so keep legacy and replace spi_flash_probe_bus_cs() by spi_flash_probe(); - drivers/net/sni_netsec.c : spi speed and mode are not read from DT, so replace spi_flash_probe_bus_cs() by spi_flash_probe(). - drivers/usb/gadget/max3420_udc.c: Can't find any platform which make usage of this driver, nevertheless, keep legacy and replace spi_get_bus_and_cs() by _spi_get_bus_and_cs(). - env/sf.c: a comment indicates that speed and mode are read from DT. So use spi_flash_probe_bus_cs(). Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Marek Behun <marek.behun@nic.cz> Cc: Jagan Teki <jagan@amarulasolutions.com> Cc: Vignesh R <vigneshr@ti.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Stefan Roese <sr@denx.de> Cc: "Pali Rohár" <pali@kernel.org> Cc: Konstantin Porotchkin <kostap@marvell.com> Cc: Igal Liberman <igall@marvell.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Pratyush Yadav <p.yadav@ti.com> Cc: Sean Anderson <seanga2@gmail.com> Cc: Anji J <anji.jagarlmudi@nxp.com> Cc: Biwen Li <biwen.li@nxp.com> Cc: Priyanka Jain <priyanka.jain@nxp.com> Cc: Chaitanya Sakinam <chaitanya.sakinam@nxp.com>
* env: sf: Allow to use env_sf_init_addr() at any stagePali Rohár2022-05-021-11/+11
| | | | | | | | | | | In some cases it makes sense to use env_sf_init_addr() also in SPL mode. Allow it for boards by providing custom implementation of weak function env_sf_get_env_addr(). When this function returns NULL it signals that address is invalid, like config option CONFIG_ENV_ADDR. There is no change in default behavior or in config options. Signed-off-by: Pali Rohár <pali@kernel.org>
* env: Implement lower priority arch_env_get_location()Marek Vasut2022-04-211-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently there is only one way to override desired environment location, by implementing env_get_location(). This is increasingly being conflated both on board level and architecture level, which leads to a problem on boards where this function is already implemented on architecture level, since those boards have no way to override this environment location on board level anymore. Implement arch_env_get_location() function which is architecture specific and should only ever be implemented in architecture code. This function has lower priority than env_get_location(), which should only ever be implemented in board code, and which overrides the arch_env_get_location() architecture environment selection. This way, architecture can define its default environment chooser, while board can now override it as needed at all times. There is no functional change, since env_get_location() simply returns arch_env_get_location(), and arch_env_get_location() implements the current env_get_location() default content. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Adam Ford <aford173@gmail.com> Cc: Fabio Estevam <festevam@denx.de> Cc: Marek Behún <marek.behun@nic.cz> Cc: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Stefano Babic <sbabic@denx.de> Cc: Tim Harvey <tharvey@gateworks.com> Cc: Tom Rini <trini@konsulko.com> Cc: Tommaso Merciai <tomm.merciai@gmail.com> Cc: Vladimir Oltean <vladimir.oltean@nxp.com>
* Revert "env: Load env when ENV_IS_NOWHERE is only location selected"Marek Vasut2022-04-101-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8d61237edbf6314a701cf78da2c5893a73ff5438. This commit broke environment on literally every board I have access to, with this revert in place, environment works as it should again. The problem I observe with this patch is that saved environment in either SPI NOR or eMMC is never used, the system always falls back to default environment. The 'saveenv' command does succeed, but then after reset, the default env is again used. Furthermore, the commit introduced duplicate code in env_init(), this: " if (!prio) { gd->env_addr = (ulong)&default_environment[0]; gd->env_valid = ENV_INVALID; return 0; } if (ret == -ENOENT) { gd->env_addr = (ulong)&default_environment[0]; gd->env_valid = ENV_INVALID; return 0; } " Furthermore, the commit is missing DCO SoB line. Also note that upstream does not support UltraZed EG board, so this might have been a patch pulled from downstream which did depend on some other downstream behavior. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Felix.Vietmeyer@jila.colorado.edu <felix.vietmeyer@jila.colorado.edu> Cc: Tom Rini <trini@konsulko.com>
* env: fat: Allow overriding interface, device and partitionHe Yong2022-04-071-15/+19
| | | | | | | For platform which can boot on different device, this allows to override interface, device and partition from board code Signed-off-by: He Yong <hyyoxhk@163.com>
* env: Load env when ENV_IS_NOWHERE is only location selectedFelix.Vietmeyer@jila.colorado.edu2022-04-071-6/+7
| | | | | | | | | | | | | | | This patch prevent u-boot from hanging on a UltraZed EG board (zynqmp). Without the patch, (drv = env_driver_lookup(ENVOP_INIT, prio)) evaluates to 0, causing prio = 0 Then, (!prio) is hit, returning -ENODEV causing a stall. With the patch, instead of returning -ENODEV and causing a stall, we set gd->env_addr (is this really needed?) and then mark gd->env_valid = ENV_INVALID to use the default env.
* Convert CONFIG_ETHPRIME to KconfigTom Rini2022-03-181-0/+12
| | | | | | | | | | | This converts the following to Kconfig: CONFIG_ETHPRIME This is also done by adding a gating Kconfig option, CONFIG_USE_ETHPRIME similar to other options that are not always set and control environment variables. Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge tag 'v2022.04-rc4' into nextTom Rini2022-03-141-2/+5
|\ | | | | | | Prepare v2022.04-rc4
| * env: sunxi: enable ENV_IS_IN_SPI_FLASHAndre Przywara2022-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that sunxi uses CONFIG_SPI more sanely, and can also now properly load the environment from SPI flash, let's enable the symbol that actually considers the SPI flash when accessing the environment. As this symbol depends on CONFIG_SPI, which we now only enable if the board has a SPI flash, we can make if "default y" for all Allwinner boards. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
| * env: sunxi: Define location in SPI flashAndre Przywara2022-03-101-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To allow loading and storing the environment from SPI flash, adjust the raw offset variables for Allwinner boards to make sense there. U-Boot (including SPL and other blobs) is loaded from the beginning of SPI flash, so move the environment location as far back as possible, to not create unnecessary limits. As those offsets are shared with (now mostly unused) raw MMC environment, we should respect the common one megabyte limit, which also makes sense on SPI flash. So limit the environment for those raw locations to 64KB, and place it just below 1MB (@960KB). Those values are currently unused, unless someone forcibly enables the raw MMC environment. In this case it would break as of now, as the current offset of 544KB is far too low for the current (arm64) U-Boot proper. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
* | Convert CONFIG_BOOTFILE to KconfigTom Rini2022-03-031-0/+13
|/ | | | | | | This converts the following to Kconfig: CONFIG_BOOTFILE Signed-off-by: Tom Rini <trini@konsulko.com>
* doc: replace @return by Return:Heinrich Schuchardt2022-01-191-3/+3
| | | | | | | | | | | | Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* env: fat: Add new lines at the end of print statementsPeter Robinson2022-01-141-4/+4
| | | | | | | | Add some new line feeds at the end of print messages to make things easier to read on the console. The other env options do this so this is just an omission for FAT env. Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
* Convert CONFIG_ENV_SPI_BUS et al to KconfigTom Rini2021-12-271-31/+8
| | | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_ENV_SPI_BUS CONFIG_ENV_SPI_CS CONFIG_ENV_SPI_MAX_HZ CONFIG_ENV_SPI_MODE As part of this, we use Kconfig to provide the defaults now that were done in include/spi_flash.h. We also in some cases change from using CONFIG_ENV_SPI_FOO to CONFIG_SF_DEFAULT_FOO as those were the values in use anyhow as ENV was not enabled. Signed-off-by: Tom Rini <trini@konsulko.com>
* bootm: Tidy up use of autostart env varSimon Glass2021-11-161-0/+5
| | | | | | | | | | | | | | | This has different semantics in different places. Go with the bootm method and put it in a common function so that the behaviour is consistent in U-Boot. Update the docs. To be clear, this changes the way that 'bootelf' and standalone boot work. Before, if autostart was set to "fred" or "YES", for example, they would consider that a "yes". This may change behaviour for some boards, but the only in-tree boards which mention autostart use "no" to disable it, which will still work. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Wolfgang Denk <wd@denx.de>
* env: Allow U-Boot scripts to be placed in a .env fileSimon Glass2021-11-162-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At present U-Boot environment variables, and thus scripts, are defined by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text to this file and dealing with quoting and newlines is harder than it should be. It would be better if we could just type the script into a text file and have it included by U-Boot. Add a feature that brings in a .env file associated with the board config, if present. To use it, create a file in a board/<vendor> directory, typically called <board>.env and controlled by the CONFIG_ENV_SOURCE_FILE option. The environment variables should be of the form "var=value". Values can extend to multiple lines. See the README under 'Environment Variables:' for more information and an example. In many cases environment variables need access to the U-Boot CONFIG variables to select different options. Enable this so that the environment scripts can be as useful as the ones currently in the board config files. This uses the C preprocessor, means that comments can be included in the environment using /* ... */ Also support += to allow variables to be appended to. This is needed when using the preprocessor. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Tested-by: Marek Behún <marek.behun@nic.cz>
* env: Simplify env_get_default()Marek Behún2021-11-131-21/+24
| | | | | | | | | Instead of pretending that we don't have environment to force searching default environment in env_get_default(), get the data from the default_environment[] buffer directly. Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>