public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Got u-boot-2012.10 running on at91sam9200 - but why does it work?
@ 2013-10-09 19:23 Arvid Brodin
  2013-10-10  8:25 ` Jens Scharsig
  0 siblings, 1 reply; 4+ messages in thread
From: Arvid Brodin @ 2013-10-09 19:23 UTC (permalink / raw)
  To: u-boot

Hi,

I managed to get u-boot-2012.10 to boot from NOR flash on a custom 
at91rm9200 board by doing this:


Signed-off-by: Arvid Brodin <arvid.brodin@xdin.com>
---
 arch/arm/cpu/arm920t/start.S   | 8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index 14c9156..efc4ea3 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -294,9 +294,7 @@ clbss_e:
 _nand_boot_ofs:
 	.word nand_boot
 #else
-	ldr	r0, _board_init_r_ofs
-	adr	r1, _start
-	add	lr, r0, r1
+	ldr	lr, _board_init_r
 	add	lr, lr, r9
 	/* setup parameters for board_init_r */
 	mov	r0, r5		/* gd_t */
@@ -304,8 +302,8 @@ _nand_boot_ofs:
 	/* jump to it ... */
 	mov	pc, lr
 
-_board_init_r_ofs:
-	.word board_init_r - _start
+_board_init_r:
+	.word board_init_r
 #endif
 
 _rel_dyn_start_ofs:
-- 
1.8.1.5

(I also had to comment out the CONFIG_AT91RM9200EK define in my custom board
config file.)

Any idea why this is needed? I simply used a LED to see where the un-touched 
code failed, and noticed it reached the board_init_r call but never entered the
function. I thought it a bit strange to first subtract _start in the variable
definition and the add it again in the code, so I tried without it, and -- lo
and behold! -- it worked.



-- 
Arvid Brodin | Consultant (Linux)
XDIN AB | Knarrarn?sgatan 7 | SE-164 40 Kista | Sweden | xdin.com

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

end of thread, other threads:[~2013-10-11  6:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09 19:23 [U-Boot] Got u-boot-2012.10 running on at91sam9200 - but why does it work? Arvid Brodin
2013-10-10  8:25 ` Jens Scharsig
2013-10-10 15:30   ` [U-Boot] Got u-boot-2012.10 running on at91rm9200 " Arvid Brodin
2013-10-11  6:28     ` Jens Scharsig

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