diff mbox series

[v3,1/2] common: board_f: change calculation of gd->mon_len to fix s5p4418 reloc

Message ID 20240126125056.16439-2-stefan_b@posteo.net
State Accepted
Commit d819250c2af656cad7e0bf0cbf9529f3b8a5e7d2
Delegated to: Tom Rini
Headers show
Series arm: s5p4418: fix relocation | expand

Commit Message

Stefan Bosch Jan. 26, 2024, 12:50 p.m. UTC
ARCH_NEXELL: Change calculation of monitor length (gd->mon_len) to fix
relocation at boards with s5p4418-SoC (ARCH_NEXELL). At s5p4418, _start
is after the header (NSIH). Therefore the monitor length has to be
calculated using __image_copy_start instead of _start in order the
whole monitor code is relocated.

Signed-off-by: Stefan Bosch <stefan_b@posteo.net>
---

Changes in v3:
- MICROBLAZE has not built anymore. Therefore do change calculation of
  gd->mon_len for ARCH_NEXELL only. This makes sure that MICROBLAZE and
  other ARM-boards are not affected.

Changes in v2:
- Cosmetic: Fix spelling mistake in commit message

 common/board_f.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini March 4, 2024, 3:27 p.m. UTC | #1
On Fri, Jan 26, 2024 at 12:50:55PM +0000, Stefan Bosch wrote:

> ARCH_NEXELL: Change calculation of monitor length (gd->mon_len) to fix
> relocation at boards with s5p4418-SoC (ARCH_NEXELL). At s5p4418, _start
> is after the header (NSIH). Therefore the monitor length has to be
> calculated using __image_copy_start instead of _start in order the
> whole monitor code is relocated.
> 
> Signed-off-by: Stefan Bosch <stefan_b@posteo.net>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/common/board_f.c b/common/board_f.c
index d4d7d01f8f..73297fc1b2 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -282,7 +282,9 @@  static int init_func_i2c(void)
 
 static int setup_mon_len(void)
 {
-#if defined(__ARM__) || defined(__MICROBLAZE__)
+#if defined(CONFIG_ARCH_NEXELL)
+	gd->mon_len = (ulong)__bss_end - (ulong)__image_copy_start;
+#elif defined(__ARM__) || defined(__MICROBLAZE__)
 	gd->mon_len = (ulong)__bss_end - (ulong)_start;
 #elif defined(CONFIG_SANDBOX) && !defined(__riscv)
 	gd->mon_len = (ulong)_end - (ulong)_init;