public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/5] ARM: arm926ejs: fix lowlevel_init call
Date: Mon, 07 May 2018 11:11:35 +0100	[thread overview]
Message-ID: <yw1xbmdrbwrs.fsf@mansr.com> (raw)
In-Reply-To: <CAFOYHZAAX9Zb9QYyT393KcBqV=u5EPg_nTt3FJ1Z=3_oVoZ8uw@mail.gmail.com> (Chris Packham's message of "Mon, 07 May 2018 08:25:43 +0000")

Chris Packham <judge.packham@gmail.com> writes:

> Hi Mans, Stefano,
>
> On Fri, Apr 27, 2018 at 9:00 PM Stefano Babic <sbabic@denx.de> wrote:
>
>> On 21/04/2018 17:11, Mans Rullgard wrote:
>> > The code attempts to preserve the value of LR by storing it in R12/IP
>> > across the lowevel_init() call.  However, this register is not saved
>> > by the callee.  Use a register that guaranteed to be preserved instead.
>> >
>> > Signed-off-by: Mans Rullgard <mans@mansr.com>
>> > ---
>> >  arch/arm/cpu/arm926ejs/start.S | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/arch/arm/cpu/arm926ejs/start.S
> b/arch/arm/cpu/arm926ejs/start.S
>> > index 959d1ed86d8a..a6f0bdb70345 100644
>> > --- a/arch/arm/cpu/arm926ejs/start.S
>> > +++ b/arch/arm/cpu/arm926ejs/start.S
>> > @@ -105,9 +105,9 @@ flush_dcache:
>> >       /*
>> >        * Go setup Memory and board specific bits prior to relocation.
>> >        */
>> > -     mov     ip, lr          /* perserve link reg across call */
>> > +     mov     r4, lr          /* perserve link reg across call */
>> >       bl      lowlevel_init   /* go setup pll,mux,memory */
>> > -     mov     lr, ip          /* restore link */
>> > +     mov     lr, r4          /* restore link */
>> >  #endif
>> >       mov     pc, lr          /* back to my caller */
>> >  #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
>> >
>
>> Applied to u-boot-imx, thanks !
>
> I think this might be causing me a problem on a Marvell Kirkwood board I'm
> working on getting into upstream. It may also be problematic for orion5x
> boards. Both of these use r4 in lowlevel_init.

I've just sent an untested patch for orion5x.

-- 
Måns Rullgård

  parent reply	other threads:[~2018-05-07 10:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-21 15:11 [U-Boot] [PATCH 1/5] ARM: mxs: make lowlevel_init() weak Mans Rullgard
2018-04-21 15:11 ` [U-Boot] [PATCH 2/5] ARM: arm926ejs: fix lowlevel_init call Mans Rullgard
2018-04-27  8:59   ` Stefano Babic
2018-05-07  8:25     ` Chris Packham
2018-05-07  8:48       ` klaus.goger at theobroma-systems.com
2018-05-07 21:10         ` Chris Packham
2018-05-07 10:11       ` Måns Rullgård [this message]
2018-05-07 21:08         ` Chris Packham
2018-04-21 15:11 ` [U-Boot] [PATCH 3/5] ARM: spl: include arm/thumb glue sections Mans Rullgard
2018-04-27  8:59   ` Stefano Babic
2018-04-21 15:11 ` [U-Boot] [PATCH 4/5] ARM: mxs: move spl data Mans Rullgard
2018-04-27  8:59   ` Stefano Babic
2018-04-21 15:11 ` [U-Boot] [PATCH 5/5] ARM: mxs: support full SPL framework Mans Rullgard
2018-04-27  9:00   ` Stefano Babic
2018-04-27  8:59 ` [U-Boot] [PATCH 1/5] ARM: mxs: make lowlevel_init() weak Stefano Babic

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=yw1xbmdrbwrs.fsf@mansr.com \
    --to=mans@mansr.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