U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Young <young726@hotmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] A question about sdram_init
Date: Thu, 13 May 2004 19:12:21 -0400	[thread overview]
Message-ID: <BAY2-F154cU2MvLbqer00014ec9@hotmail.com> (raw)

>In message <BAY2-F150B8F0GuRQm600014934@hotmail.com> you wrote:
> > To explain the problem easier, I stripped down the sdram_init() to three 
>DCR
> > instructions:
>
>I guess this is on a MIPS64 system? Or ARM9? Or x86, or what?

I am using PPC405 on a custom board, similiar as WALNUT.


>
> > 1. The sdram() hanged after 2nd line, i.e. after set up 4MB. But it 
>didn't
> > go through 3rd line and didn't return.
>
>How did you know where it hangs? Did you use a debugger?
>

I don't have a debugger. But I do have LEDs on the board, so I simply use 
LEDs to indicate where the program stops. I turn on a yellow LED right 
before the 2nd line and a green LED right after the 2nd line. Yellow LED was 
turned on but nothing happened to green one.

I am using IOC to control LED. The code to control LED is pretty simple. For 
example, to turn on yellow LED:
lis 20, 0xF0000030 at h
ori 20, 20, 0xF0000030 at l
li21, 0xC0
stb 21, 0(20)

I have been using this LED control for a while. Never got any problem with 
it.


> > 2. If the 1st line is commented, i.e. not disable everything, sdram() 
>could
> > return.
>
>How do you know your code is correct?
>

I didn't write any code. All these three lines were in original 
sdram_init(). Original sdram_init() tried to detect sdram with different 
size. I have 8MB SDRAM on my board, so I just eliminated all the code for 
128M, 64M, ..., but keep the code for 4M SDRAM. The codes left only have 
three lines:
void sdram(void) {
/*1st*/ mtsdram0(mem_mcopt1, 0x00000000);
/*2nd*/ mtsdram0(mem_mb0cf, 0x00008001);
/*3rd*/ mtsdram0(mem_mcopt1, 0x80800000);
return;
}

BTW, I commented out udelay(200). But I don't think it will have any affect.


> > 3. Since sdram() is called from start.S, I rewrote all these code in 
>start.S
> > in assembly language and let them run in start.S (commented out "bl
> > sdram_init"), these three lines can run without any problem. They didn't
> > interfere each other.
>
>There is no difference between C code and assembly - unless you wrote
>different code.

That is why I am confused... ;*(

My doubt is the first line:
/*1st*/ mtsdram0(mem_mcopt1, 0x00000000);

It disabled the memory controller. Will this cause any memory problem?


Thanks!
Frank

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar ? get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

             reply	other threads:[~2004-05-13 23:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-13 23:12 Frank Young [this message]
2004-05-13 23:39 ` [U-Boot-Users] A question about sdram_init Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2004-05-14  7:36 [U-Boot-Users] U-Boot on LH7A400 Wolfgang Denk
2004-05-14  8:15 ` [U-Boot-Users] A question about sdram_init Stefan Roese
2004-05-14  0:22 Frank Young
2004-05-14  7:35 ` Wolfgang Denk
2004-05-13 18:54 Frank Young
2004-05-13 19:27 ` 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=BAY2-F154cU2MvLbqer00014ec9@hotmail.com \
    --to=young726@hotmail.com \
    --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