linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* SDRAM init
@ 2005-08-17  6:14 Susheel Raj
  0 siblings, 0 replies; only message in thread
From: Susheel Raj @ 2005-08-17  6:14 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

 I have been facing problems while writing to SDRAM
control regsiter. Somehow the hardware doesnt allow me
to write to SDRAM control register costing me a reboot
everytime.

I took the code from u-boot sdram_init and it works
fine only while i am executing it from the flash.

I want to leave the SDRAM control register value to be
0xd04f0000 at setup instead of 0x504f0000.

How should I do it??? 

It seems that the control register has to be
manipulated with some special care, like, precharging
all banks  before manipulating or something ...

the below code works fine from flash
void sdram_init()
{
        initdram ();
        /* unlock mode register */
        *(int *)MPC5XXX_SDRAM_CTRL = 0xd04f0000 |
hi_addr_bit;
        /* precharge all banks */
        *(int *)MPC5XXX_SDRAM_CTRL = 0xd04f0002 |
hi_addr_bit;
        /* set mode register */

        *(int *)MPC5XXX_SDRAM_MODE = 0x00cd0000;

        /* precharge all banks */
        *(int *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 |
hi_addr_bit;
        /* auto refresh */
        *(int *)MPC5XXX_SDRAM_CTRL = 0xd04f0004 |
hi_addr_bit;
 /* set mode register */
        *(int *)MPC5XXX_SDRAM_MODE = 0x00cd0000;
 /* normal operation */

        *(int *)MPC5XXX_SDRAM_CTRL = 0x504f0000 |
hi_addr_bit;
            
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
             
}

but If i want to deave MPC5xxx_SDRAM_CTRL to
0xd04f0000 it doesnt allow me . By the way just for
reference the address of this register is (MBAR +
0x0104)

I tried all trial and errors for understanding how to
manipulating with this register but in vain.

Please do help me ....


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-17  6:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-17  6:14 SDRAM init Susheel Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).