U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Salvini <m.salvini@koansoftware.com>
To: Richard Weinberger <richard@sigma-star.at>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Cc: upstream+uboot@sigma-star.at,
	Simon Graber <simon.graber@sigma-star.at>,
	mbrugger@suse.com, pbrobinson@gmail.com
Subject: Re: Unexpected RPi5 Behavior with Saved U-Boot Environment
Date: Thu, 27 Mar 2025 17:24:36 +0100	[thread overview]
Message-ID: <df93a047-2a97-4028-90b3-510b9c75493c@koansoftware.com> (raw)
In-Reply-To: <3097333.a1USZiQ7eK@anvil>

On 27/03/25 16:54, Richard Weinberger wrote:
> Hi!
> 
> We recently started using U-Boot on various Raspberry Pi 5 boards
> with different hardware configurations.
> 
> While testing, Simon noticed unusual boot failures, such as the kernel
> failing to boot with no output or U-Boot reporting:
> "ERROR: Did not find a cmdline Flattened Device Tree."
> 
> Today, I spent time investigating these issues. It appears that U-Boot
> retrieves several variables from the Raspberry Pi firmware, with fdt_addr
> being particularly important.
> If the environment is saved, fdt_addr gets stored and takes precedence
> over what the firmware provides to U-Boot.
> 
> Interestingly, the RPi firmware seems to modify fdt_addr based on connected
> hardware.  Our experiments showed that even attaching an RPi camera module
> changes the computed fdt_addr and U-Boot reads from the wrong memory location.
> 
> As a result, saving the environment, whether via the saveenv command in U-Boot
> or fw_setenv in Linux, can lead to boot failures if the hardware configuration changes.
> 
> Do you have any suggestions for mitigating this issue?
> In my opinion, U-Boot should not override such critical variables.
> 
> Thanks,
> //richard
> 

Hi Richard,

could be related tho this [1]?

I sent this patch some years ago but was never accepted in u-boot tree.
But meta-rpi uses it in u-boot recipe [2].

Regards

[1] https://lists.denx.de/pipermail/u-boot/2021-May/449609.html
[2] 
https://github.com/agherzan/meta-raspberrypi/blob/master/recipes-bsp/u-boot/files/0001-rpi-always-set-fdt_addr-with-firmware-provided-FDT-address.patch

-- 
Mauro

  reply	other threads:[~2025-03-27 16:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-27 15:54 Unexpected RPi5 Behavior with Saved U-Boot Environment Richard Weinberger
2025-03-27 16:24 ` Mauro Salvini [this message]
2025-03-27 16:31   ` Richard Weinberger
2025-03-28  7:43     ` Mauro Salvini
2025-03-28 10:44     ` Simon Glass
2025-04-21 10:15   ` Peter Robinson
2025-04-23  6:41     ` Mauro Salvini

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=df93a047-2a97-4028-90b3-510b9c75493c@koansoftware.com \
    --to=m.salvini@koansoftware.com \
    --cc=mbrugger@suse.com \
    --cc=pbrobinson@gmail.com \
    --cc=richard@sigma-star.at \
    --cc=simon.graber@sigma-star.at \
    --cc=u-boot@lists.denx.de \
    --cc=upstream+uboot@sigma-star.at \
    /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