u-boot/board
Derek LaHousse 3a68fda33f arm: mvebu: Espressobin: Fix default env variables
Default env variables on Espressobin boards are broken since commit c4df0f6f31
("arm: mvebu: Espressobin: Set default value for $fdtfile env variable") as well
as the 'env default -a' command.

The algorithm to find free space in the default_environment[] array returns
after the first env variable instead of the correct position of the last
variable, where there is allocated free space.

This causes that U-Boot board_late_init() function to overwrite a portion of the
default environment with $ethXaddr and $fdtfile variables immediately after the
first env variable and so it is overwriting other variables.

This patch also adds an additional null byte to terminate the environment array.

But U-Boot board_late_init() function do not fill this nul byte explicitly. And
because of that, U-Boot is later trying to interpret remaining buffer as a
continuation of variable list. Normally buffer should be empty but due to the
above issue, it contains garbage from remaining env variables.

For example 'env default -a' command results in damaging variable names. It was
observed that scritaddr variable name was changed to criptaddr (without leading
's').

This bug was reported and discussed on the Armbian forum:
https://forum.armbian.com/topic/19564-making-espressobin-v7-work-in-2022/?do=findComment&comment=138136

Fix these issues in two steps:

1) Change code which finds free space for dynamic env variables in
default_environment[] array by jumping to the end of the variable list instead
of jumping after the first defined variable. [By Derek]

2) Add code which appends terminating nul byte as indication of the end of the
env list, after the last nul term env string. [By Pali]

