TQM5200: fix bug in SDRAM initialization code
PATCH 1/1 TQM5200: fix bug in SDRAM initialization code
This patch fixes a bug in the SDRAM initialization code for the TQM5200. The hi_addr bit is now set correctly. Without this patch the hi_addr bit is always set to 1, if the second SDRAM bank is not populated.
For other MPC5200 boards a correspondig patch has already been applied some time ago, see commit a63109281ad41b0fb489fdcb901171f76bcdbc2c.
--
Forget the first patch please. I confused flash with SDRAM in the comment ...
---
board/tqm5200/tqm5200.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
board/tqm5200/tqm5200.c +7 -4
@@ -155,10 +155,13 @@ long int initdram (int board_type) *(vu_long *)MPC5XXX_SDRAM_CS1CFG = dramsize +0x0000001c ;/* 512MB */ /* find RAM size using SDRAM CS1 only */ -sdram_start (0 ); - test1 =get_ram_size ((long *)(CFG_SDRAM_BASE + dramsize),0x20000000 ); -sdram_start (1 ); - test2 =get_ram_size ((long *)(CFG_SDRAM_BASE + dramsize),0x20000000 ); +if (!dramsize) +sdram_start (0 ); + test2 = test1 =get_ram_size ((long *)(CFG_SDRAM_BASE + dramsize),0x20000000 ); +if (!dramsize) { +sdram_start (1 ); + test2 =get_ram_size ((long *)(CFG_SDRAM_BASE + dramsize),0x20000000 ); + }if (test1 > test2) {sdram_start (0 ); dramsize2 = test1;
Wolfgang Denk
AppliedPATCH 1/1 TQM5200: fix bug in SDRAM initialization code
Quoted 9 lines · In message <[email protected]> you wrote:
This patch fixes a bug in the SDRAM initialization code for the TQM5200. The
hi_addrbit is now set correctly. Without this patch thehi_addrbit is always set to 1, if the second SDRAM bank is not populated.For other MPC5200 boards a correspondig patch has already been applied some time ago, see commit
a63109281ad41b0fb489fdcb901171f76bcdbc2c.Signed-off-by Martin Krause <[email protected]>
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
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 Writing a book is like washing an elephant: there's no good place to begin or end, and it's hard to keep track of what you've already covered.