public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Allen Martin <amartin@nvidia.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] tegra20: add back USE_PRIVATE_LIBGCC
Date: Tue, 7 Aug 2012 16:34:34 -0700	[thread overview]
Message-ID: <20120807233434.GL7791@nvidia.com> (raw)
In-Reply-To: <1344379365.1477.34.camel@tellur>

On Tue, Aug 07, 2012 at 03:42:45PM -0700, Lucas Stach wrote:
> Am Dienstag, den 07.08.2012, 15:28 -0700 schrieb Allen Martin:
> > On Tue, Aug 07, 2012 at 10:53:00AM -0700, Lucas Stach wrote:
> > > Hi Allen,
> > > 
> > > And to answer Tom's question: the failure was that the real U-Boot would
> > > not come up after the SPL. All I could see was the one line printed by
> > > the SPL and nothing more.
> > 
> > I think I found the problem.  It's the following code from start.S:
> > 
> > ENTRY(cpu_init_crit)
> >        /*
> >         * Jump to board specific initialization...
> >         * The Mask ROM will have already initialized
> >         * basic memory. Go here to bump up clock rate and handle
> >         * wake up conditions.
> >         */
> >        mov     ip, lr                  @ persevere link reg across
> >        call
> >        bl      lowlevel_init           @ go setup pll,mux,memory
> >        mov     lr, ip                  @ restore link
> >        mov     pc, lr                  @ back to my caller
> > ENDPROC(cpu_init_crit)
> > 
> > 
> > The "ip" register is not preserved across function calls, and the
> > CodeSourcery compiler is using it in lowlevel_init or one of the
> > functions it calls.  This code was there before the SPL changes, but
> > wasn't being called because CONFIG_SKIP_LOWLEVEL_INIT was set, but now
> > it isn't.
> > 
> > Lucas, can you try the following change?  I tested it on seaboard with
> > CodeSourcery arm-2011.09-70-arm-none-linux-gnueabi and I'm able to
> > boot a kernel.
> 
> Yes I can confirm this fixes the issue without further workarounds.
> Thanks, and:
> 
> Tested-by: Lucas Stach <dev@lynxeye.de>

Digging a little deeper into this, cpu_init_crit() and lowlevel_init()
are called before the stack is setup, so the fact that we call into C
code on tegra here is probably the bigger issue.  I think the correct
fix here is for me to move the code from lowlevel_init() to
board_init_f(). 

-Allen
-- 
nvpublic

  reply	other threads:[~2012-08-07 23:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07  0:19 [U-Boot] [PATCH] tegra20: add back USE_PRIVATE_LIBGCC Lucas Stach
2012-08-07 17:00 ` Stephen Warren
2012-08-07 17:09   ` Lucas Stach
2012-08-07 17:43     ` Allen Martin
2012-08-07 17:53       ` Lucas Stach
2012-08-07 20:11         ` Allen Martin
2012-08-07 22:28         ` Allen Martin
2012-08-07 22:42           ` Lucas Stach
2012-08-07 23:34             ` Allen Martin [this message]
2012-08-07 18:36 ` 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=20120807233434.GL7791@nvidia.com \
    --to=amartin@nvidia.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