U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] boot: Warn users about fdt_high=~0 usage
@ 2025-11-13 14:29 Marek Vasut
  2025-11-13 15:49 ` Tom Rini
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2025-11-13 14:29 UTC (permalink / raw)
  To: u-boot
  Cc: Marek Vasut, João Paulo Gonçalves, Ilias Apalodimas,
	Sam Protsenko, Sughosh Ganu, Tom Rini

In case the 'fdt_high' environment variable is set to ~0 and DT is
at non-8-byte aligned offset, warn users about the dangers of the
fdt_high usage. This will hopefully lead to removal of most of the
fdt_high ~0 usage over time.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: "João Paulo Gonçalves" <joao.goncalves@toradex.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Sam Protsenko <semen.protsenko@linaro.org>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
---
 boot/image-fdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/boot/image-fdt.c b/boot/image-fdt.c
index 3f0ac54f76f..e88525a3846 100644
--- a/boot/image-fdt.c
+++ b/boot/image-fdt.c
@@ -189,6 +189,10 @@ int boot_relocate_fdt(char **of_flat_tree, ulong *of_size)
 			/* All ones means use fdt in place */
 			of_start = fdt_blob;
 			addr = map_to_sysmem(fdt_blob);
+			if (addr & 7) {
+				printf("WARNING: The 'fdt_high' environment variable is set to ~0 and DT is at non-8-byte aligned address.\nWARNING: This system will likely fail to boot. Unset 'fdt_high' environment variable and submit fix upstream.\n");
+			}
+
 			err = lmb_alloc_mem(LMB_MEM_ALLOC_ADDR, 0, &addr,
 					    of_len, LMB_NONE);
 			if (err) {
-- 
2.51.0


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

end of thread, other threads:[~2025-11-19 17:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 14:29 [PATCH] boot: Warn users about fdt_high=~0 usage Marek Vasut
2025-11-13 15:49 ` Tom Rini
2025-11-15 17:34   ` Marek Vasut
2025-11-16 14:09     ` Tom Rini
2025-11-16 21:43       ` Marek Vasut
2025-11-17 14:32         ` Tom Rini
2025-11-19 17:27           ` Marek Vasut

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