public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] at91rm9200 lowlevel_init.S
@ 2006-01-11 14:24 Zhukov
  2006-01-11 15:47 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Zhukov @ 2006-01-11 14:24 UTC (permalink / raw)
  To: u-boot

Hello, everybody.

Does anybody know, what can be tuned in "lowlevel_init" procedure in
lowlevel_init.S module for at91rm9200dk? This init suspends u-boot. I
tried to play with delays (loops), but it won't work anyway.

Regards
Andrew Zhukov

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] at91rm9200 lowlevel_init.S
  2006-01-11 14:24 [U-Boot-Users] at91rm9200 lowlevel_init.S Zhukov
@ 2006-01-11 15:47 ` Wolfgang Denk
       [not found]   ` <12601906.20060112170843@tst.spb.su>
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2006-01-11 15:47 UTC (permalink / raw)
  To: u-boot

In message <1136989480.17330.5.camel@localhost.localdomain> you wrote:
> 
> Does anybody know, what can be tuned in "lowlevel_init" procedure in
> lowlevel_init.S module for at91rm9200dk? This init suspends u-boot. I

What exactly do you mean by "suspends u-boot" ?

> tried to play with delays (loops), but it won't work anyway.

???

The code is supposed to work fine on the at91rm9200dk board.

Are you really using such a board, or is this some custom hardware?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Die meisten Menschen pflegen im Kindesalter vom Zeigen auf Gegenst?n-
de (Mausbewegung) und "ga" sagen  (Mausklick)  abzukommen,  zugunsten
eines  m?chtigeren  und langwierig zu erlernenden Tools (Sprache).
                             -- Achim Linder in de.comp.os.linux.misc

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Fwd: Re[2]: [U-Boot-Users] at91rm9200 lowlevel_init.S
       [not found]   ` <12601906.20060112170843@tst.spb.su>
@ 2006-01-12 15:42     ` Zhukov
  2006-01-12 16:08       ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Zhukov @ 2006-01-12 15:42 UTC (permalink / raw)
  To: u-boot

>> Does anybody know, what can be tuned in "lowlevel_init" procedure in
>> lowlevel_init.S module for at91rm9200dk? This init suspends u-boot. I

WD> The code is supposed to work fine on the at91rm9200dk board.
WD> Are you really using such a board, or is this some custom hardware?

Yes, my board is customozed - the hardware engineer edited
RomBoot because of some differences in SDRAM system.

But... anyway, the lowlevel_init.S seems so strange, that 
some bug in its code is suspected.

Would you explain the meaning of _MTEXT_BASE in fragments like
this:

        ldr     r0, =SMRDATA1
        ldr     r1, _MTEXT_BASE
        sub     r0, r0, r1
        add     r2, r0, #176
2:
        /* the address */
        ldr     r1, [r0], #4
        /* the value */
        ldr     r3, [r0], #4
        str     r3, [r1]
        cmp     r2, r0
        bne     2b

I guess _MTEXT_BASE is a start of code, the location just after vectors. 
But what's the use of it here?

Suspecting hardware problem, I skip everything after the first step of
the procedure:

        /* Get the CKGR Base Address */
        ldr     r1, =AT91C_BASE_CKGR           
        /* Main oscillator Enable register */
#ifdef CFG_USE_MAIN_OSCILLATOR
        ldr     r0, =0x0000FF01 /* Enable main oscillator */
#else
        ldr     r0, =0x0000FF00 /* Disable main oscillator */
#endif
        str     r0, [r1, #CKGR_MOR]
        ...     /* delay */
        b         exit          

This cut works fine, u-boot loads. Next, I tried to replace this
with the following:

        ldr     r0, =CKGRDATA      
        ldr     r1, _MTEXT_BASE    
        sub     r0, r0, r1         
        add     r2, r0, #8      /* 8 bytes */
3:
        /* the address */
        ldr     r1, [r0], #4
        /* the value */
        ldr     r3, [r0], #4
        str     r3, [r1]
        cmp     r2, r0
        bne     3b
        ...     /* delay */

        ...
        
CKGRDATA:
        .word AT91C_BASE_CKGR
        .word 0x0000FF01
        /* 8 bytes long */

It FAILS! Obviously, u-boot crashes here. Something wrong in code...

Best regards,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Fwd: Re[2]: [U-Boot-Users] at91rm9200 lowlevel_init.S
  2006-01-12 15:42     ` Fwd: Re[2]: " Zhukov
@ 2006-01-12 16:08       ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2006-01-12 16:08 UTC (permalink / raw)
  To: u-boot

In message <368204843.20060112184206@tst.spb.su> you wrote:
> 
> I guess _MTEXT_BASE is a start of code, the location just after vectors. 

Why are you guessing - why don't you read the code?

_MTEXT_BASE:
...
	.word   TEXT_BASE
...

As you can see your guess was wrong. _MTEXT_BASE is a word of  memory
which holds the value TEXT_BASE.

> But what's the use of it here?

So that you can load it easily into a register?

> It FAILS! Obviously, u-boot crashes here. Something wrong in code...

What does "it crashes here" mean? Where exactly does  it  crash,  and
why? You single-step this code, don't you?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
But the only way of discovering the limits  of  the  possible  is  to
venture a little way past them into the impossible.
                         - _Profiles of the Future_ (1962; rev. 1973)
                  ``Hazards of Prophecy: The Failure of Imagination''

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-01-12 16:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-11 14:24 [U-Boot-Users] at91rm9200 lowlevel_init.S Zhukov
2006-01-11 15:47 ` Wolfgang Denk
     [not found]   ` <12601906.20060112170843@tst.spb.su>
2006-01-12 15:42     ` Fwd: Re[2]: " Zhukov
2006-01-12 16:08       ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox