public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: trini@konsulko.com
Cc: marex@denx.de, u-boot@lists.denx.de,
	francesco.dolcini@toradex.com, Fabio Estevam <festevam@denx.de>
Subject: [PATCH v2 3/3] spl: spl_legacy: Fix spl_end address
Date: Fri, 30 Jun 2023 23:30:53 -0300	[thread overview]
Message-ID: <20230701023053.747972-3-festevam@gmail.com> (raw)
In-Reply-To: <20230701023053.747972-1-festevam@gmail.com>

From: Fabio Estevam <festevam@denx.de>

Currently, spl_end points to the __bss_end address, which
is an external RAM address instead of the end of the SPL text
section in the internal RAM.

This causes boot failures on imx6-colibri, for example:

```
Trying to boot from MMC1
SPL: Image overlaps SPL
resetting ...
```
Fix this problem by assigning spl_end to _image_binary_end, as this
symbol properly represents the end of the SPL text section.

From u-boot-spl.map:

.end
 *(.__end)
                0x00000000009121a4                _image_binary_end = .

Fixes: 77aed22b48ab ("spl: spl_legacy: Add extra address checks")
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
---
Changes since v1:
- None.

 common/spl/spl_legacy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/spl/spl_legacy.c b/common/spl/spl_legacy.c
index d34bc5492e8d..095443c63d8d 100644
--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -19,7 +19,7 @@
 static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size)
 {
 	uintptr_t spl_start = (uintptr_t)_start;
-	uintptr_t spl_end = (uintptr_t)__bss_end;
+	uintptr_t spl_end = (uintptr_t)_image_binary_end;
 	uintptr_t end = start + size;
 
 	if ((start >= spl_start && start < spl_end) ||
-- 
2.34.1


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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-01  2:30 [PATCH v2 1/3] sunxi: u-boot-spl.lds: Pass _image_binary_end Fabio Estevam
2023-07-01  2:30 ` [PATCH v2 2/3] microblaze: " Fabio Estevam
2023-07-01 13:06   ` Marek Vasut
2023-07-03 18:28   ` Tom Rini
2023-07-01  2:30 ` Fabio Estevam [this message]
2023-07-01 13:11   ` [PATCH v2 3/3] spl: spl_legacy: Fix spl_end address Marek Vasut
2023-07-03 18:28   ` Tom Rini
2023-07-01 13:06 ` [PATCH v2 1/3] sunxi: u-boot-spl.lds: Pass _image_binary_end Marek Vasut
2023-07-03 18:27 ` 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=20230701023053.747972-3-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=festevam@denx.de \
    --cc=francesco.dolcini@toradex.com \
    --cc=marex@denx.de \
    --cc=trini@konsulko.com \
    --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