* [U-Boot] [PATCH] muas3001: added 64MB SDRAM autodetection.
@ 2008-09-08 8:19 Heiko Schocher
2008-09-10 8:52 ` Wolfgang Denk
0 siblings, 1 reply; 2+ messages in thread
From: Heiko Schocher @ 2008-09-08 8:19 UTC (permalink / raw)
To: u-boot
[PATCH] muas3001: added 64MB SDRAM autodetection.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
board/muas3001/muas3001.c | 14 ++++++++++++--
include/configs/muas3001.h | 16 +++++++++++-----
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c
index 49aed03..0ec451f 100644
--- a/board/muas3001/muas3001.c
+++ b/board/muas3001/muas3001.c
@@ -253,8 +253,10 @@ phys_size_t initdram (int board_type)
{
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8260_t *memctl = &immap->im_memctl;
-
long psize;
+#ifndef CFG_RAMBOOT
+ long sizelittle, sizebig;
+#endif
memctl->memc_psrt = CFG_PSRT;
memctl->memc_mptpr = CFG_MPTPR;
@@ -262,8 +264,16 @@ phys_size_t initdram (int board_type)
#ifndef CFG_RAMBOOT
/* 60x SDRAM setup:
*/
- psize = try_init (memctl, CFG_PSDMR, CFG_OR1,
+ sizelittle = try_init (memctl, CFG_PSDMR_LITTLE, CFG_OR1_LITTLE,
+ (uchar *) CFG_SDRAM_BASE);
+ sizebig = try_init (memctl, CFG_PSDMR_BIG, CFG_OR1_BIG,
(uchar *) CFG_SDRAM_BASE);
+ if (sizelittle < sizebig) {
+ psize = sizebig;
+ } else {
+ psize = try_init (memctl, CFG_PSDMR_LITTLE, CFG_OR1_LITTLE,
+ (uchar *) CFG_SDRAM_BASE);
+ }
#endif /* CFG_RAMBOOT */
icache_enable ();
diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h
index 77e1158..5d157b6 100644
--- a/include/configs/muas3001.h
+++ b/include/configs/muas3001.h
@@ -331,8 +331,7 @@
/* Bank 1 - 60x bus SDRAM
*/
-#define SDRAM_MAX_SIZE 0x08000000 /* max. 128 MB */
-#define CFG_GLOBAL_SDRAM_LIMIT (128 << 20) /* less than 128 MB */
+#define CFG_GLOBAL_SDRAM_LIMIT (256 << 20) /* less than 256 MB */
#define CFG_MPTPR 0x2800
@@ -348,16 +347,23 @@
BRx_MS_SDRAM_P |\
BRx_V)
-#define CFG_OR1_PRELIM CFG_OR1
+#define CFG_OR1_PRELIM CFG_OR1_LITTLE
/* SDRAM initialization values
*/
-#define CFG_OR1 ((~(CFG_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
+#define CFG_OR1_LITTLE ((~(CFG_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
ORxS_BPD_4 |\
ORxS_ROWST_PBI1_A7 |\
ORxS_NUMR_12)
-#define CFG_PSDMR 0x004b36a3
+#define CFG_PSDMR_LITTLE 0x004b36a3
+
+#define CFG_OR1_BIG ((~(CFG_GLOBAL_SDRAM_LIMIT-1) & ORxS_SDAM_MSK) |\
+ ORxS_BPD_4 |\
+ ORxS_ROWST_PBI1_A4 |\
+ ORxS_NUMR_12)
+
+#define CFG_PSDMR_BIG 0x014f36a3
/* IO on CS4 initialization values
*/
--
1.5.6.1
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] muas3001: added 64MB SDRAM autodetection.
2008-09-08 8:19 [U-Boot] [PATCH] muas3001: added 64MB SDRAM autodetection Heiko Schocher
@ 2008-09-10 8:52 ` Wolfgang Denk
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2008-09-10 8:52 UTC (permalink / raw)
To: u-boot
Dear Heiko Schocher,
In message <48C4E018.20203@denx.de> you wrote:
> [PATCH] muas3001: added 64MB SDRAM autodetection.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
> board/muas3001/muas3001.c | 14 ++++++++++++--
> include/configs/muas3001.h | 16 +++++++++++-----
> 2 files changed, 23 insertions(+), 7 deletions(-)
Applied, thanks.
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
The connection between the language in which we think/program and the
problems and solutions we can imagine is very close. For this reason
restricting language features with the intent of eliminating pro-
grammer errors is at best dangerous.
- Bjarne Stroustrup in "The C++ Programming Language"
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-10 8:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-08 8:19 [U-Boot] [PATCH] muas3001: added 64MB SDRAM autodetection Heiko Schocher
2008-09-10 8:52 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox