mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox <barebox@lists.infradead.org>
Subject: Re: bug in arm_cpu_lowlevel_init ??
Date: Thu, 27 Feb 2014 09:01:42 +0100	[thread overview]
Message-ID: <20140227080142.GE17250@pengutronix.de> (raw)
In-Reply-To: <20140227075126.GB20720@greatfirst.com>

On Thu, Feb 27, 2014 at 03:51:26PM +0800, zzs wrote:
> >
> > The lr (r14) register has different instances, one for each mode. It
> > could be that once we switch to a different mode in arm_cpu_lowlevel_init
> > we see another instance of r14. So to me the patch looks correct, we
> > shouldn't rely on lr as return address but rather use another register
> > for storing the address.
> > The above only happens though when the CPU is not in SVC32 mode already.
> > What first stage loader are you using? Could you analyze in which mode
> > the CPU is when the loader jumps to barebox?
> >
> The first stage loader was written by myself longlong ago. So forgot the
> details.  I just look the code closer, Found the flowwing line just
> before jumps to barebox.
> 
>   asm ("msr CPSR_c, %0" : :"i"(ARM_MODE_SYS|I_BIT|F_BIT));
> 
> So it seems the cpu is in system mode when run barebox.
> Your explanation is right.

Ok, so arm_cpu_lowlevel_init currently only works if the CPU is in SVC32
mode already. Could you send a formal patch with the change you made
with a Signed-off-by line? Then I'll include it in barebox.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2014-02-27  8:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  6:15 zzs
2014-02-27  6:53 ` Alexander Shiyan
2014-02-27  7:53   ` zzs
2014-02-27  7:27 ` Sascha Hauer
2014-02-27  7:51   ` zzs
2014-02-27  8:01     ` Sascha Hauer [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=20140227080142.GE17250@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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