bug in arm_cpu_lowlevel_init ??

zzs zzs213 at 126.com
Thu Feb 27 01:15:44 EST 2014


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?

Thanks!!

-- 
Best Regards,
zzs





More information about the barebox mailing list