public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Zhukov <zhukov@tst.spb.su>
To: u-boot@lists.denx.de
Subject: Fwd: Re[2]: [U-Boot-Users] at91rm9200 lowlevel_init.S
Date: Thu, 12 Jan 2006 18:42:06 +0300	[thread overview]
Message-ID: <368204843.20060112184206@tst.spb.su> (raw)
In-Reply-To: <12601906.20060112170843@tst.spb.su>

>> 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,

  parent reply	other threads:[~2006-01-12 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Zhukov [this message]
2006-01-12 16:08       ` Fwd: Re[2]: " Wolfgang Denk

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=368204843.20060112184206@tst.spb.su \
    --to=zhukov@tst.spb.su \
    --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