mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Alexander Shiyan" <shc_work@mail.ru>
To: zzs <zzs213@126.com>
Cc: barebox <barebox@lists.infradead.org>
Subject: Re: bug in arm_cpu_lowlevel_init ??
Date: Thu, 27 Feb 2014 10:53:12 +0400	[thread overview]
Message-ID: <1393483992.578503034@f286.i.mail.ru> (raw)
In-Reply-To: <20140227061544.GA20720@greatfirst.com>

Четверг, 27 февраля 2014, 14:15 +08:00 от zzs <zzs213@126.com>:
> My cpu is at91rm9200
> 
> When start barebox at reset time by burn it in Nor flash, all things Ok.
> 
> But when start it by my first stage boot program, It's crash.  And
> Execption process code which install by my boot program, report Undef
> instruction detected.
> 
> The only diff is my boot program change the cpu to svc mode already.
> 
> I try the flowwing patch:
> 
> ------------------------------------------------
> --- a/arch/arm/cpu/lowlevel.S
> +++ b/arch/arm/cpu/lowlevel.S
> @@ -4,6 +4,7 @@
> 
>  .section ".text_bare_init_","ax"
>  ENTRY(arm_cpu_lowlevel_init)
> +       mov     r2, lr
>         /* set the cpu to SVC32 mode */
>         mrs     r12, cpsr
>         bic     r12, r12, #0x1f
> @@ -35,5 +36,5 @@ ENTRY(arm_cpu_lowlevel_init)
> 
>         mcr     p15, 0, r12, c1, c0, 0
> 
> -       mov     pc, lr
> +       mov     pc, r2
>  ENDPROC(arm_cpu_lowlevel_init)
> ------------------------------------------------
> 
> The problem dispeared, All things worked!!
> 
> I'm not very familiar with asm code,
> 
> Anybody tell me is this a bug, Or my boot program has strange behavior?

I can not say anything about this issue,
but maybe something will help article below:
http://www.heyrick.co.uk/armwiki/The_Status_register

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

  reply	other threads:[~2014-02-27  6:53 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 [this message]
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

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=1393483992.578503034@f286.i.mail.ru \
    --to=shc_work@mail.ru \
    --cc=barebox@lists.infradead.org \
    --cc=zzs213@126.com \
    /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