]> git.sur5r.net Git - u-boot/blobdiff - board/keymile/kmp204x/ddr.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / board / keymile / kmp204x / ddr.c
index 34ac6979bd7d13c602f47f8ef218e9123d39ba02..ee2e3d6b9aac83a4a2cca0b55b56b22bb0146db0 100644 (file)
@@ -1,11 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2013 Keymile AG
  * Valentin Longchamp <valentin.longchamp@keymile.com>
  *
  * Copyright 2009-2011 Freescale Semiconductor, Inc.
- *
- * SPDX-License-Identifier:    GPL-2.0+
-  */
+ */
 
 #include <common.h>
 #include <i2c.h>
@@ -14,6 +13,8 @@
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr_dimm_params.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 void fsl_ddr_board_options(memctl_options_t *popts,
                                dimm_params_t *pdimm,
                                unsigned int ctrl_num)
@@ -36,7 +37,7 @@ void fsl_ddr_board_options(memctl_options_t *popts,
        /* we have only one module, half str should be OK */
        popts->half_strength_driver_enable = 1;
 
-       /* wrlvl values overriden as recommended by ddr init func */
+       /* wrlvl values overridden as recommended by ddr init func */
        popts->wrlvl_override = 1;
        popts->wrlvl_sample = 0xf;
        popts->wrlvl_start = 0x6;
@@ -48,7 +49,7 @@ void fsl_ddr_board_options(memctl_options_t *popts,
        popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR_ODT_75ohm;
 }
 
-phys_size_t initdram(int board_type)
+int dram_init(void)
 {
        phys_size_t dram_size = 0;
 
@@ -60,5 +61,7 @@ phys_size_t initdram(int board_type)
        dram_size *= 0x100000;
 
        debug("    DDR: ");
-       return dram_size;
+       gd->ram_size = dram_size;
+
+       return 0;
 }