SPDX: Convert all of our single license tags to Linux Kernel style
[platform/kernel/u-boot.git] / board / freescale / ls1021aqds / ddr.c
index 6435bf9..98faf93 100644 (file)
@@ -1,13 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright 2014 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
 #include <asm/io.h>
+#include <asm/arch/clock.h>
 #include "ddr.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -96,6 +96,9 @@ found:
 #else
        popts->cswl_override = DDR_CSWL_CS0;
 
+       /* optimize cpo for erratum A-009942 */
+       popts->cpo_sample = 0x58;
+
        /* DHC_EN =1, ODT = 75 Ohm */
        popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR1_ODT(DDR_CDR_ODT_75ohm);
        popts->ddr_cdr2 = DDR_CDR2_ODT(DDR_CDR_ODT_75ohm);
@@ -161,7 +164,7 @@ void board_mem_sleep_setup(void)
 }
 #endif
 
-phys_size_t initdram(int board_type)
+int fsl_initdram(void)
 {
        phys_size_t dram_size;
 
@@ -176,11 +179,15 @@ phys_size_t initdram(int board_type)
        fsl_dp_resume();
 #endif
 
-       return dram_size;
+       gd->ram_size = dram_size;
+
+       return 0;
 }
 
-void dram_init_banksize(void)
+int dram_init_banksize(void)
 {
        gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_dram[0].size = gd->ram_size;
+
+       return 0;
 }