public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] A question in lowlevel_init.S
Date: Sat, 22 Jan 2011 08:25:27 +0100	[thread overview]
Message-ID: <4D3A8667.7000609@free.fr> (raw)
In-Reply-To: <30734554.post@talk.nabble.com>

Hi Vamsi,

Le 22/01/2011 05:18, krrish53 a ?crit :
>
> Hello everybody,
> I have a question pertaining to almost every lowlevel_init.S. The code goes
> like
>
> /*make r0 relative the current location so that it*/
> /*reads SMRDATA out of flash rather than memory*/
> ldr r0,=SMRDATA
> ldr r1,_TEXT_BASE
> sub r10,r0,r1
>
> I couldn't relate the code to comments made ahead of that(how does TEXT_BASE
> - addrof(SMRDATA) yield the location of SMRDATA in flash. I totally dint get
> it.  Please enlighten me. I  greatly appreciate any response.

It would be easier if you gave the precise source code origin, filename 
and location of the code you're mentioning. I took the u-boot-arm 
current master branch, and could not exactly find any occurrence of "sub 
r10, r0, r1" so I looked for an appraoching sequence, and found e.g. 
arch/arm/cpu/arm926ejs/at91/lowlevel_init.S, line 63. Is this what you 
meant?

	/* memory control configuration */
	/* this isn't very elegant, but	 what the heck */
	ldr	r0, =SMRDATA
	ldr	r1, _MTEXT_BASE
	sub	r0, r0, r1
	add	r2, r0, #80

If so, the code does not compute TEXT_BASE - SMRDATA, rather the reverse 
: SMRDATA - TEXT_BASE, .i.e. the relative address of SMRDATA with 
respect to the image start (depending on START_FROM_MEM, in Flash or 
physical RAM). I assume #80 is an absolute base address of the actual 
SMRDATA, but I'm no at91 specialist.

> Thanks,
> Vamsi

Amicalement,
-- 
Albert.

  reply	other threads:[~2011-01-22  7:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-22  4:18 [U-Boot] A question in lowlevel_init.S krrish53
2011-01-22  7:25 ` Albert ARIBAUD [this message]
2011-01-22  7:39   ` Reinhard Meyer
2011-01-22  9:58     ` Eric Bénard
2011-01-22 10:19       ` Reinhard Meyer
2011-01-22 16:11         ` krrish53
2011-01-23 17:25         ` Ulf Samuelsson
2011-01-24  0:00   ` krrish53

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=4D3A8667.7000609@free.fr \
    --to=albert.aribaud@free.fr \
    --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