drivers, block: remove sil680 driver
[platform/kernel/u-boot.git] / board / esd / pmc440 / sdram.c
index 34ff402..c379e77 100644 (file)
  * (C) Copyright 2006-2007
  * Stefan Roese, DENX Software Engineering, sr@denx.de.
  *
- * 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
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 /* define DEBUG for debug output */
@@ -37,6 +24,8 @@
 #include <asm/mmu.h>
 #include <asm/ppc440.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 extern int denali_wait_for_dlllock(void);
 extern void denali_core_search_data_eye(void);
 
@@ -53,7 +42,7 @@ struct sdram_conf_s sdram_conf[] = {
 };
 
 /*
- * initdram -- 440EPx's DDR controller is a DENALI Core
+ * dram_init -- 440EPx's DDR controller is a DENALI Core
  */
 int initdram_by_rb(int rows, int banks)
 {
@@ -118,7 +107,7 @@ int initdram_by_rb(int rows, int banks)
        return 0;
 }
 
-phys_size_t initdram(int board_type)
+int dram_init(void)
 {
        phys_size_t size;
        int n;
@@ -138,12 +127,14 @@ phys_size_t initdram(int board_type)
                               sdram_conf[n].banks);
 
                /* check for suitable configuration */
-               if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size)
-                       return size;
+               if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size) {
+                       gd->ram_size = size;
+                       return 0;
+               }
 
                /* delete TLB entries */
                remove_tlb(CONFIG_SYS_SDRAM_BASE, size);
        }
 
-       return 0;
+       return -ENXIO;
 }