* [U-Boot] [PATCH] mxs: SPL: Generalize memory initialization
@ 2012-12-04 13:15 Otavio Salvador
2012-12-07 13:50 ` Stefano Babic
0 siblings, 1 reply; 2+ messages in thread
From: Otavio Salvador @ 2012-12-04 13:15 UTC (permalink / raw)
To: u-boot
Use a generic 'dram_vals[]' array that has the full initialization
sequence and rename the initialization method so it doesn't has a
frequency on its name.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
index 8c7f34a..401c513 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_mem_init.c
@@ -30,7 +30,11 @@
#include "mxs_init.h"
-static uint32_t mx28_dram_vals[] = {
+static uint32_t dram_vals[] = {
+/*
+ * i.MX28 DDR2 at 200MHz
+ */
+#if defined(CONFIG_MX28)
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
@@ -79,6 +83,9 @@ static uint32_t mx28_dram_vals[] = {
0x06120612, 0x04320432, 0x04320432, 0x00040004,
0x00040004, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00010001
+#else
+#error Unsupported memory initialization
+#endif
};
void __mxs_adjust_memory_params(uint32_t *dram_vals)
@@ -87,14 +94,14 @@ void __mxs_adjust_memory_params(uint32_t *dram_vals)
void mxs_adjust_memory_params(uint32_t *dram_vals)
__attribute__((weak, alias("__mxs_adjust_memory_params")));
-static void init_mx28_200mhz_ddr2(void)
+static void initialize_dram_values(void)
{
int i;
- mxs_adjust_memory_params(mx28_dram_vals);
+ mxs_adjust_memory_params(dram_vals);
- for (i = 0; i < ARRAY_SIZE(mx28_dram_vals); i++)
- writel(mx28_dram_vals[i], MXS_DRAM_BASE + (4 * i));
+ for (i = 0; i < ARRAY_SIZE(dram_vals); i++)
+ writel(dram_vals[i], MXS_DRAM_BASE + (4 * i));
}
static void mxs_mem_init_clock(void)
@@ -218,7 +225,7 @@ void mxs_mem_init(void)
/* Clear START bit from DRAM_CTL16 */
clrbits_le32(MXS_DRAM_BASE + 0x40, 1);
- init_mx28_200mhz_ddr2();
+ initialize_dram_values();
/* Clear SREFRESH bit from DRAM_CTL17 */
clrbits_le32(MXS_DRAM_BASE + 0x44, 1);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* [U-Boot] [PATCH] mxs: SPL: Generalize memory initialization
2012-12-04 13:15 [U-Boot] [PATCH] mxs: SPL: Generalize memory initialization Otavio Salvador
@ 2012-12-07 13:50 ` Stefano Babic
0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2012-12-07 13:50 UTC (permalink / raw)
To: u-boot
On 04/12/2012 14:15, Otavio Salvador wrote:
> Use a generic 'dram_vals[]' array that has the full initialization
> sequence and rename the initialization method so it doesn't has a
> frequency on its name.
>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
Applied to u-boot-imx, thanks.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-07 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 13:15 [U-Boot] [PATCH] mxs: SPL: Generalize memory initialization Otavio Salvador
2012-12-07 13:50 ` Stefano Babic
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.