All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] BSS footprint of FAT very high - SPL issues
Date: Thu, 03 Feb 2011 12:31:21 +0530	[thread overview]
Message-ID: <4D4A52C1.9000604@ti.com> (raw)
In-Reply-To: <AANLkTi=9cOvC8R8CO02KnOYDPe=davXKgdX95++i_ix2@mail.gmail.com>

Hello Graeme,

On Thursday 03 February 2011 02:31 AM, Graeme Russ wrote:
[snip ..]
>> Yes. These are variables that otherwise would go to BSS. I do this
>> because I need them before SDRAM initialization. One of this is the gd
>> structure. I allocate gd structure in .data that is in IRAM.
>> Why I need gd before SDRAM? Because I try to initialize serial console
>> as early as possible and this code has some reference to gd.
>>
>
> Which is a perfectly normal scenario and the way things have always been.
> There should have been no need to shuffle gd around because of console
> initialisation.
>
> And as I understand it, gd itself does not get statically 'allocated' in
> the u-boot image per-se (i.e. not in .data and not in .bss) - Only the
> pointer to it is allocated. In most arches, this pointer is itself not
> in .data or .bss but rather in a fixed reserved register. In the new x86
> (final patches coming soon), the pointer is allocated in .data with a
> preset initialised value pointing into  Cache-As-RAM (i.e. IRAM). Prior to
> relocation, the gd pointer variable points to somewhere in IRAM / CAR and
> after relocation, gd gets copied into the heap and the gd pointer adjusted
> to point to the new permanent copy.

Please note that SPL starts executing from IRAM and not
FLASH (copied there by ROM code). So we have .data available
immediately. Actually we do not need gd except to reuse some code from
u-boot that uses it. Declaring gd as a static variable was just a
convenience decision.

If I were to allocate it separately I would have to allocate it in the
same IRAM and I may end up reserving more space than needed to allow
for future expansion. IRAM space is at a premium. So, declaring it as a
static variable helps in allocating only as much space as is needed.

Best regards,
Aneesh

  reply	other threads:[~2011-02-03  7:01 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01  5:23 [U-Boot] BSS footprint of FAT very high - SPL issues Aneesh V
2011-02-01  6:52 ` Bedia, Vaibhav
2011-02-01  7:58   ` Wolfgang Denk
2011-02-01  8:26   ` Aneesh V
2011-02-01  8:35     ` Bedia, Vaibhav
2011-02-01 10:05       ` Wolfgang Denk
2011-02-01 10:18         ` Bedia, Vaibhav
2011-02-01 10:48           ` Albert ARIBAUD
2011-02-01 12:43             ` Bedia, Vaibhav
2011-02-01 13:27               ` Wolfgang Denk
2011-02-01 10:53     ` Albert ARIBAUD
2011-02-11 21:16     ` Ulf Samuelsson
2011-02-11 22:15       ` Wolfgang Denk
2011-09-13 21:40         ` Ulf Samuelsson
2011-09-28 20:28           ` Wolfgang Denk
2011-02-12  6:13       ` Aneesh V
2011-02-01  7:04 ` Albert ARIBAUD
2011-02-01  7:11   ` Albert ARIBAUD
2011-02-01  8:00     ` Wolfgang Denk
2011-02-01  8:27     ` Aneesh V
2011-02-01  7:55 ` Wolfgang Denk
2011-02-01  8:18   ` Aneesh V
2011-02-01  8:48     ` Bedia, Vaibhav
2011-02-01 10:03     ` Wolfgang Denk
2011-02-02 13:17       ` Aneesh V
2011-02-02 13:37         ` Albert ARIBAUD
2011-02-02 14:01           ` Aneesh V
2011-02-02 15:14             ` Albert ARIBAUD
2011-02-03 10:38               ` Aneesh V
2011-02-05  6:58                 ` Albert ARIBAUD
2011-02-11  6:28                   ` Aneesh V
2011-02-11  6:39                     ` Albert ARIBAUD
2011-02-11  6:57                       ` Aneesh V
2011-02-11  8:15                         ` Albert ARIBAUD
2011-02-11  8:27                           ` Aneesh V
2011-02-02 21:01             ` Graeme Russ
2011-02-03  7:01               ` Aneesh V [this message]
2011-02-03 10:05                 ` Graeme Russ
2011-02-03  6:49             ` sughosh ganu
2011-02-03  7:22               ` Aneesh V
2011-02-15  8:44 ` Mike Frysinger

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=4D4A52C1.9000604@ti.com \
    --to=aneesh@ti.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.