public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sricharan R <r.sricharan@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] OMAP (4) boot_params
Date: Mon, 8 Apr 2013 15:13:28 +0530	[thread overview]
Message-ID: <51629140.40002@ti.com> (raw)
In-Reply-To: <F0A0183F-BC79-4D02-8527-012761CF406B@prograde.net>

Hi Mike Cashwell,

On Thursday 04 April 2013 07:48 PM, Michael Cashwell wrote:
> On Apr 4, 2013, at 1:52 AM, Wolfgang Denk <wd@denx.de> wrote:
> 
>> Dear Tom,
>>
>> On Apr 3, 2013, at 11:34 AM, Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
>>>> ... except, as I said above, at this point your code should not write at
>>>> all, be it in BSS or data, until the C environment is set up. So...
>>>
>>> But we have to save this ROM-passed information before we overwrite it
>>> ourselves (by accident or purpose).
>>
>> Thete are two official places for data storage before the full C
>> runtime environment is available: the stack, and the "global data"
>> structure.
> 
> I thought there were more levels than just pre and post CRT. Specifically,
> the global_data struct's comment says it is intended to be used "until we
> have set up the memory controller so that we can use RAM."
> 
> To me that suggests once we have RAM any further data storage should go there
> instead of bloating global_data. I thought this distinction was embodied in
> the bss/data section difference with the former being zeroed during CRT init
> and the latter not.
> 
> And I'm clearly not the only one who thought this. The change I proposed in
> common/spl/spl.c that Albert doesn't like:
> 
>> -u32 *boot_params_ptr = NULL;
>> +u32 *boot_params_ptr __attribute__ ((section(".data")));
> 
> is already immediately followed by exactly the same pattern:
> 
>> static bd_t bdata __attribute__ ((section(".data")));
> 
> The only reason I can think of to put bdata explicitly in .data instead of
> the default .bss is so it can avoid the CRT zeroing of .bss.
> 
> If that's wrong then why have both sections? How are they different?
> 
>>> ... after that we can talk about moving things that can't be in the BSS
>>> out of the data section and into another section.
>>
>> Adding another section makes things more complicated, but not really
>> better.
> 
> My proposal does not add another section. The needed section already exists
> and seemingly for precisely the purpose under discussion.
> 
>> If you can provide writable storage, then you could also use
>> it in a more regular way, say for a writable data segment, or bigger
>> stack, or malloc space, or ... so it is generally useful instead of
>> only this special case here.
> 
> This is exactly my concern. I see no justification for a special case.
> If never writing to any linker-defined section (.data or .bss) before CRT
> init really is the design rule then there are quite a few other violations
> that need to be fixed. Rolling an ad hoc solution for each can't be the
> right approach.
> 
  Sorry for the late feedback.
  The **only** reason for passing the boot_params from SPL to U-BOOT was
  when somebody uses a CONFIGURATION HEADER + SPL + U-BOOT, which
  was never a case. But the broken code that you pointed was trying to help 
  such a scenario. I guess nobody would have used this combination.

  save_boot_params ideally should not write in to either .data or .bss.
  Because this would break a XIP kind of a boot. The only place where it can
  write is the GD or some reserved SRAM area that is always 'writable'.
  We did not have a XIP in OMAP4/5 and thus this went unnoticed.

  I will post a patch today to address this.

Regards,
 Sricharan

  reply	other threads:[~2013-04-08  9:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02 22:39 [U-Boot] OMAP (4) boot_params Michael Cashwell
2013-04-03  5:56 ` Albert ARIBAUD
2013-04-03 13:45   ` Michael Cashwell
2013-04-03 14:36     ` Albert ARIBAUD
2013-04-03 14:59       ` Michael Cashwell
2013-04-03 15:34         ` Albert ARIBAUD
2013-04-03 16:42           ` Tom Rini
2013-04-04  5:52             ` Wolfgang Denk
2013-04-04 14:18               ` Michael Cashwell
2013-04-08  9:43                 ` Sricharan R [this message]
2013-04-08 12:42                   ` Michael Cashwell
2013-04-04 19:54               ` Tom Rini

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=51629140.40002@ti.com \
    --to=r.sricharan@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox