Commit 9973e3c6 authored by Becky Bruce's avatar Becky Bruce Committed by Wolfgang Denk
Browse files

Change initdram() return type to phys_size_t



This patch changes the return type of initdram() from long int to phys_size_t.
This is required for a couple of reasons: long int limits the amount of dram
to 2GB, and u-boot in general is moving over to phys_size_t to represent the
size of physical memory.  phys_size_t is defined as an unsigned long on almost
all current platforms.

This patch *only* changes the return type of the initdram function (in
include/common.h, as well as in each board's implementation of initdram).  It
does not actually modify the code inside the function on any of the platforms;
platforms which wish to support more than 2GB of DRAM will need to modify
their initdram() function code.

Build tested with MAKEALL for ppc, arm, mips, mips-el. Booted on powerpc
MPC8641HPCN.

Signed-off-by: default avatarBecky Bruce <becky.bruce@freescale.com>
parent 391fd93a
......@@ -39,7 +39,7 @@ int checkboard (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
int size,i;
......
......@@ -35,7 +35,7 @@
** ------
** int board_early_init_f(void)
** int checkboard(void)
** long int initdram(int board_type)
** phys_size_t initdram(int board_type)
** called from 'board_init_f()' into 'common/board.c'
**
** void reset_phy(void)
......@@ -179,7 +179,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8xx_t *memctl = &immap->im_memctl;
......
......@@ -81,7 +81,7 @@ int checkboard (void)
return 0;
}
long initdram (int board_type)
phys_size_t initdram (int board_type)
{
return articiaS_ram_init ();
}
......
......@@ -1728,7 +1728,7 @@ long int dram_size (long int *base, long int maxsize)
/* ppcboot interface function to SDRAM init - this is where all the
* controlling logic happens */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
int s0 = 0, s1 = 0;
int checkbank[4] = {[0 ... 3] = 0 };
......
......@@ -1737,7 +1737,7 @@ long int dram_size (long int *base, long int maxsize)
/* ppcboot interface function to SDRAM init - this is where all the
* controlling logic happens */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
int s0 = 0, s1 = 0;
int checkbank[4] = {[0 ... 3] = 0 };
......
......@@ -165,7 +165,7 @@ void rpxclassic_init (void)
/* ------------------------------------------------------------------------- */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8xx_t *memctl = &immap->im_memctl;
......
......@@ -102,7 +102,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8xx_t *memctl = &immap->im_memctl;
......
......@@ -104,7 +104,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
volatile immap_t *immap = (immap_t *)CFG_IMMR;
volatile memctl8xx_t *memctl = &immap->im_memctl;
......
......@@ -110,7 +110,7 @@ int checkboard (void)
/* ------------------------------------------------------------------------- */
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
volatile immap_t *immap = (immap_t *) CFG_IMMR;
volatile memctl8xx_t *memctl = &immap->im_memctl;
......
......@@ -38,7 +38,7 @@ int checkboard (void)
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
long size;
long new_bank0_end;
......
......@@ -65,7 +65,7 @@ static uint sdram_table[] = {
0xfffffc27, 0xfffffc04, 0xfffffc04, 0xfffffc04
};
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
long int msize;
volatile immap_t *immap = (volatile immap_t *)CFG_IMMR;
......
......@@ -112,7 +112,7 @@ int board_early_init_f (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
u32 msize = 0;
......
......@@ -131,7 +131,7 @@ void setupBat (ulong size)
mtspr (DBAT7U, batu);
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
ulong size;
......
......@@ -50,7 +50,7 @@ int checkboard (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
return (0);
}
......
......@@ -54,7 +54,7 @@ int checkboard (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
return (0);
}
......@@ -34,7 +34,7 @@ int checkboard (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
return (0);
}
......@@ -34,7 +34,7 @@ int checkboard (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
return (0);
}
......@@ -29,7 +29,7 @@ int checkboard (void)
return 0;
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
return (0);
}
......@@ -59,7 +59,7 @@ static void cram_bcr_write(u32 wr_val)
}
#endif
long int initdram(int board_type)
phys_size_t initdram(int board_type)
{
#if defined(CONFIG_NAND_SPL)
u32 reg;
......
......@@ -453,7 +453,7 @@ int checkboard(void)
}
long int initdram (int board_type)
phys_size_t initdram (int board_type)
{
#if !(defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_NAND_SPL))
long dram_size;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment