All of lore.kernel.org
 help / color / mirror / Atom feed
From: Graeme Russ <graeme.russ@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: add 8-byte alignment for ABI compliance before board_init_f
Date: Fri, 12 Nov 2010 19:50:56 +1100	[thread overview]
Message-ID: <4CDCFFF0.8010502@gmail.com> (raw)
In-Reply-To: <4CDCEA8F.9060709@denx.de>

On 12/11/10 18:19, Heiko Schocher wrote:
> Hello Reinhard,
> 
> Reinhard Meyer wrote:
>> Dear Heiko Schocher,
>>> diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S

>> Is bootflag ever used? If not, why not change the parameter to
> 
> No.
> 
>> give the gd address to board_init_f?
>>
>>     ld r0, sp (whatever the exact assembly syntax for that would be)
>>
>> void board_init_f (gd_t *gd_addr)
>> ...
>>     gd = gd_addr;
> 
> I thought this too, but in arch/powerpc/lib/board.c it is used as bootflag,
> so I didn;t want to touch this ... but looking in arch/*/lib/board.c
> this first parameter is not always used as bootflag ... so I think
> that would be good ... opinions?
> 

For x86, I use the parameter as a pointer to gd and put boot flags in gd:

void board_init_f (ulong gdp)
{

The memory layout for x86 is:

+--Top of Memory-+
|                |
|     Stack      |
|                |
+----------------+
|                |
|  Global Data   |
|                |
+----------------+
|                |
|  U-Boot Code   |
|    + Data      |
|                |
+----------------+ <-- dest_addr (see below)
|                |
|      BSS       |
|                |
+----------------+
|                |
|  malloc area   |
|                |
+----------------+
|                |
|  Free Memory   |
/                /

So passing the pointer to gd also serves to calculate the relocation address:

	/* Calculate destination RAM Address and relocation offset */
	dest_addr  = (void *)gdp - (bss_end - text_start);
	rel_offset = dest_addr - text_start;


Regards,

Graeme

  parent reply	other threads:[~2010-11-12  8:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12  6:53 [U-Boot] [PATCH] arm: add 8-byte alignment for ABI compliance before board_init_f Heiko Schocher
2010-11-12  7:06 ` Reinhard Meyer
2010-11-12  7:19   ` Heiko Schocher
2010-11-12  8:04     ` Albert ARIBAUD
2010-11-12  8:50     ` Graeme Russ [this message]
2010-11-12  8:50   ` Wolfgang Denk
2010-11-12  9:47     ` Graeme Russ
2010-11-12  9:56       ` Wolfgang Denk
2010-11-12  7:53 ` Albert ARIBAUD
2010-11-12  8:05   ` Heiko Schocher
2010-12-08 22:50 ` Wolfgang Denk

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=4CDCFFF0.8010502@gmail.com \
    --to=graeme.russ@gmail.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 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.