mpc83xx: Get rid of CONFIG_SYS_DDR_BASE
[oweals/u-boot.git] / board / freescale / corenet_ds / ddr.c
index e7e893a1aec412e6217c4cfd0f9cd6c22ca70412..38f13ce4b2ec39ee30e71015bc044662f6b7e8aa 100644 (file)
@@ -1,9 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * Version 2 as published by the Free Software Foundation.
  */
 
 #include <common.h>
@@ -21,7 +18,7 @@ DECLARE_GLOBAL_DATA_PTR;
  * Fixed sdram init -- doesn't use serial presence detect.
  */
 extern fixed_ddr_parm_t fixed_ddr_parm_0[];
-#if (CONFIG_NUM_DDR_CONTROLLERS == 2)
+#if (CONFIG_SYS_NUM_DDR_CTLRS == 2)
 extern fixed_ddr_parm_t fixed_ddr_parm_1[];
 #endif
 
@@ -58,7 +55,7 @@ phys_size_t fixed_sdram(void)
        ddr_cfg_regs.ddr_cdr1 = DDR_CDR1_DHC_EN;
        fsl_ddr_set_memctl_regs(&ddr_cfg_regs, 0, 0);
 
-#if (CONFIG_NUM_DDR_CONTROLLERS == 2)
+#if (CONFIG_SYS_NUM_DDR_CTLRS == 2)
        memcpy(&ddr_cfg_regs,
                fixed_ddr_parm_1[i].ddr_settings,
                sizeof(ddr_cfg_regs));
@@ -78,7 +75,7 @@ phys_size_t fixed_sdram(void)
                        return 0;
                }
        } else {
-#if (CONFIG_NUM_DDR_CONTROLLERS == 2)
+#if (CONFIG_SYS_NUM_DDR_CTLRS == 2)
                /* We require both controllers have identical DIMMs */
                lawbar1_target_id = LAW_TRGT_IF_DDR_1;
                if (set_ddr_laws(CONFIG_SYS_DDR_SDRAM_BASE,
@@ -262,7 +259,7 @@ found:
        popts->ddr_cdr1 = DDR_CDR1_DHC_EN;
 }
 
-phys_size_t initdram(int board_type)
+int dram_init(void)
 {
        phys_size_t dram_size;
 
@@ -280,5 +277,7 @@ phys_size_t initdram(int board_type)
        dram_size *= 0x100000;
 
        debug("    DDR: ");
-       return dram_size;
+       gd->ram_size = dram_size;
+
+       return 0;
 }