]> Git Repo - J-u-boot.git/blobdiff - board/mpc8308_p1m/sdram.c
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
[J-u-boot.git] / board / mpc8308_p1m / sdram.c
index a6e44e6efe5832f30696b6fdc8abf74609aefdb9..cbf8781746ebaaf06bb4a14e1d2d8334ce9c4acd 100644 (file)
@@ -1,30 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2007 Freescale Semiconductor, Inc.
  * Copyright (C) 2010 Ilya Yanok, Emcraft Systems, [email protected]
  *
  * This files is  mostly identical to the original from
  * board/freescale/mpc8308rdb/sdram.c
 /*
  * Copyright (C) 2007 Freescale Semiconductor, Inc.
  * Copyright (C) 2010 Ilya Yanok, Emcraft Systems, [email protected]
  *
  * This files is  mostly identical to the original from
  * board/freescale/mpc8308rdb/sdram.c
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS for A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
  */
 
 #include <common.h>
  */
 
 #include <common.h>
+#include <init.h>
 #include <mpc83xx.h>
 
 #include <asm/bitops.h>
 #include <mpc83xx.h>
 
 #include <asm/bitops.h>
@@ -46,7 +30,7 @@ static long fixed_sdram(void)
        u32 msize_log2 = __ilog2(msize);
 
        out_be32(&im->sysconf.ddrlaw[0].bar,
        u32 msize_log2 = __ilog2(msize);
 
        out_be32(&im->sysconf.ddrlaw[0].bar,
-                       CONFIG_SYS_DDR_SDRAM_BASE  & 0xfffff000);
+                       CONFIG_SYS_SDRAM_BASE  & 0xfffff000);
        out_be32(&im->sysconf.ddrlaw[0].ar, LBLAWAR_EN | (msize_log2 - 1));
        out_be32(&im->sysconf.ddrcdr, CONFIG_SYS_DDRCDR_VALUE);
 
        out_be32(&im->sysconf.ddrlaw[0].ar, LBLAWAR_EN | (msize_log2 - 1));
        out_be32(&im->sysconf.ddrcdr, CONFIG_SYS_DDRCDR_VALUE);
 
@@ -74,10 +58,10 @@ static long fixed_sdram(void)
        setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
        sync();
 
        setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
        sync();
 
-       return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize);
+       return get_ram_size(CONFIG_SYS_SDRAM_BASE, msize);
 }
 
 }
 
-phys_size_t initdram(int board_type)
+int dram_init(void)
 {
        immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
        u32 msize;
 {
        immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
        u32 msize;
@@ -88,6 +72,8 @@ phys_size_t initdram(int board_type)
        /* DDR SDRAM */
        msize = fixed_sdram();
 
        /* DDR SDRAM */
        msize = fixed_sdram();
 
-       /* return total bus SDRAM size(bytes)  -- DDR */
-       return msize;
+       /* set total bus SDRAM size(bytes)  -- DDR */
+       gd->ram_size = msize;
+
+       return 0;
 }
 }
This page took 0.027173 seconds and 4 git commands to generate.