public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tegra20: add assembly wrapper for lowlevel_init()
Date: Wed, 8 Aug 2012 12:48:36 -0700	[thread overview]
Message-ID: <5022C294.1040302@ti.com> (raw)
In-Reply-To: <20120808194454.744FF20401B@gemini.denx.de>

On 08/08/2012 12:44 PM, Wolfgang Denk wrote:
> Dear Allen Martin,
> 
> In message <1344448286-14144-1-git-send-email-amartin@nvidia.com> you wrote:
>> lowlevel_init() is called before stack is initialized, so it's not
>> safe to call directly into C code.  Copy this wrapper from omap that
>> saves off the ip register and sets up a temporary stack.  This fixes a
>> hang using CodeSourcery toolchain.
> ...
>> +	/*
>> +	 * Setup a temporary stack
>> +	 */
>> +	ldr	sp, =LOW_LEVEL_SRAM_STACK
>> +
>> +	/*
>> +	 * Save the old lr(passed in ip) and the current lr to stack
>> +	 */
>> +	push	{ip, lr}
> 
> Are you sure this provides a valid stack frame? I think there are more
> requirements to that...
> 
> 
> BTW: this LOW_LEVEL_SRAM_STACK is really ugly; It is completely
> undocumented, and breaks naming conventions (it should be
> CONFIG_SYS_... instead).  I know that this was not introduced by this
> patch, but it should be fixed ASAP - it's mostly TI and Tegra that use
> that...

So I've been pondering this a little too.  TI and now Tegra are the ones
that use it, but based on the bug Allen ran into it seems like any of
the armv7 platforms could hit it and perhaps we should make this more
generic and live in arch/arm/cpu/armv7/lowlevel_init.S or be part of
start.S.

-- 
Tom

      reply	other threads:[~2012-08-08 19:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 17:51 [U-Boot] [PATCH] tegra20: add assembly wrapper for lowlevel_init() Allen Martin
2012-08-08 19:44 ` Wolfgang Denk
2012-08-08 19:48   ` Tom Rini [this message]

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=5022C294.1040302@ti.com \
    --to=trini@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