arm/davinci/da850: add uart0 pinmux
[oweals/u-boot.git] / arch / arm / cpu / arm926ejs / mx28 / spl_mem_init.c
index 69c865eccc0f2abd8a45ebebf9e31203d092199d..e17a4d7c7fb60caefe8c1f1a568d419aa5360e22 100644 (file)
@@ -82,10 +82,18 @@ uint32_t dram_vals[] = {
        0x00000000, 0x00010001
 };
 
+void __mx28_adjust_memory_params(uint32_t *dram_vals)
+{
+}
+void mx28_adjust_memory_params(uint32_t *dram_vals)
+       __attribute__((weak, alias("__mx28_adjust_memory_params")));
+
 void init_m28_200mhz_ddr2(void)
 {
        int i;
 
+       mx28_adjust_memory_params(dram_vals);
+
        for (i = 0; i < ARRAY_SIZE(dram_vals); i++)
                writel(dram_vals[i], MXS_DRAM_BASE + (4 * i));
 }
@@ -175,10 +183,8 @@ void mx28_mem_setup_vddd(void)
                &power_regs->hw_power_vdddctrl);
 }
 
-void mx28_mem_get_size(void)
+uint32_t mx28_mem_get_size(void)
 {
-       struct mx28_digctl_regs *digctl_regs =
-               (struct mx28_digctl_regs *)MXS_DIGCTL_BASE;
        uint32_t sz, da;
        uint32_t *vt = (uint32_t *)0x20;
        /* The following is "subs pc, r14, #4", used as return from DABT. */
@@ -189,11 +195,11 @@ void mx28_mem_get_size(void)
        vt[4] = data_abort_memdetect_handler;
 
        sz = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE);
-       writel(sz, &digctl_regs->hw_digctl_scratch0);
-       writel(sz, &digctl_regs->hw_digctl_scratch1);
 
        /* Restore the old DABT handler. */
        vt[4] = da;
+
+       return sz;
 }
 
 void mx28_mem_init(void)
@@ -241,6 +247,4 @@ void mx28_mem_init(void)
        early_delay(10000);
 
        mx28_mem_setup_cpu_and_hbus();
-
-       mx28_mem_get_size();
 }