public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.u.boot@aribaud.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] OMAP (4) boot_params
Date: Wed, 3 Apr 2013 16:36:23 +0200	[thread overview]
Message-ID: <20130403163623.5d06200a@lilith> (raw)
In-Reply-To: <A507EFEC-AC2F-4A23-AFF1-179F1D48D178@prograde.net>

Hi Michael,

On Wed, 3 Apr 2013 09:45:19 -0400, Michael Cashwell
<mboards@prograde.net> wrote:

> On Apr 3, 2013, at 1:56 AM, Albert ARIBAUD <albert.u.boot@aribaud.net> wrote:
> 
> > (please wrap your line around 70 chars max)
> 
> I've never understood why this is useful. [...]

... but apparently you managed to do it, thanks.

> > On Tue, 2 Apr 2013 18:39:17 -0400, Michael Cashwell
> > <mboards@prograde.net> wrote:
> > 
> >> I've been fighting with SPL passing not boot_params properly to u-boot
> >> on OMAP4. There are many layers to this onion but I've tracked the bulk
> >> of the problem down to the following issues.
> >> 
> >> ...Making that:
> >> 
> >> u32 *boot_params_ptr __attribute__ ((section(".data")));
> >> 
> >> allows the pointer to be in SPL data section (SRAM) and still have its
> >> value by the time image_entry() is called. But common/spl/spl.c is not
> >> omap-specific so changes there are a concern.
> > 
> > If I'm not mistaken, lowlevel_init() is not supposed to use BSS at all,
> > as the C runtime has not been initialized yet -- precisely, the BSS
> > clearing loop long after the cpu_init_crit() call belongs to the code
> > that sets up this environment.
> 
> Yes, that was my thinking too. Surely clearing data after code has set
> it can't be right.

With all due respect, the documentation can with greater legitimately
turn your admonition around and ask that you please refrain from
setting BSS or data variables when the C runtime environment has not
been set. :)

IOW, what is wrong here is writing to a BSS variable before you're
allowed to as per the rules under which your code is running.

> > Besides, it seems like SPL does not jump directly to Linux but to
> > U-Boot, so U-Boot itself should set up the boot params, not SPL, which
> > can at best prepare and store values in static RAM not mapped as data
> > or BSS in either SPL or U-Boot (this is normally done through GD).
> 
> OK, here we have an unfortunate name overloading. The boot_params here
> is specifically an OMAP handoff from the CPU's internal boot ROM to SPL
> and then from SPL to u-boot. (The same code paths are involved.) It's
> totally unrelated to the the boot_params passed to the Linux kernel.
> 
> Since it's confusing maybe a renaming is called for as well.

Indeed. Plus, if it is shared data, it should definitely be mapped at a
fixed memory location or copied from stage to stage (the latter only if
the former is impossible)

> Best regards,
> -Mike

Amicalement,
-- 
Albert.

  reply	other threads:[~2013-04-03 14:36 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 [this message]
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
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=20130403163623.5d06200a@lilith \
    --to=albert.u.boot@aribaud.net \
    --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