* (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 */
#include <asm/processor.h>
#include <asm/io.h>
#include <asm/mmu.h>
-#include <ppc440.h>
+#include <asm/ppc440.h>
+
+DECLARE_GLOBAL_DATA_PTR;
extern int denali_wait_for_dlllock(void);
extern void denali_core_search_data_eye(void);
};
/*
- * 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)
{
return 0;
}
-phys_size_t initdram(int board_type)
+int dram_init(void)
{
phys_size_t size;
int n;
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;
}