u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
To: Kever Yang <kever.yang@rock-chips.com>,
	patrick.delaunay@foss.st.com,
	'Quentin Schulz' <foss+uboot@0leil.net>
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu,
	klaus.goger@theobroma-systems.com, knaerzche@gmail.com,
	u-boot@lists.denx.de
Subject: Re: [PATCH 07/12] rockchip: puma-rk3399: load environment from same medium as one used to load U-Boot proper
Date: Tue, 20 Sep 2022 16:02:50 +0200	[thread overview]
Message-ID: <73ab0f88-9c60-f19b-0698-7552992b6908@theobroma-systems.com> (raw)
In-Reply-To: <41cccf8a-499e-b700-d3d4-307a13f4ae7b@rock-chips.com>

Hi Kever,

On 9/20/22 14:28, Kever Yang wrote:
> Hi Patrick, Quentin,
> 
> 
> Here is the definition about the ENV_IS_NOWHERE:
> 
> config ENV_IS_NOWHERE
>          bool "Environment is not stored"
> help
>            Define this if you don't want to or can't have an environment 
> stored
>            on a storage medium. In this case the environemnt will still 
> exist
>            while U-Boot is running, but once U-Boot exits it will not be
>            stored. U-Boot will therefore always start up with a default
>            environment.
> 
> 
> Which means ENV_IS_NOWHERE is ALWAYS use default environment,
> 
> but not stored on a storage medium.
> 
> I think what you want is a new ENV_IS_ANYWHERE which not able to
> 
> decide when the firmware is build but must be some where when the boot
> 
> device is decided.
> 

I do not share the same understanding. For me, ENV_IS_NOWHERE means the 
environment is stored in RAM, once you exit U-Boot or reset the board, 
it's gone. That's my understanding of the code, I can concede that the 
help message of the Kconfig option is confusing. It's just another 
"kind" of environment to me.

If the point was to ALWAYS use the default environment, one wouldn't be 
able to enable the option while other ENV_IS_IN_* are enabled. It is 
however possible.

ENV_IS_ANYWHERE is not a correct name for what I want, because I 
specifically do NOT want to load from anywhere. I want to load from a 
specific medium, and if not possible have a fallback to avoid U-Boot 
cryptically crashing.

Maybe we should rename ENV_IS_NOWHERE to ENV_IS_IN_RAM, maybe we could 
also stop crashing if there's no medium to load the environment from 
that is available, maybe we could rephrase the help text of the Kconfig 
option, but this is unrelated to this patch series.

Finally, STM32, some i.MX and a couple of Xilinx based boards actually 
have ENV_IS_NOWHERE enabled at the same time as other ENV_IS_IN_* 
options, so I'm clearly not the first one to use it this way. Also, see 
arch/arm/mach-imx/imx8m/soc.c for an implementation of 
arch_env_get_location that requires ENV_IS_NOWHERE to work and has 
almost the same logic as I'm trying to implement.

I'm trying to fix a non-booting board. This patch series is also only 
impacting the board I'm maintaining and nothing else. If merging the v2 
of this patch series is really asking you something unimaginable, just 
drop this patch from the series, merge the rest and we'll continue 
arguing on a resend.

Quentin

  reply	other threads:[~2022-09-20 14:03 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 16:06 [PATCH 00/12] Puma RK3399 migration to TPL and numerous fixes Quentin Schulz
2022-07-22 16:06 ` [PATCH 01/12] rockchip: puma-rk3399: fix boot_targets swap depending on U-Boot proper load medium Quentin Schulz
2022-09-04 11:41   ` Kever Yang
2022-07-22 16:06 ` [PATCH 02/12] rockchip: puma-rk3399: use gpio-hog instead of fixed-regulator for enabling eMMC/SPI-NOR Quentin Schulz
2022-09-01 13:04   ` Kever Yang
2022-07-22 16:06 ` [PATCH 03/12] rockchip: puma-rk3399: allow non-SD-Card-loaded SPL to load U-Boot proper from SD-Card Quentin Schulz
2022-09-01 13:04   ` Kever Yang
2022-07-22 16:06 ` [PATCH 04/12] rockchip: puma-rk3399: remove unused default ENV_OFFSET for SPI flashes Quentin Schulz
2022-09-01 13:04   ` Kever Yang
2022-07-22 16:06 ` [PATCH 05/12] rockchip: puma-rk3399: load environment from same MMC as used for loading U-Boot proper Quentin Schulz
2022-09-01 13:05   ` Kever Yang
2022-07-22 16:06 ` [PATCH 06/12] rockchip: puma-rk3399: allow loading environment from SPI-NOR flash Quentin Schulz
2022-09-01 13:05   ` Kever Yang
2022-07-22 16:06 ` [PATCH 07/12] rockchip: puma-rk3399: load environment from same medium as one used to load U-Boot proper Quentin Schulz
2022-09-01 13:03   ` Kever Yang
2022-09-01 13:13     ` Quentin Schulz
2022-09-04 11:49       ` Kever Yang
2022-09-06  9:22         ` Quentin Schulz
2022-09-14  9:17           ` patrick.delaunay
2022-09-20 12:28             ` Kever Yang
2022-09-20 14:02               ` Quentin Schulz [this message]
2022-07-22 16:06 ` [PATCH 08/12] rockchip: puma-rk3399: remove useless CONFIG_SYS_SPI_U_BOOT_OFFS Quentin Schulz
2022-09-01 13:05   ` Kever Yang
2022-07-22 16:06 ` [PATCH 09/12] rockchip: puma-rk3399: migrate to TPL Quentin Schulz
2022-09-01 13:05   ` Kever Yang
2022-09-04 11:52   ` Kever Yang
2022-07-22 16:06 ` [PATCH 10/12] rockchip: puma-rk3399: migrate to u-boot-rockchip.bin Quentin Schulz
2022-09-01 13:06   ` Kever Yang
2022-07-22 16:06 ` [PATCH 11/12] rockchip: lion-rk3368: " Quentin Schulz
2022-07-22 16:06 ` [PATCH 12/12] rockchip: puma-rk3399: migrate to u-boot-rockchip-spi.bin Quentin Schulz
2022-09-01 13:06   ` Kever Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73ab0f88-9c60-f19b-0698-7552992b6908@theobroma-systems.com \
    --to=quentin.schulz@theobroma-systems.com \
    --cc=foss+uboot@0leil.net \
    --cc=kever.yang@rock-chips.com \
    --cc=klaus.goger@theobroma-systems.com \
    --cc=knaerzche@gmail.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=philipp.tomsich@vrull.eu \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).