Fixes: c4df0f6f31 ("arm: mvebu: Espressobin: Set default value for $fdtfile env variable")
Signed-off-by: Derek LaHousse <derek@seaofdirac.org>
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Stefan Roese <sr@denx.de>
2022-12-12 07:36:04 +01:00
..
abilis/tb100
advantech For 2022.01 2022-11-14 09:33:36 -05:00
alliedtelesis arm: mvebu: mbus: Fix mbus driver to work also after U-Boot relocation 2022-08-23 12:35:37 +02:00
altera global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
amarula/vyasa-rk3288
amlogic MAINTAINERS: Update email of Neil Armstrong 2022-08-20 16:17:50 -04:00
AndesTech/ax25-ae350 riscv: ae350: Check firmware_fdt_addr header 2022-10-20 15:26:31 +08:00
aries/mcvevk global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
aristainetos video: Drop use of the lcd header file 2022-10-30 20:07:17 +01:00
armadeus/opos6uldev opos6uldev: Migrate to using CONFIG_EXTRA_ENV_TEXT 2022-06-28 17:11:48 -04:00
armltd Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
aspeed
astro/mcf5373l cyclic: Use schedule() instead of WATCHDOG_RESET() 2022-09-18 10:26:33 +02:00
atmel video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
avionic-design
beacon imx: imx8mm-beacon: Enable USB booting via SDP 2022-11-07 22:45:05 +01:00
beckhoff/mx53cx9020 video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
birdland/bav335x
bitmain/antminer_s9
bluewater/gurnard video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
bosch global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
boundary/nitrogen6x Fix usage of CONFIG_PREBOOT 2022-11-21 09:23:00 -05:00
broadcom Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
bsh bsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2 boards 2022-09-18 22:56:18 +02:00
bticino/mamoj
buffalo/lsxl board: lsxl: update the README 2022-08-23 12:40:34 +02:00
BuR BuR: ronetix: siemens: Drop old LCD code 2022-10-30 20:07:17 +01:00
BuS/eb_cpu5282 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
cadence/xtfpga
calao/usb_a9263
cavium/thunderx
cei/cei-tk1-som
chipspark/popmetal_rk3288
cloudengines
cobra5272 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
compal/paz00 video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
compulab global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
comtrend
congatec For 2022.01 2022-11-14 09:33:36 -05:00
coreboot Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
cortina
cssi Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
CZ.NIC arm: mvebu: turris_omnia: Fix setting switch CONFIG pins on new board design 2022-09-18 12:41:57 +02:00
d-link/dns325
data_modul/imx8mm_edm_sbc ARM: imx: Deduplicate i.MX8M SNVS LPGPR unlock 2022-09-20 18:30:02 +02:00
davinci/da8xxevm Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
devboards/dbm-soc1 global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
dfi Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
dhelectronics ARM: dts: stm32: Add DHCOR based Testbench board 2022-10-18 08:34:25 +02:00
ea
ebv/socrates global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
eets/pdu001
efi Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
egnite/ethernut5
elgin/elgin_rv1108
embest/mx6boards
emulation Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
engicam board: imx8mp: Add Engicam i.Core MX8M Plus EDIMM2.2 Starter Kit 2022-10-24 11:34:33 +02:00
esd/meesc
firefly rockchip: rk3308: fix rockchip_dnl_key_pressed() on roc-cc 2022-09-04 20:00:38 +08:00
freescale For 2022.01 2022-11-14 09:33:36 -05:00
friendlyarm Rename CONFIG_PWM to CONFIG_PWM_S5P and move to Kconfig 2022-07-05 17:03:01 -04:00
gardena Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
gateworks imx: imx8m{m,n,p}_venice: migrate to CONFIG_EXTRA_ENV_TEXT 2022-11-08 17:35:00 +01:00
gdsys mpc83xx: gazerbeam: Update sysinfo_get error handling 2022-10-17 21:17:12 -06:00
ge video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
geekbuying/geekbox
google global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
grinn
hardkernel/odroid_go2
highbank highbank: scan into hb_sregs DT subnodes 2022-11-02 13:58:17 -04:00
hisilicon
hoperun/hihope-rzg2 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
hpe/gxp Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
huawei/hg556a
imgtec MIPS: remove CONFIG_SYS_MHZ 2022-11-02 21:42:32 +01:00
intel Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
inversepath/usbarmory
iomega/iconnect
is1 global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
isee igep00x0: Disable networking 2022-08-20 21:18:15 -04:00
k+p
keymile global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
kobol/helios4 Makefile: Rename u-boot-spl.kwb to u-boot-with-spl.kwb 2022-11-07 07:17:55 +01:00
kontron global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
kosagi/novena input: Remove legacy KEYBOARD option 2022-10-21 13:47:56 -04:00
l+g/vinco video: Drop use of the lcd header file 2022-10-30 20:07:17 +01:00
LaCie arm: Remove edminiv2 board 2022-08-20 21:18:15 -04:00
lego/ev3 legoev3: Migrate to DM_I2C 2022-07-08 17:57:34 -04:00
lg/sniper
liebherr global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
logicpd Audit <flash.h> inclusion 2022-08-04 16:18:47 -04:00
Marvell arm: mvebu: Espressobin: Fix default env variables 2022-12-12 07:36:04 +01:00
maxbcm arm: mvebu: mbus: Fix mbus driver to work also after U-Boot relocation 2022-08-23 12:35:37 +02:00
mediatek board: mediatek: add MT7981 reference boards 2022-09-23 15:09:15 -04:00
menlo video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE 2022-10-30 20:07:16 +01:00
microchip riscv: Update Microchip MPFS Icicle Kit support 2022-11-03 13:27:56 +08:00
mikrotik/crs3xx-98dx3236
mqmaker/miqi_rk3288
msc/sm2s_imx8mp For 2022.01 2022-11-14 09:33:36 -05:00
mscc
myir/mys_6ulx global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
netgear
nokia/rx51 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
novtech/meerkat96
nuvoton arm: nuvoton: Add support for Nuvoton NPCM845 BMC 2022-10-06 21:05:17 -04:00
nvidia video: Drop use of the lcd header file 2022-10-30 20:07:17 +01:00
olimex/mx23_olinuxino
opalkelly/zynq
openpiton/riscv64 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
out4/o4-imx6ull-nano
phytec global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
phytium
pine64
purism/librem5 global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
qca Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
qualcomm Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
radxa
raidsonic/ib62x0
raspberrypi/rpi MAINTAINERS: add RaspberryPi co-maintainer 2022-12-02 08:39:00 -05:00
renesas Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
rikomagic/mk808
rockchip rockchip: rk3399: Add EAIDK-610 support 2022-10-19 19:30:48 +08:00
ronetix global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
sagem/f@st1704
samsung Convert CONFIG_SYS_I2C_INIT_BOARD to Kconfig 2022-11-10 09:45:53 -05:00
sandbox sandbox: Move the capsule GUID declarations to board file 2022-11-22 15:13:35 -07:00
Seagate
seeed global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
sfr/nb4_ser
siemens imx: imx8qxp: giedi switch to binman 2022-11-09 17:12:32 +01:00
sifive Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
silinux/ek874 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
sipeed/maix Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
socionext/developerbox board: developerbox: move mem_map setup later 2022-10-06 21:05:17 -04:00
socrates global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
softing global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
solidrun mx6cuboxi: migrate to DM_SERIAL 2022-11-08 17:35:00 +01:00
somlabs/visionsom-6ull
sr1500 global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
st FWU: STM32MP1: Add support to read boot index from backup register 2022-10-31 14:47:32 -04:00
ste/stemmy
storopack/smegw01
sunxi sunxi: defconfig: Add X96 Mate TV box 2022-10-19 14:14:55 +01:00
Synology arm: kirkwood: 88f6281: Detect CONFIG_SYS_TCLK from SAR register 2022-08-23 12:38:47 +02:00
synopsys Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
sysam Convert CONFIG_EXTRA_CLOCK to Kconfig 2022-07-05 17:03:01 -04:00
tbs/tbs2910 board: tbs2910: Set all board dts files as maintained 2022-10-21 11:54:13 +02:00
tcl/sl50
technexion video: Rename CONFIG_DM_VIDEO to CONFIG_VIDEO 2022-10-30 20:07:17 +01:00
terasic global: Migrate CONFIG_HPS* symbols to the CFG namespace 2022-11-10 10:08:55 -05:00
theadorable arm: mvebu: mbus: Fix mbus driver to work also after U-Boot relocation 2022-08-23 12:35:37 +02:00
theobroma-systems rockchip: puma-rk3399: migrate to u-boot-rockchip-spi.bin 2022-10-19 19:30:49 +08:00
ti treewide: Remove the unnecessary space before semicolon 2022-11-02 13:58:17 -04:00
timll
topic/zynq
toradex global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
tplink/wdr4300 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
tq/tqma6 Rename CONFIG_SYS_TEXT_BASE to CONFIG_TEXT_BASE 2022-10-31 11:01:31 -04:00
traverse global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
udoo
vamrs/rock960_rk3399
variscite global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
vocore/vocore2
vscom/baltos linker_lists: Rename sections to remove . prefix 2022-06-23 12:58:18 -04:00
wandboard global: Migrate CONFIG_SYS_FSL* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
warp7 warp7: Remove legacy non-DM_ETH code 2022-08-20 21:18:15 -04:00
work-microwave/work_92105
xen/xenguest_arm64
xes/common global: Migrate CONFIG_SYS_MPC8* symbols to the CFG_SYS namespace 2022-11-10 10:08:55 -05:00
xilinx xilinx: zynqmp: Fix SPL_FS_LOAD_PAYLOAD_NAME usage 2022-12-05 08:55:55 +01:00
zyxel/nsa310s arm: kirkwood: nsa310s: Add Distro boot capability 2022-08-23 12:35:37 +02:00