U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Shiji Yang <yangshiji66@outlook.com>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>,
	Dai Okamura <okamura.dai@socionext.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	Fabio Estevam <festevam@denx.de>,
	Roger Quadros <rogerq@kernel.org>, Simon Glass <sjg@chromium.org>,
	Shiji Yang <yangshiji66@outlook.com>
Subject: [PATCH] spl: spl_legacy: Fix spl_end address for non ARM target
Date: Mon, 31 Jul 2023 14:19:15 +0800	[thread overview]
Message-ID: <TYAP286MB031570099106076D99F41DB5BC05A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM> (raw)

Only ARM target defines _image_binary_end symbol as char*, All other
targets define it as an ulong type in include/asm-generic/sections.h.

This patch fixes the boot failure on MIPS target. Error log:
SPL: Image overlaps SPL

Fixes: 1b8a1be1a1f1 ("spl: spl_legacy: Fix spl_end address")
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
 common/spl/spl_legacy.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index 095443c63d..0fef890384 100644
--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -18,9 +18,13 @@
 
 static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size)
 {
+	uintptr_t end = start + size;
 	uintptr_t spl_start = (uintptr_t)_start;
+#ifdef CONFIG_ARM
 	uintptr_t spl_end = (uintptr_t)_image_binary_end;
-	uintptr_t end = start + size;
+#else
+	uintptr_t spl_end = (uintptr_t)&_image_binary_end;
+#endif /* CONFIG_ARM */
 
 	if ((start >= spl_start && start < spl_end) ||
 	    (end > spl_start && end <= spl_end) ||
-- 
2.39.2


             reply	other threads:[~2023-07-31 12:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  6:19 Shiji Yang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-31 11:57 [PATCH] spl: spl_legacy: Fix spl_end address for non ARM target Shiji Yang
2023-07-31 14:17 ` Marek Vasut
2023-07-31 16:10   ` Shiji Yang
2023-07-31 19:12     ` Tom Rini
2023-08-01  2:35       ` Shiji Yang
2023-08-01  2:37         ` Tom Rini

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=TYAP286MB031570099106076D99F41DB5BC05A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM \
    --to=yangshiji66@outlook.com \
    --cc=festevam@denx.de \
    --cc=marex@denx.de \
    --cc=michael@amarulasolutions.com \
    --cc=okamura.dai@socionext.com \
    --cc=rogerq@kernel.org \
    --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