All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Matthias Kaehlcke <matthias@kaehlcke.net>
Cc: barebox@lists.infradead.org
Subject: Re: confusion about relocation (ARM)
Date: Mon, 4 Jan 2010 13:07:58 +0100	[thread overview]
Message-ID: <20100104120758.GC4976@pengutronix.de> (raw)
In-Reply-To: <20100101214826.GS5093@darwin>

On Fri, Jan 01, 2010 at 10:48:26PM +0100, Matthias Kaehlcke wrote:
> hi eric,
> 
> thanks for your reply
> 
> El Fri, Jan 01, 2010 at 09:36:29PM +0100 Eric Bénard ha dit:
> 
> > Le 01/01/2010 20:48, Matthias Kaehlcke a écrit :
> >> a comment in start_barebox() says 'We are running from RAM now', so i
> >> deduced SDRAM must work. but after having a look at start-arm.S i'm a
> >> little bit confused. as far as i understand the barebox code is copied
> >> to RAM in copy_loop(). what i don't see is where the program counter
> >> is set to the address in RAM?
> >>
> > in arch/arm/cpu/start-arm.S @ line 245 :
> >         ldr     pc, _start_armboot
> 
> i saw this line, but i don't understand how it comes that
> the address at _start_armboot points to RAM and not to the flash.

When your barebox image is linked to RAM (that is 0x05700000 in your
case) _start_armboot is in RAM, too.

> 
> another question: how does ARCH_TEXT_BASE fit in here? i defined it as
> 0x05700000, but in the barebox image _TEXT_BASE is 0x00000000

Have a look at barebox.S, it should look like:

barebox:     file format elf32-littlearm


Disassembly of section .text:

87f00000 <_start>:
87f00000:	ea000014 	b	87f00058 <reset>
87f00004:	e59ff014 	ldr	pc, [pc, #20]	; 87f00020<_end+0xfffe07c4>
87f00008:	e59ff014 	ldr	pc, [pc, #20]	; 87f00024<_end+0xfffe07c8>
87f0000c:	e59ff014 	ldr	pc, [pc, #20]	; 87f00028<_end+0xfffe07cc>
87f00010:	e59ff014 	ldr	pc, [pc, #20]	; 87f0002c<_end+0xfffe07d0>
87f00014:	e59ff014 	ldr	pc, [pc, #20]	; 87f00030<_end+0xfffe07d4>
87f00018:	e59ff014 	ldr	pc, [pc, #20]	; 87f00034<_end+0xfffe07d8>
87f0001c:	e59ff014 	ldr	pc, [pc, #20]	; 87f00038<_end+0xfffe07dc>

87f00020 <_undefined_instruction>:
87f00020:	87f14a20 	.word	0x87f14a20

87f00024 <_software_interrupt>:
87f00024:	87f14a80 	.word	0x87f14a80

87f00028 <_prefetch_abort>:
87f00028:	87f14ae0 	.word	0x87f14ae0

87f0002c <_data_abort>:
87f0002c:	87f14b40 	.word	0x87f14b40

87f00030 <_not_used>:
87f00030:	87f14ba0 	.word	0x87f14ba0

87f00034 <_irq>:
87f00034:	87f14c00 	.word	0x87f14c00

87f00038 <_fiq>:
87f00038:	87f14c60 	.word	0x87f14c60
87f0003c:	deadbeef 	.word	0xdeadbeef

87f00040 <_barebox_start>:
87f00040:	87f00000 	.word	0x87f00000

87f00044 <_bss_start>:
87f00044:	87f1a908 	.word	0x87f1a908

87f00048 <_bss_end>:
87f00048:	87f1f85c 	.word	0x87f1f85c

87f0004c <_TEXT_BASE>:
87f0004c:	87f00000 	.word	0x87f00000

87f00050 <_MALLOC_BASE>:
87f00050:	87b00000 	.word	0x87b00000

(With 87fxxxx replaced with 0570xxxx of course)

Since EP93xx is not in mainline maybe you can provide us your patches
and I think we should be able to help you.

Regards
  Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-01-04 12:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-01 19:48 confusion about relocation (ARM) Matthias Kaehlcke
2010-01-01 20:36 ` Eric Bénard
2010-01-01 21:48   ` Matthias Kaehlcke
2010-01-04 12:07     ` Sascha Hauer [this message]
2010-01-04 19:21       ` Matthias Kaehlcke
2010-01-04 20:13         ` Robert Schwebel
2010-01-04 21:10           ` Matthias Kaehlcke

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=20100104120758.GC4976@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=matthias@kaehlcke.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.