public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 0/6] rockchip: puma-rk3399/ringneck-px30: fix check against value in default environment variable
@ 2023-11-08 14:20 Quentin Schulz
  2023-11-08 14:20 ` [PATCH 1/6] env: allow to copy value from default environment into a buffer Quentin Schulz
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Quentin Schulz @ 2023-11-08 14:20 UTC (permalink / raw)
  To: Joe Hershberger, Klaus Goger, Simon Glass, Philipp Tomsich,
	Kever Yang
  Cc: Quentin Schulz, u-boot, Heiko Stuebner, Quentin Schulz

For puma-rk3399 and ringneck-px30, U-Boot proper automatically modifies
boot_targets to swap the order in which MMC storage media are used for
standard boot based on which MMC storage medium was used to load U-Boot
proper. This is however only done if the user has not changed it
manually, therefore a check between the default and current value is
done.

This used to work fine until the migration to standard boot where
boot_targets value size in the default environment went above the 32
characters that env_get_default function can return, thus resulting in a
truncated variable.

Therefore the check between default and current value would always fail.

By adding the env_get_default_into function, a buffer of the appropriate
size can be allocated on the stack to get the whole value of
boot_targets in the default environment and thus fixing the check.

While at it, only compile functions in the U-Boot boot phase they are
used in. This fixes an issue where BOOT_TARGETS constant isn't defined
in SPL or TPL and thus failing the build.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
Quentin Schulz (6):
      env: allow to copy value from default environment into a buffer
      env: migrate env_get_default to call env_get_default_into
      rockchip: puma-rk3399: only declare functions in U-Boot proper
      rockchip: ringneck-px30: only declare functions in U-Boot proper
      rockchip: puma-rk3399: fix modified boot_targets detection
      rockchip: ringneck-px30: fix modified boot_targets detection

 board/theobroma-systems/puma_rk3399/puma-rk3399.c     | 11 +++++++++--
 board/theobroma-systems/ringneck_px30/ringneck-px30.c | 11 +++++++++--
 env/common.c                                          | 16 +++++++++++++---
 include/env.h                                         | 10 ++++++++++
 4 files changed, 41 insertions(+), 7 deletions(-)
---
base-commit: e17d174773e9ba9447596708e702b7382e47a6cf
change-id: 20231108-env_default_theobroma-33774a337fe6

Best regards,
-- 
Quentin Schulz <quentin.schulz@theobroma-systems.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-11-10 10:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08 14:20 [PATCH 0/6] rockchip: puma-rk3399/ringneck-px30: fix check against value in default environment variable Quentin Schulz
2023-11-08 14:20 ` [PATCH 1/6] env: allow to copy value from default environment into a buffer Quentin Schulz
2023-11-09  3:33   ` Kever Yang
2023-11-09 21:22   ` Tom Rini
2023-11-08 14:20 ` [PATCH 2/6] env: migrate env_get_default to call env_get_default_into Quentin Schulz
2023-11-09  3:33   ` Kever Yang
2023-11-09 21:24   ` Tom Rini
2023-11-08 14:20 ` [PATCH 3/6] rockchip: puma-rk3399: only declare functions in U-Boot proper Quentin Schulz
2023-11-09  3:33   ` Kever Yang
2023-11-09 21:26   ` Tom Rini
2023-11-08 14:20 ` [PATCH 4/6] rockchip: ringneck-px30: " Quentin Schulz
2023-11-09  3:33   ` Kever Yang
2023-11-09 21:26   ` Tom Rini
2023-11-08 14:20 ` [PATCH 5/6] rockchip: puma-rk3399: fix modified boot_targets detection Quentin Schulz
2023-11-09  3:34   ` Kever Yang
2023-11-08 14:20 ` [PATCH 6/6] rockchip: ringneck-px30: " Quentin Schulz
2023-11-09  3:34   ` Kever Yang
2023-11-09 21:28   ` Tom Rini
2023-11-10 10:53     ` Quentin Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox