From: Reinhard Meyer <u-boot@emk-elektronik.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] RFC: Aligning arch initialisation sequences
Date: Sat, 13 Nov 2010 23:38:54 +0100 [thread overview]
Message-ID: <4CDF137E.2000902@emk-elektronik.de> (raw)
In-Reply-To: <20101113215302.6BEA3CEA55B@gemini.denx.de>
Dear Wolfgang Denk,
> Dear Reinhard Meyer,
>
> In message<4CDF04A8.4050802@emk-elektronik.de> you wrote:
>>
>> But whats left of my ideas is the following:
>>
>> in asm: set stack to end of SRAM (or whatever)
>> (board-config.h would not subtract GENERATED_GBL_DATA_SIZE
>> anymore)
>>
>> in c:
>> board_early_init(void)
>> {
>> gd_t auto_gd;
>> gd =&auto_gd;
>>
>> That would rid us of all alignment concerns:
>> Setting stack to end of initial storage will certainly
>> be aligned, and the auto_gd will be aligned as the
>> toolchain deems necessary.
>>
>> We would not need GENERATED_GBL_DATA_SIZE anymore.
>>
>> The auto_gd space on stack will be valid even into the call
>> to relocate_code.
>
> This has but on tiny shortcoming: we use GD to pass data around, for
> example to pass clock frequencies determind before relocation to the
> code running after relocation - which means that GD must be of a
> statically allocated storage class.
>
> Your stack variable above will go out of scope as soon as we leave the
> board_early_init() function...
Correct, that's why its even now copied over to storage in SDRAM...
(at least on ARM:
debug ("relocation Offset is: %08lx\n", gd->reloc_off);
memcpy (id, (void *)gd, sizeof (gd_t));
relocate_code (addr_sp, id, addr);
)
Best Regards,
Reinhard
next prev parent reply other threads:[~2010-11-13 22:38 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-07 10:06 [U-Boot] RFC: Aligning arch initialisation sequences Graeme Russ
2010-11-09 23:35 ` Mike Frysinger
2010-11-13 4:16 ` Graeme Russ
2010-11-13 4:58 ` Mike Frysinger
2010-11-13 6:31 ` Reinhard Meyer
2010-11-13 6:38 ` Reinhard Meyer
2010-11-13 9:51 ` Graeme Russ
2010-11-13 8:17 ` Wolfgang Denk
2010-11-13 21:35 ` Reinhard Meyer
2010-11-13 21:53 ` Wolfgang Denk
2010-11-13 22:38 ` Reinhard Meyer [this message]
2010-11-13 22:45 ` Wolfgang Denk
2010-11-13 22:48 ` Reinhard Meyer
2010-11-14 0:07 ` Wolfgang Denk
2010-11-14 0:25 ` Graeme Russ
2010-11-14 0:35 ` Wolfgang Denk
2010-11-14 1:09 ` Graeme Russ
2010-11-14 9:04 ` Wolfgang Denk
2010-11-14 10:21 ` Graeme Russ
2010-11-14 19:43 ` Graeme Russ
2010-11-14 4:07 ` Reinhard Meyer
2010-11-14 9:07 ` Wolfgang Denk
2010-11-14 13:46 ` Reinhard Meyer
2010-11-14 19:36 ` Graeme Russ
2010-11-14 20:16 ` Reinhard Meyer
2010-11-14 21:01 ` Graeme Russ
2010-11-13 8:20 ` Albert ARIBAUD
2010-11-13 11:18 ` Graeme Russ
2010-11-14 5:10 ` Graeme Russ
2010-11-14 5:48 ` Graeme Russ
2010-11-14 9:16 ` Albert ARIBAUD
2010-11-14 10:30 ` Wolfgang Denk
2010-11-14 12:10 ` Albert ARIBAUD
2010-11-14 15:01 ` Wolfgang Denk
2010-11-14 17:53 ` Albert ARIBAUD
2010-11-14 19:06 ` Wolfgang Denk
2010-11-14 19:29 ` Albert ARIBAUD
2010-11-14 19:55 ` Wolfgang Denk
2010-11-14 20:10 ` Albert ARIBAUD
2010-11-14 20:42 ` Wolfgang Denk
2010-11-14 19:23 ` Wolfgang Denk
2010-11-14 19:34 ` Graeme Russ
2010-11-14 20:05 ` Albert ARIBAUD
2010-11-14 21:27 ` Graeme Russ
2010-11-15 11:08 ` Graeme Russ
2010-11-14 21:51 ` 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=4CDF137E.2000902@emk-elektronik.de \
--to=u-boot@emk-elektronik.de \
--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.