[RFC 2/5] riscv: set fdtfile on Milk-V Mars

E Shattow lucent at gmail.com
Sun Mar 10 20:18:37 CET 2024


On Fri, Mar 8, 2024 at 2:57 PM Heinrich Schuchardt <
heinrich.schuchardt at canonical.com> wrote:
...

> > I do not like this practice of force setting fdtfile environment
> > variable. If I set fdtfile from u-boot prompt and saveenv, I expect that
> > my action as the user will persist over a reboot but instead it gets
> > ignored and overwritten by this strategy. Is this necessary to happen
> > before the boot scripts?
>
>
We could check if $fdtfile is already set before the update.
>
> This would require that the default environment does not include it. Cf.
>
> include/configs/starfive-visionfive2.h:51:
>         "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
>
...

The default environment is expected to have a sensible default, and
implicitly is only used when there is a checksum error (so no existing
valid fdtfile environment variable). It is not nice to remove capability
from userspace i.e. Linux mtd interface access to update u-boot environment
variables; setting fdtfile as such has no effect as it will always be force
set by this routine. The workaround now is to set fdtfile from a boot.scr
but that adds a dependency to reside on storage (which is not always true
for all boot situations).

What of "fdtfile=${fdtfile_board}" for the default environment and this
routine instead updates $fdtfile_board (or similar) ? I'm not sure what to
suggest, or if this is a common practice for u-boot board support. Thanks -
E


More information about the U-Boot mailing list