* [U-Boot] [U-Boot-Users]
@ 2012-01-23 5:07 periyasamy samy
2012-01-23 5:34 ` Prabhakar Lad
2012-01-23 5:37 ` Wolfgang Denk
0 siblings, 2 replies; 4+ messages in thread
From: periyasamy samy @ 2012-01-23 5:07 UTC (permalink / raw)
To: u-boot
hi.. i am new to u-boot. can u help me where to start.
--
*Thanks & Regards**
*
*periyasamy.R*
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [U-Boot-Users]
2012-01-23 5:07 [U-Boot] [U-Boot-Users] periyasamy samy
@ 2012-01-23 5:34 ` Prabhakar Lad
2012-01-23 5:37 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: Prabhakar Lad @ 2012-01-23 5:34 UTC (permalink / raw)
To: u-boot
Hi Periyasamy,
Probably you need to be more elaborate on what exactly you want.
you might before go through this links before asking you queries.
http://www.denx.de/wiki/DULG/Faq
http://www.denx.de/wiki/U-Bootdoc/Presentation
http://www.denx.de/wiki/U-Boot/WebHome
WBR,
--Prabhakar Lad
On Mon, Jan 23, 2012 at 10:37 AM, periyasamy samy
<eceperiyasamy@gmail.com>wrote:
> hi.. i am new to u-boot. can u help me where to start.
>
> --
>
> *Thanks & Regards**
> *
>
> *periyasamy.R*
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [U-Boot-Users]
2012-01-23 5:07 [U-Boot] [U-Boot-Users] periyasamy samy
2012-01-23 5:34 ` Prabhakar Lad
@ 2012-01-23 5:37 ` Wolfgang Denk
1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2012-01-23 5:37 UTC (permalink / raw)
To: u-boot
Dear periyasamy samy,
In message <CABftKV0_r+_wJ_baKuJkpCaXRK6qsicG9UhHAZ+q2mPQe9QuKg@mail.gmail.com> you wrote:
>
> hi.. i am new to u-boot. can u help me where to start.
Start reading (in that order):
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.netmeister.org/news/learn2quote.html
http://www.denx.de/wiki/U-Boot
http://www.denx.de/wiki/view/DULG/UBoot
http://git.denx.de/?p=u-boot.git;a=blob;f=README
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [U-Boot-Users]
@ 2017-01-13 15:09 Rahul.Shinde at Emerson.com
0 siblings, 0 replies; 4+ messages in thread
From: Rahul.Shinde at Emerson.com @ 2017-01-13 15:09 UTC (permalink / raw)
To: u-boot
Hi,
I have a query regarding SDRAM initialization part in U boot code.
In Initdram function after prerecharge all bank command is delay required or reading from particular address is required?
In our u boot code see below part highlighted in GREEN color is added after precharge all bank command, We don't know actual purpose of that commands after precharge all bank command.
long int initdram (int board_type)
{
volatile unsigned long *pdata;
volatile unsigned short *pdatashort;
volatile unsigned char *pdatachar;
volatile char tmpchar;
volatile long i;
volatile unsigned long tmplong;
volatile ioport_t *iopc;
volatile unsigned int data = 0;
volatile unsigned char boardRev = 0;
volatile int msize;
// Check board rev
iopc = ioport_addr((immap_t *)CFG_IMMR, 2 /* port C */);
/* THIS IS IMPORTANT. DON'T TAKE THIS LOOP OUT AT ANY COST!
Rev A CPU boards have Rev input pins that are floating in the air. When we change the
GPIO assignment to input, these pins change from reading all 0's to all 1's! So the
following loops gives us enough settling time before the startup script reads the board
revision to determine what drivers to load.
*/
for (i = 0; i < 64; ++i)
{
//Port C 22, 23, 27, 31 - Bit 22 Most Significant, Bit 31 Least Significant
data = iopc->pdat;
boardRev = (unsigned char)( (data & 0x00000001) | ((data >> 3) & 0x00000002) | ((data >> 6) & 0x0000000C) );
}
//*************************************************************
// initialize - PSDRAM BR3 & OR3
//
// PSDRAM OR = FE002EC0 (32 Mbyte)
// PSDRAM OR = FC002CC0 (64 Mbyte)
// PSDRAM OR = F8002B00 (128 Mbyte)
// PSDRAM OR = F0002900 (256 Mbyte)
//
//*************************************************************
//kf set {unsigned long} 0xf001011c=0xfc002d10
pdata = (unsigned long *) 0xf0010118; //BR3
*pdata =0x00001841;
#ifdef _64MB_SDRAM
pdata = (unsigned long *) 0xf001011c; //OR3
*pdata =0xfc002d10;
#else
pdata = (unsigned long *) 0xf001011c; //OR3
*pdata =0xf8002B00;
#endif
// Check Board Rev and do initialization...
if (boardRev == 0x7) //256Mbyte SDRAM
{
msize = 256;
pdata = (unsigned long *) 0xf0010138; //BR7
*pdata =0x08001841;
pdata = (unsigned long *) 0xf001013c; //OR7
*pdata =0xf8002B00;
}
else //128Mbyte SDRAM
{
#ifdef _64MB_SDRAM
msize = 64;
#else
msize = 128;
#endif
}
//*************************************************************
// program the MPTPR -
//*************************************************************
pdatashort = (unsigned short *) 0xf0010184;
*pdatashort = (unsigned short)0x1f00;
//*************************************************************
// SDRAM Initialization
//*************************************************************
//wait 100us before accessing
for(i = 0; i < 25000; i ++);
//*************************************************************
// initialize - PSDRAM mode reg (PSDMR)
//
// C2CA2462 (32 Mbyte)
// C34E2462 (64 Mbyte)
// C3AE2462 (128 Mbyte)
// C4322462 (256 Mbyte)
//
//*************************************************************
//kf set {unsigned long} 0xf0010190=0xC3A9A522
pdata = (unsigned long *) 0xf0010190;
#ifdef _64MB_SDRAM
*pdata =0xC349A522;
#else
*pdata =0xC44DA522;
#endif
//*************************************************************
// program PSRT - PSDRAM refresh timer
//
// 0x64 (32 Mbyte)
// 0x64 (64 Mbyte)
// 0x32 (128 Mbyte)
// 0x32 (256 Mbyte)
//
//*************************************************************
//byte 0xf001019C = 0x64
//kf byte 0xf001019C = 0x32
pdatachar = (unsigned char *) 0xf001019C;
#ifdef _64MB_SDRAM
*pdatachar = 0x06; //???why? From Bench! why? -Vipin
#else
// *pdatachar = 0x0F; //should refresh 8192 lines in 64ms w/ 66Mhz bus
*pdatachar = 0x06; //should refresh 8192 lines in 64ms w/ 66Mhz bus
#endif
//*************************************************************
// SDRAM Initialization
//*************************************************************
//wait 100us before accessing
for(i = 0; i < 25000; i ++);
//Precharge all banks SMMR[OP]=101
pdatachar = (unsigned char *) 0xf0010190;
#ifdef _64MB_SDRAM
*pdatachar = 0xeb; //1110 1011
#else
*pdatachar = 0xec; //1110 1100
#endif
/*
print {unsigned char} 0x00000110
print {unsigned char} 0x00000023
*/
//Important!! Must do the following two byte reads from the stated address
//to complete SDRAM init.
pdatachar = (unsigned char *)0x00000110;
tmpchar = *pdatachar;
pdatachar = (unsigned char *)0x00000023;
tmpchar = *pdatachar;
if (boardRev == 0x7) //256Mbyte SDRAM
{
pdatachar = (unsigned char *)0x08000110;
tmpchar = *pdatachar;
pdatachar = (unsigned char *)0x08000023;
tmpchar = *pdatachar;
}
#ifdef _64MB_SDRAM
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcb;
#else
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
pdatachar = (unsigned char *) 0xf0010190;
*pdatachar = 0xcc;
#endif
pdatachar = (unsigned char *) 0x00000023;
*pdatachar = 0xff;
if (boardRev == 0x7) //256Mbyte SDRAM
{
pdatachar = (unsigned char *) 0x08000023;
*pdatachar = 0xff;
}
//Issue Mode set command SMMR[OP]=011
pdatachar = (unsigned char *) 0xf0010190;
#ifdef _64MB_SDRAM
*pdatachar = 0xdb;
#else
*pdatachar = 0xdc;
#endif
//kf byte 0x00000110
pdatachar = (unsigned char *)0x00000023;
tmpchar = *pdatachar;
if (boardRev == 0x7) //256Mbyte SDRAM
{
pdatachar = (unsigned char *) 0x08000023;
tmpchar = *pdatachar;
}
//set PSDMR for normal operation
pdatachar = (unsigned char *) 0xf0010190;
#ifdef _64MB_SDRAM
*pdatachar = 0xc3;
#else
*pdatachar =0xC4;
#endif
// monitor reg MSR=0
//
//kf half 0xfa000006 = 0x01c9
//kf half 0xfa000006
//kf
//kf byte 0xfa00000f = 0x40
//print {unsigned long} 0xf00101a8
//print {unsigned long} 0xf00101a8
//print {unsigned long} 0xf00101a8
//need to do above? Oh well!
pdata = (unsigned long *)0xf00101a8;
tmplong = *pdata;
tmplong = *pdata;
tmplong = *pdata;
//set {unsigned long} 0x0=0x55555555
//print {unsigned long} 0x0
//set {unsigned long} 0x0=0xaaaaaaaa
//print {unsigned long} 0x0
/* return total 60x bus SDRAM size */
return (msize * 1024 * 1024);
}
Please let me know your comments?
Thanks,
Rahul Shinde
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-13 15:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23 5:07 [U-Boot] [U-Boot-Users] periyasamy samy
2012-01-23 5:34 ` Prabhakar Lad
2012-01-23 5:37 ` Wolfgang Denk
2017-01-13 15:09 Rahul.Shinde at Emerson.com
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.