board_f: Drop return value from initdram()

At present we cannot use this function as an init sequence call without a
wrapper, since it returns the RAM size. Adjust it to set the RAM size in
global_data instead, and return 0 on success.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Simon Glass 2017-03-31 08:40:25 -06:00 committed by Tom Rini
parent 52c411805c
commit 088454cde2
136 changed files with 631 additions and 304 deletions

View file

@ -874,7 +874,7 @@ void update_early_mmu_table(void)
__weak int dram_init(void) __weak int dram_init(void)
{ {
gd->ram_size = initdram(); initdram();
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
/* This will break-before-make MMU for DDR */ /* This will break-before-make MMU for DDR */
update_early_mmu_table(); update_early_mmu_table();

View file

@ -9,8 +9,12 @@
#include <asm/addrspace.h> #include <asm/addrspace.h>
#include <mach/ddr.h> #include <mach/ddr.h>
phys_size_t initdram(void) DECLARE_GLOBAL_DATA_PTR;
int initdram(void)
{ {
ddr_tap_tuning(); ddr_tap_tuning();
return get_ram_size((void *)KSEG1, SZ_256M); gd->ram_size = get_ram_size((void *)KSEG1, SZ_256M);
return 0;
} }

View file

@ -110,12 +110,14 @@ static void ddr2_pmd_ungate(void)
} }
/* initialize the DDR2 Controller and DDR2 PHY */ /* initialize the DDR2 Controller and DDR2 PHY */
phys_size_t initdram(void) int initdram(void)
{ {
ddr2_pmd_ungate(); ddr2_pmd_ungate();
ddr2_phy_init(); ddr2_phy_init();
ddr2_ctrl_init(); ddr2_ctrl_init();
return ddr2_calculate_size(); gd->ram_size = ddr2_calculate_size();
return 0;
} }
int misc_init_r(void) int misc_init_r(void)

View file

@ -401,17 +401,19 @@ void mpc85xx_reginfo(void)
#ifndef CONFIG_FSL_CORENET #ifndef CONFIG_FSL_CORENET
#if (defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_SPL)) && \ #if (defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_SPL)) && \
!defined(CONFIG_SYS_INIT_L2_ADDR) !defined(CONFIG_SYS_INIT_L2_ADDR)
phys_size_t initdram(void) int initdram(void)
{ {
#if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD) || \ #if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD) || \
defined(CONFIG_ARCH_QEMU_E500) defined(CONFIG_ARCH_QEMU_E500)
return fsl_ddr_sdram_size(); gd->ram_size = fsl_ddr_sdram_size();
#else #else
return (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; gd->ram_size = (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
#endif #endif
return 0;
} }
#else /* CONFIG_SYS_RAMBOOT */ #else /* CONFIG_SYS_RAMBOOT */
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size = 0; phys_size_t dram_size = 0;
@ -460,7 +462,9 @@ phys_size_t initdram(void)
#endif #endif
debug("DDR: "); debug("DDR: ");
return dram_size; gd->ram_size = dram_size;
return 0;
} }
#endif /* CONFIG_SYS_RAMBOOT */ #endif /* CONFIG_SYS_RAMBOOT */
#endif #endif

View file

@ -33,6 +33,8 @@
#include "ecc.h" #include "ecc.h"
DECLARE_GLOBAL_DATA_PTR;
#define PPC4xx_IBM_DDR2_DUMP_REGISTER(mnemonic) \ #define PPC4xx_IBM_DDR2_DUMP_REGISTER(mnemonic) \
do { \ do { \
u32 data; \ u32 data; \
@ -414,7 +416,7 @@ static unsigned char spd_read(uchar chip, uint addr)
* banks appropriately. If Auto Memory Configuration is * banks appropriately. If Auto Memory Configuration is
* not used, it is assumed that no DIMM is plugged * not used, it is assumed that no DIMM is plugged
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
phys_size_t initdram(void) int initdram(void)
{ {
unsigned char iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned char iic0_dimm_addr[] = SPD_EEPROM_ADDRESS;
unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE}; unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE};
@ -429,7 +431,9 @@ phys_size_t initdram(void)
* Reduce RAM size to avoid overwriting memory used by * Reduce RAM size to avoid overwriting memory used by
* current stack? Not sure what is happening. * current stack? Not sure what is happening.
*/ */
return sdram_memsize() / 2; gd->ram_size = sdram_memsize() / 2;
return 0;
} }
num_dimm_banks = sizeof(iic0_dimm_addr); num_dimm_banks = sizeof(iic0_dimm_addr);
@ -650,7 +654,9 @@ phys_size_t initdram(void)
*/ */
set_mcsr(get_mcsr()); set_mcsr(get_mcsr());
return sdram_memsize(); gd->ram_size = sdram_memsize();
return 0;
} }
static void get_spd_info(unsigned long *dimm_populated, static void get_spd_info(unsigned long *dimm_populated,
@ -2855,7 +2861,7 @@ static void test(void)
* time parameters. * time parameters.
* Configures the PPC405EX(r) and PPC460EX/GT * Configures the PPC405EX(r) and PPC460EX/GT
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
phys_size_t initdram(void) int initdram(void)
{ {
unsigned long val; unsigned long val;
@ -3011,7 +3017,9 @@ phys_size_t initdram(void)
set_mcsr(get_mcsr()); set_mcsr(get_mcsr());
#endif /* CONFIG_PPC4xx_DDR_AUTOCALIBRATION */ #endif /* CONFIG_PPC4xx_DDR_AUTOCALIBRATION */
return (CONFIG_SYS_MBYTES_SDRAM << 20); gd->ram_size = CONFIG_SYS_MBYTES_SDRAM << 20;
return 0;
} }
#endif /* CONFIG_SPD_EEPROM */ #endif /* CONFIG_SPD_EEPROM */

View file

@ -30,6 +30,8 @@
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/cache.h> #include <asm/cache.h>
DECLARE_GLOBAL_DATA_PTR;
#if defined(CONFIG_SPD_EEPROM) && \ #if defined(CONFIG_SPD_EEPROM) && \
(defined(CONFIG_440EPX) || defined(CONFIG_440GRX)) (defined(CONFIG_440EPX) || defined(CONFIG_440GRX))
@ -998,7 +1000,7 @@ static void program_ddr0_44(unsigned long dimm_ranks[],
* banks appropriately. If Auto Memory Configuration is * banks appropriately. If Auto Memory Configuration is
* not used, it is assumed that no DIMM is plugged * not used, it is assumed that no DIMM is plugged
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
phys_size_t initdram(void) int initdram(void)
{ {
unsigned char const iic0_dimm_addr[] = SPD_EEPROM_ADDRESS; unsigned char const iic0_dimm_addr[] = SPD_EEPROM_ADDRESS;
unsigned long dimm_ranks[MAXDIMMS]; unsigned long dimm_ranks[MAXDIMMS];
@ -1212,7 +1214,9 @@ phys_size_t initdram(void)
#endif /* defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC) */ #endif /* defined(CONFIG_ZERO_SDRAM) || defined(CONFIG_DDR_ECC) */
program_tlb(0, CONFIG_SYS_SDRAM_BASE, dram_size, MY_TLB_WORD2_I_ENABLE); program_tlb(0, CONFIG_SYS_SDRAM_BASE, dram_size, MY_TLB_WORD2_I_ENABLE);
return dram_size; gd->ram_size = dram_size;
return 0;
} }
void board_add_ram_info(int use_default) void board_add_ram_info(int use_default)

View file

@ -17,6 +17,8 @@
#include "sdram.h" #include "sdram.h"
#include "ecc.h" #include "ecc.h"
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_SDRAM_BANK0 #ifdef CONFIG_SDRAM_BANK0
#ifndef CONFIG_440 #ifndef CONFIG_440
@ -148,7 +150,7 @@ static ulong compute_rtr(ulong speed, ulong rows, ulong refresh)
/* /*
* Autodetect onboard SDRAM on 405 platforms * Autodetect onboard SDRAM on 405 platforms
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
ulong speed; ulong speed;
ulong sdtr1; ulong sdtr1;
@ -226,11 +228,13 @@ phys_size_t initdram(void)
/* /*
* OK, size detected -> all done * OK, size detected -> all done
*/ */
return size; gd->ram_size = size;
return 0;
} }
} }
return 0; return -ENXIO;
} }
#else /* CONFIG_440 */ #else /* CONFIG_440 */
@ -349,7 +353,7 @@ static void sdram_tr1_set(int ram_address, int* tr1_value)
* so this should be extended for other future boards * so this should be extended for other future boards
* using this routine! * using this routine!
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
int i; int i;
int tr1_bank1; int tr1_bank1;
@ -440,11 +444,13 @@ phys_size_t initdram(void)
/* /*
* OK, size detected -> all done * OK, size detected -> all done
*/ */
return size; gd->ram_size = size;
return 0;
} }
} }
return 0; /* nothing found ! */ return -ENXIO; /* nothing found ! */
} }
#endif /* CONFIG_440 */ #endif /* CONFIG_440 */

View file

@ -110,7 +110,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif #endif
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_NAND_BOOT #ifdef CONFIG_SPL_NAND_BOOT
puts("Tertiary program loader running in sram..."); puts("Tertiary program loader running in sram...");
#else #else

View file

@ -35,7 +35,7 @@ int checkboard (void)
return 0; return 0;
} }
phys_size_t initdram(void) int initdram(void)
{ {
int size, i; int size, i;
@ -92,7 +92,9 @@ phys_size_t initdram(void)
*(unsigned int *) (CONFIG_SYS_SDRAM_BASE1 + 0x220) = 0xA5A5; *(unsigned int *) (CONFIG_SYS_SDRAM_BASE1 + 0x220) = 0xA5A5;
size += CONFIG_SYS_SDRAM_SIZE1 * 1024 * 1024; size += CONFIG_SYS_SDRAM_SIZE1 * 1024 * 1024;
#endif #endif
return size; gd->ram_size = size;
return 0;
} }
#if defined(CONFIG_SYS_DRAM_TEST) #if defined(CONFIG_SYS_DRAM_TEST)

View file

@ -76,7 +76,7 @@ static void sdram_start(int hi_addr)
* use of CONFIG_SYS_SDRAM_BASE. The code does not work if * use of CONFIG_SYS_SDRAM_BASE. The code does not work if
* CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000.
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
ulong dramsize = 0; ulong dramsize = 0;
ulong dramsize2 = 0; ulong dramsize2 = 0;
@ -153,7 +153,9 @@ phys_size_t initdram(void)
if ((SVR_MJREV(svr) >= 2) && (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) if ((SVR_MJREV(svr) >= 2) && (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4))
out_be32((void *)MPC5XXX_SDRAM_SDELAY, 0x04); out_be32((void *)MPC5XXX_SDRAM_SDELAY, 0x04);
return dramsize + dramsize2; gd->ram_size = dramsize + dramsize2;
return 0;
} }
static void get_revisions(int *failsavelevel, int *digiboardversion, static void get_revisions(int *failsavelevel, int *digiboardversion,

View file

@ -23,6 +23,8 @@
#include "mt46v32m16.h" #include "mt46v32m16.h"
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SYS_RAMBOOT #ifndef CONFIG_SYS_RAMBOOT
static void sdram_start (int hi_addr) static void sdram_start (int hi_addr)
{ {
@ -71,7 +73,7 @@ static void sdram_start (int hi_addr)
* is something else than 0x00000000. * is something else than 0x00000000.
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
ulong dramsize = 0; ulong dramsize = 0;
uint svr, pvr; uint svr, pvr;
@ -150,7 +152,9 @@ phys_size_t initdram(void)
__asm__ volatile ("sync"); __asm__ volatile ("sync");
} }
return dramsize; gd->ram_size = dramsize;
return 0;
} }
int checkboard (void) int checkboard (void)

View file

@ -15,6 +15,8 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/ppc4xx-gpio.h> #include <asm/ppc4xx-gpio.h>
DECLARE_GLOBAL_DATA_PTR;
extern void board_pll_init_f(void); extern void board_pll_init_f(void);
static void cram_bcr_write(u32 wr_val) static void cram_bcr_write(u32 wr_val)
@ -41,7 +43,7 @@ static void cram_bcr_write(u32 wr_val)
return; return;
} }
phys_size_t initdram(void) int initdram(void)
{ {
int i; int i;
u32 val; u32 val;
@ -77,5 +79,7 @@ phys_size_t initdram(void)
for (i=0; i<200000; i++) for (i=0; i<200000; i++)
; ;
return (CONFIG_SYS_MBYTES_RAM << 20); gd->ram_size = CONFIG_SYS_MBYTES_RAM << 20;
return 0;
} }

View file

@ -12,6 +12,8 @@
#include <asm/ppc440.h> #include <asm/ppc440.h>
#include "bamboo.h" #include "bamboo.h"
DECLARE_GLOBAL_DATA_PTR;
void ext_bus_cntlr_init(void); void ext_bus_cntlr_init(void);
void configure_ppc440ep_pins(void); void configure_ppc440ep_pins(void);
int is_nand_selected(void); int is_nand_selected(void);
@ -436,9 +438,11 @@ int checkboard(void)
} }
phys_size_t initdram(void) int initdram(void)
{ {
return spd_sdram(); gd->ram_size = spd_sdram();
return 0;
} }
/*----------------------------------------------------------------------------+ /*----------------------------------------------------------------------------+

View file

@ -9,6 +9,8 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/io.h> #include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
long int spd_sdram(void); long int spd_sdram(void);
int board_early_init_f(void) int board_early_init_f(void)
@ -55,7 +57,9 @@ int checkboard(void)
initdram() reads EEPROM via I2c. EEPROM contains all of initdram() reads EEPROM via I2c. EEPROM contains all of
the necessary info for SDRAM controller configuration the necessary info for SDRAM controller configuration
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
phys_size_t initdram(void) int initdram(void)
{ {
return spd_sdram(); gd->ram_size = spd_sdram();
return 0;
} }

View file

@ -20,6 +20,8 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/ppc440.h> #include <asm/ppc440.h>
DECLARE_GLOBAL_DATA_PTR;
/*-----------------------------------------------------------------------------+ /*-----------------------------------------------------------------------------+
* Prototypes * Prototypes
*-----------------------------------------------------------------------------*/ *-----------------------------------------------------------------------------*/
@ -31,7 +33,7 @@ extern void denali_core_search_data_eye(void);
* initdram -- 440EPx's DDR controller is a DENALI Core * initdram -- 440EPx's DDR controller is a DENALI Core
* *
************************************************************************/ ************************************************************************/
phys_size_t initdram(void) int initdram(void)
{ {
#if !defined(CONFIG_SYS_RAMBOOT) #if !defined(CONFIG_SYS_RAMBOOT)
ulong speed = get_bus_freq(0); ulong speed = get_bus_freq(0);
@ -88,5 +90,7 @@ phys_size_t initdram(void)
*/ */
set_mcsr(get_mcsr()); set_mcsr(get_mcsr());
return (CONFIG_SYS_MBYTES_SDRAM << 20); gd->ram_size = CONFIG_SYS_MBYTES_SDRAM << 20;
return 0;
} }

View file

@ -9,6 +9,8 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <spd_sdram.h> #include <spd_sdram.h>
DECLARE_GLOBAL_DATA_PTR;
int board_early_init_f(void) int board_early_init_f(void)
{ {
/*-------------------------------------------------------------------------+ /*-------------------------------------------------------------------------+
@ -74,7 +76,9 @@ int checkboard(void)
* initdram() reads EEPROM via I2c. EEPROM contains all of * initdram() reads EEPROM via I2c. EEPROM contains all of
* the necessary info for SDRAM controller configuration * the necessary info for SDRAM controller configuration
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
return spd_sdram(); gd->ram_size = spd_sdram();
return 0;
} }

View file

@ -286,7 +286,7 @@ void sdram_tr1_set(int ram_address, int* tr1_value)
*tr1_value = (first_good + last_bad) / 2; *tr1_value = (first_good + last_bad) / 2;
} }
phys_size_t initdram(void) int initdram(void)
{ {
register uint reg; register uint reg;
int tr1_bank1, tr1_bank2; int tr1_bank1, tr1_bank2;
@ -334,7 +334,10 @@ phys_size_t initdram(void)
sdram_tr1_set(0x08000000, &tr1_bank2); sdram_tr1_set(0x08000000, &tr1_bank2);
mtsdram(SDRAM0_TR1, (((tr1_bank1+tr1_bank2)/2) | 0x80800800)); mtsdram(SDRAM0_TR1, (((tr1_bank1+tr1_bank2)/2) | 0x80800800));
return CONFIG_SYS_SDRAM_BANKS * (CONFIG_SYS_KBYTES_SDRAM * 1024); /* return bytes */ gd->ram_size = CONFIG_SYS_SDRAM_BANKS *
(CONFIG_SYS_KBYTES_SDRAM * 1024); /* set bytes */
return 0;
} }
/************************************************************************* /*************************************************************************

View file

@ -27,7 +27,7 @@ int checkboard(void)
return 0; return 0;
} }
phys_size_t initdram(void) int initdram(void)
{ {
#if !defined(CONFIG_MONITOR_IS_IN_RAM) #if !defined(CONFIG_MONITOR_IS_IN_RAM)
sdram_t *sdp = (sdram_t *)(MMAP_SDRAM); sdram_t *sdp = (sdram_t *)(MMAP_SDRAM);
@ -79,8 +79,10 @@ phys_size_t initdram(void)
* (Do not rely on the SDCS register(s) being set to 0x00000000 * (Do not rely on the SDCS register(s) being set to 0x00000000
* during reset as stated in the data sheet.) * during reset as stated in the data sheet.)
*/ */
return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE, gd->ram_size = get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
0x80000000 - CONFIG_SYS_SDRAM_BASE); 0x80000000 - CONFIG_SYS_SDRAM_BASE);
return 0;
} }
#define UART_BASE MMAP_UART0 #define UART_BASE MMAP_UART0

View file

@ -18,6 +18,8 @@
#include "mt48lc16m32s2-75.h" #include "mt48lc16m32s2-75.h"
#endif #endif
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SYS_RAMBOOT #ifndef CONFIG_SYS_RAMBOOT
static void sdram_start (int hi_addr) static void sdram_start (int hi_addr)
{ {
@ -65,7 +67,7 @@ static void sdram_start (int hi_addr)
* is something else than 0x00000000. * is something else than 0x00000000.
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
ulong dramsize = 0; ulong dramsize = 0;
ulong dramsize2 = 0; ulong dramsize2 = 0;
@ -163,7 +165,9 @@ phys_size_t initdram(void)
#endif /* CONFIG_SYS_RAMBOOT */ #endif /* CONFIG_SYS_RAMBOOT */
return dramsize + dramsize2; gd->ram_size = dramsize + dramsize2;
return 0;
} }
int checkboard (void) int checkboard (void)

View file

@ -97,7 +97,7 @@ static mem_conf_t* get_mem_config(int board_type)
/* /*
* Initalize SDRAM - configure SDRAM controller, detect memory size. * Initalize SDRAM - configure SDRAM controller, detect memory size.
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
ulong dramsize = 0; ulong dramsize = 0;
#ifndef CONFIG_SYS_RAMBOOT #ifndef CONFIG_SYS_RAMBOOT
@ -150,7 +150,9 @@ phys_size_t initdram(void)
*(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04; *(vu_long *)MPC5XXX_SDRAM_SDELAY = 0x04;
__asm__ volatile ("sync"); __asm__ volatile ("sync");
return dramsize; gd->ram_size = dramsize;
return 0;
} }

View file

@ -8,6 +8,7 @@
#include <common.h> #include <common.h>
#include <asm/immap.h> #include <asm/immap.h>
DECLARE_GLOBAL_DATA_PTR;
int checkboard (void) int checkboard (void)
{ {
@ -16,7 +17,7 @@ int checkboard (void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
volatile sdramctrl_t *sdp = (sdramctrl_t *) (MMAP_SDRAM); volatile sdramctrl_t *sdp = (sdramctrl_t *) (MMAP_SDRAM);
@ -26,7 +27,9 @@ phys_size_t initdram(void)
/* Dummy write to start SDRAM */ /* Dummy write to start SDRAM */
*((volatile unsigned long *) 0) = 0; *((volatile unsigned long *) 0) = 0;
return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
return 0;
}; };
int testdram (void) int testdram (void)

View file

@ -18,9 +18,11 @@
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
phys_size_t initdram(void) int initdram(void)
{ {
return fixed_sdram(NULL, NULL, 0); gd->ram_size = fixed_sdram(NULL, NULL, 0);
return 0;
} }
int misc_init_r(void) int misc_init_r(void)

View file

@ -11,11 +11,15 @@
#include <asm/mipsregs.h> #include <asm/mipsregs.h>
#include <asm/io.h> #include <asm/io.h>
phys_size_t initdram(void) DECLARE_GLOBAL_DATA_PTR;
int initdram(void)
{ {
/* Sdram is setup by assembler code */ /* Sdram is setup by assembler code */
/* If memory could be changed, we should return the true value here */ /* If memory could be changed, we should return the true value here */
return MEM_SIZE*1024*1024; gd->ram_size = MEM_SIZE * 1024 * 1024;
return 0;
} }
#define BCSR_PCMCIA_PC0DRVEN 0x0010 #define BCSR_PCMCIA_PC0DRVEN 0x0010

View file

@ -62,9 +62,11 @@ int board_early_init_f(void)
return 0; return 0;
} }
phys_size_t initdram(void) int initdram(void)
{ {
return get_ram_size(0, fixed_sdram(NULL, NULL, 0)); gd->ram_size = get_ram_size(0, fixed_sdram(NULL, NULL, 0));
return 0;
} }
int misc_init_r(void) int misc_init_r(void)

View file

@ -24,6 +24,8 @@
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/ppc440.h> #include <asm/ppc440.h>
DECLARE_GLOBAL_DATA_PTR;
extern int denali_wait_for_dlllock(void); extern int denali_wait_for_dlllock(void);
extern void denali_core_search_data_eye(void); extern void denali_core_search_data_eye(void);
@ -105,7 +107,7 @@ int initdram_by_rb(int rows, int banks)
return 0; return 0;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t size; phys_size_t size;
int n; int n;
@ -125,12 +127,14 @@ phys_size_t initdram(void)
sdram_conf[n].banks); sdram_conf[n].banks);
/* check for suitable configuration */ /* check for suitable configuration */
if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size) if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size) {
return size; gd->ram_size = size;
return 0;
}
/* delete TLB entries */ /* delete TLB entries */
remove_tlb(CONFIG_SYS_SDRAM_BASE, size); remove_tlb(CONFIG_SYS_SDRAM_BASE, size);
} }
return 0; return -ENXIO;
} }

View file

@ -26,15 +26,17 @@
#include <i2c.h> #include <i2c.h>
#include <netdev.h> #include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
void ddr_enable_ecc(unsigned int dram_size); void ddr_enable_ecc(unsigned int dram_size);
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
u32 msize = 0; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
/* DDR SDRAM - Main memory */ /* DDR SDRAM - Main memory */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
@ -52,7 +54,9 @@ phys_size_t initdram(void)
msize = get_ram_size(0, msize); msize = get_ram_size(0, msize);
/* return total bus SDRAM size(bytes) -- DDR */ /* return total bus SDRAM size(bytes) -- DDR */
return msize * 1024 * 1024; gd->ram_size = msize * 1024 * 1024;
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -176,7 +176,7 @@ found:
popts->cpo_sample = 0x3e; popts->cpo_sample = 0x3e;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -189,7 +189,9 @@ phys_size_t initdram(void)
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000; dram_size *= 0x100000;
return dram_size; gd->ram_size = dram_size;
return 0;
} }
unsigned long long step_assign_addresses(fsl_ddr_info_t *pinfo, unsigned long long step_assign_addresses(fsl_ddr_info_t *pinfo,

View file

@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n"); puts("\n\n");
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_NAND_BOOT #ifdef CONFIG_SPL_NAND_BOOT
nand_boot(); nand_boot();

View file

@ -67,7 +67,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_NAND_BOOT #ifdef CONFIG_SPL_NAND_BOOT
puts("TPL\n"); puts("TPL\n");

View file

@ -260,7 +260,7 @@ found:
popts->ddr_cdr1 = DDR_CDR1_DHC_EN; popts->ddr_cdr1 = DDR_CDR1_DHC_EN;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -278,5 +278,7 @@ phys_size_t initdram(void)
dram_size *= 0x100000; dram_size *= 0x100000;
debug(" DDR: "); debug(" DDR: ");
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -164,7 +164,7 @@ void board_mem_sleep_setup(void)
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -179,7 +179,9 @@ phys_size_t initdram(void)
fsl_dp_resume(); fsl_dp_resume();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }
void dram_init_banksize(void) void dram_init_banksize(void)

View file

@ -162,9 +162,7 @@ int dram_init(void)
* before accessing DDR SPD. * before accessing DDR SPD.
*/ */
select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
gd->ram_size = initdram(); return initdram();
return 0;
} }
#ifdef CONFIG_FSL_ESDHC #ifdef CONFIG_FSL_ESDHC

View file

@ -108,7 +108,7 @@ found:
#endif #endif
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -125,5 +125,7 @@ phys_size_t initdram(void)
fsl_dp_ddr_restore(); fsl_dp_ddr_restore();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -153,7 +153,7 @@ int dram_init(void)
* before accessing DDR SPD. * before accessing DDR SPD.
*/ */
select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
gd->ram_size = initdram(); initdram();
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
/* This will break-before-make MMU for DDR */ /* This will break-before-make MMU for DDR */
update_early_mmu_table(); update_early_mmu_table();

View file

@ -170,7 +170,7 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm,
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -186,5 +186,7 @@ phys_size_t initdram(void)
fsl_dp_ddr_restore(); fsl_dp_ddr_restore();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -92,7 +92,7 @@ found:
popts->cpo_sample = 0x70; popts->cpo_sample = 0x70;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -110,5 +110,7 @@ phys_size_t initdram(void)
erratum_a008850_post(); erratum_a008850_post();
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -149,7 +149,7 @@ int dram_init(void)
* before accessing DDR SPD. * before accessing DDR SPD.
*/ */
select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT); select_i2c_ch_pca9547(I2C_MUX_CH_DEFAULT);
gd->ram_size = initdram(); initdram();
#if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD) #if !defined(CONFIG_SPL) || defined(CONFIG_SPL_BUILD)
/* This will break-before-make MMU for DDR */ /* This will break-before-make MMU for DDR */
update_early_mmu_table(); update_early_mmu_table();

View file

@ -96,7 +96,7 @@ found:
popts->cpo_sample = 0x70; popts->cpo_sample = 0x70;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -110,5 +110,7 @@ phys_size_t initdram(void)
erratum_a008850_post(); erratum_a008850_post();
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -158,14 +158,12 @@ int fsl_ddr_get_dimm_params(dimm_params_t *pdimm,
return 0; return 0;
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size;
puts("Initializing DDR...."); puts("Initializing DDR....");
puts("using SPD\n"); puts("using SPD\n");
dram_size = fsl_ddr_sdram(); gd->ram_size = fsl_ddr_sdram();
return dram_size; return 0;
} }

View file

@ -155,17 +155,15 @@ found:
} }
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size;
#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
return fsl_ddr_sdram_size(); gd->ram_size = fsl_ddr_sdram_size();
#else #else
puts("Initializing DDR....using SPD\n"); puts("Initializing DDR....using SPD\n");
dram_size = fsl_ddr_sdram(); gd->ram_size = fsl_ddr_sdram();
#endif #endif
return dram_size; return 0;
} }

View file

@ -158,17 +158,15 @@ found:
} }
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size;
#if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD) #if defined(CONFIG_SPL) && !defined(CONFIG_SPL_BUILD)
return fsl_ddr_sdram_size(); gd->ram_size = fsl_ddr_sdram_size();
#else #else
puts("Initializing DDR....using SPD\n"); puts("Initializing DDR....using SPD\n");
dram_size = fsl_ddr_sdram(); gd->ram_size = fsl_ddr_sdram();
#endif #endif
return dram_size; return 0;
} }

View file

@ -22,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
u32 dramsize, i; u32 dramsize, i;
@ -68,7 +68,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -21,7 +21,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
u32 dramsize; u32 dramsize;
@ -78,7 +78,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
#endif #endif
return (dramsize); gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -22,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
gpio_t *gpio = (gpio_t *)(MMAP_GPIO); gpio_t *gpio = (gpio_t *)(MMAP_GPIO);
@ -97,7 +97,9 @@ phys_size_t initdram(void)
*(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x400) = 0xA5A59696; *(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x400) = 0xA5A59696;
} }
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -10,6 +10,8 @@
#include <malloc.h> #include <malloc.h>
#include <asm/immap.h> #include <asm/immap.h>
DECLARE_GLOBAL_DATA_PTR;
int checkboard (void) { int checkboard (void) {
ulong val; ulong val;
uchar val8; uchar val8;
@ -29,7 +31,7 @@ int checkboard (void) {
}; };
phys_size_t initdram(void) int initdram(void)
{ {
unsigned long junk = 0xa5a59696; unsigned long junk = 0xa5a59696;
@ -82,7 +84,9 @@ phys_size_t initdram(void)
mbar_writeLong(MCFSIM_DACR0, 0x0000b364); /* Enable DACR0[IMRS] (bit 6); RE remains enabled */ mbar_writeLong(MCFSIM_DACR0, 0x0000b364); /* Enable DACR0[IMRS] (bit 6); RE remains enabled */
*((volatile unsigned long *) 0x800) = junk; /* Access RAM to initialize the mode register */ *((volatile unsigned long *) 0x800) = junk; /* Access RAM to initialize the mode register */
return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
return 0;
}; };

View file

@ -13,6 +13,8 @@
#include <netdev.h> #include <netdev.h>
#include <asm/io.h> #include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
int checkboard(void) int checkboard(void)
{ {
puts("Board: "); puts("Board: ");
@ -20,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
u32 dramsize = 0; u32 dramsize = 0;
@ -73,7 +75,9 @@ phys_size_t initdram(void)
mb(); mb();
} }
return dramsize; gd->ram_size = dramsize;
return 0;
} }
int testdram(void) int testdram(void)

View file

@ -12,6 +12,8 @@
#include <asm/immap.h> #include <asm/immap.h>
#include <asm/io.h> #include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
int checkboard(void) int checkboard(void)
{ {
puts("Board: "); puts("Board: ");
@ -19,7 +21,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
/* /*
* Check to see if the SDRAM has already been initialized * Check to see if the SDRAM has already been initialized
@ -66,7 +68,9 @@ phys_size_t initdram(void)
*(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x800) = 0xa5a5a5a5; *(u32 *) (CONFIG_SYS_SDRAM_BASE + 0x800) = 0xa5a5a5a5;
} }
return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
return 0;
} }
int testdram(void) int testdram(void)

View file

@ -11,6 +11,7 @@
#include <asm/immap.h> #include <asm/immap.h>
#include <asm/io.h> #include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
int checkboard (void) { int checkboard (void) {
puts ("Board: "); puts ("Board: ");
@ -18,7 +19,7 @@ int checkboard (void) {
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM); sdramctrl_t * sdp = (sdramctrl_t *)(MMAP_SDRAM);
@ -28,7 +29,9 @@ phys_size_t initdram(void)
/* Dummy write to start SDRAM */ /* Dummy write to start SDRAM */
*((volatile unsigned long *)0) = 0; *((volatile unsigned long *)0) = 0;
return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
return 0;
}; };
int testdram (void) { int testdram (void) {

View file

@ -13,6 +13,8 @@
#include <asm/immap.h> #include <asm/immap.h>
#include <asm/io.h> #include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
#define PERIOD 13 /* system bus period in ns */ #define PERIOD 13 /* system bus period in ns */
#define SDRAM_TREFI 7800 /* in ns */ #define SDRAM_TREFI 7800 /* in ns */
@ -23,7 +25,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdramctrl_t *sdp = (sdramctrl_t *)(MMAP_SDRAM); sdramctrl_t *sdp = (sdramctrl_t *)(MMAP_SDRAM);
gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO); gpio_t *gpio_reg = (gpio_t *)(MMAP_GPIO);
@ -88,7 +90,9 @@ phys_size_t initdram(void)
| MCF_SDRAMC_SDCR_RCNT((SDRAM_TREFI/(PERIOD*64)) - 1 + 1) | MCF_SDRAMC_SDCR_RCNT((SDRAM_TREFI/(PERIOD*64)) - 1 + 1)
| MCF_SDRAMC_SDCR_DQS_OE(0x3)); | MCF_SDRAMC_SDCR_DQS_OE(0x3));
return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; gd->ram_size = CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -16,7 +16,7 @@ int checkboard (void)
return 0; return 0;
} }
phys_size_t initdram(void) int initdram(void)
{ {
u32 dramsize, i, dramclk; u32 dramsize, i, dramclk;
@ -80,5 +80,7 @@ phys_size_t initdram(void)
/* Write to the SDRAM Mode Register */ /* Write to the SDRAM Mode Register */
*(u32 *)(CONFIG_SYS_SDRAM_BASE + 0x400) = 0xA5A59696; *(u32 *)(CONFIG_SYS_SDRAM_BASE + 0x400) = 0xA5A59696;
} }
return dramsize; gd->ram_size = dramsize;
return 0;
} }

View file

@ -22,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
u32 dramsize, i; u32 dramsize, i;
@ -68,7 +68,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -22,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
u32 dramsize, i; u32 dramsize, i;
@ -62,7 +62,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -22,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
u32 dramsize, i; u32 dramsize, i;
@ -62,7 +62,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -25,7 +25,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
u32 dramsize; u32 dramsize;
@ -104,7 +104,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
#endif #endif
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -26,7 +26,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
u32 dramsize; u32 dramsize;
#ifdef CONFIG_CF_SBF #ifdef CONFIG_CF_SBF
@ -82,7 +82,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
#endif #endif
return (dramsize); gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -22,7 +22,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
u32 dramsize; u32 dramsize;
#ifdef CONFIG_CF_SBF #ifdef CONFIG_CF_SBF
@ -75,7 +75,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
#endif #endif
return (dramsize << 1); gd->ram_size = dramsize << 1;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -23,7 +23,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
siu_t *siu = (siu_t *) (MMAP_SIU); siu_t *siu = (siu_t *) (MMAP_SIU);
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
@ -79,7 +79,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -23,7 +23,7 @@ int checkboard(void)
return 0; return 0;
}; };
phys_size_t initdram(void) int initdram(void)
{ {
siu_t *siu = (siu_t *) (MMAP_SIU); siu_t *siu = (siu_t *) (MMAP_SIU);
sdram_t *sdram = (sdram_t *)(MMAP_SDRAM); sdram_t *sdram = (sdram_t *)(MMAP_SDRAM);
@ -79,7 +79,9 @@ phys_size_t initdram(void)
udelay(100); udelay(100);
return dramsize; gd->ram_size = dramsize;
return 0;
}; };
int testdram(void) int testdram(void)

View file

@ -95,7 +95,7 @@ int is_micron(void){
return(ismicron); return(ismicron);
} }
phys_size_t initdram(void) int initdram(void)
{ {
u32 msize = 0; u32 msize = 0;
/* /*
@ -167,7 +167,9 @@ phys_size_t initdram(void)
sizeof(elpida_init_sequence)/sizeof(u32)); sizeof(elpida_init_sequence)/sizeof(u32));
} }
return msize; gd->ram_size = msize;
return 0;
} }
int misc_init_r(void) int misc_init_r(void)

View file

@ -65,17 +65,19 @@ static long fixed_sdram(void)
return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize);
} }
phys_size_t initdram(void) int initdram(void)
{ {
immap_t *im = (immap_t *)CONFIG_SYS_IMMR; immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
u32 msize; u32 msize;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
/* DDR SDRAM */ /* DDR SDRAM */
msize = fixed_sdram(); msize = fixed_sdram();
/* return total bus SDRAM size(bytes) -- DDR */ /* return total bus SDRAM size(bytes) -- DDR */
return msize; gd->ram_size = msize;
return 0;
} }

View file

@ -97,14 +97,14 @@ static long fixed_sdram(void)
return msize; return msize;
} }
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR;
volatile fsl_lbc_t *lbc = &im->im_lbc; volatile fsl_lbc_t *lbc = &im->im_lbc;
u32 msize; u32 msize;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
/* DDR SDRAM - Main SODIMM */ /* DDR SDRAM - Main SODIMM */
msize = fixed_sdram(); msize = fixed_sdram();
@ -120,5 +120,7 @@ phys_size_t initdram(void)
#endif #endif
/* return total bus SDRAM size(bytes) -- DDR */ /* return total bus SDRAM size(bytes) -- DDR */
return msize; gd->ram_size = msize;
return 0;
} }

View file

@ -92,13 +92,13 @@ static long fixed_sdram(void)
} }
#endif /* CONFIG_SYS_RAMBOOT */ #endif /* CONFIG_SYS_RAMBOOT */
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR; volatile immap_t *im = (volatile immap_t *)CONFIG_SYS_IMMR;
u32 msize; u32 msize;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
/* DDR SDRAM */ /* DDR SDRAM */
msize = fixed_sdram(); msize = fixed_sdram();
@ -106,6 +106,8 @@ phys_size_t initdram(void)
if (im->pmc.pmccr1 & PMCCR1_POWER_OFF) if (im->pmc.pmccr1 & PMCCR1_POWER_OFF)
resume_from_sleep(); resume_from_sleep();
/* return total bus SDRAM size(bytes) -- DDR */ /* set total bus SDRAM size(bytes) -- DDR */
return msize; gd->ram_size = msize;
return 0;
} }

View file

@ -21,6 +21,8 @@
#endif #endif
#include <asm/mmu.h> #include <asm/mmu.h>
DECLARE_GLOBAL_DATA_PTR;
const qe_iop_conf_t qe_iop_conf_tab[] = { const qe_iop_conf_t qe_iop_conf_tab[] = {
/* UCC3 */ /* UCC3 */
{1, 0, 1, 0, 1}, /* TxD0 */ {1, 0, 1, 0, 1}, /* TxD0 */
@ -68,21 +70,23 @@ const qe_iop_conf_t qe_iop_conf_tab[] = {
int fixed_sdram(void); int fixed_sdram(void);
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
u32 msize = 0; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
return -1; return -ENXIO;
/* DDR SDRAM - Main SODIMM */ /* DDR SDRAM - Main SODIMM */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
msize = fixed_sdram(); msize = fixed_sdram();
/* return total bus SDRAM size(bytes) -- DDR */ /* set total bus SDRAM size(bytes) -- DDR */
return (msize * 1024 * 1024); gd->ram_size = msize * 1024 * 1024;
return 0;
} }
/************************************************************************* /*************************************************************************

View file

@ -23,6 +23,8 @@
#include "../common/pq-mds-pib.h" #include "../common/pq-mds-pib.h"
#endif #endif
DECLARE_GLOBAL_DATA_PTR;
const qe_iop_conf_t qe_iop_conf_tab[] = { const qe_iop_conf_t qe_iop_conf_tab[] = {
/* ETH3 */ /* ETH3 */
{1, 0, 1, 0, 1}, /* TxD0 */ {1, 0, 1, 0, 1}, /* TxD0 */
@ -88,21 +90,23 @@ int board_early_init_r(void)
int fixed_sdram(void); int fixed_sdram(void);
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
u32 msize = 0; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
return -1; return -ENXIO;
/* DDR SDRAM - Main SODIMM */ /* DDR SDRAM - Main SODIMM */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
msize = fixed_sdram(); msize = fixed_sdram();
/* return total bus SDRAM size(bytes) -- DDR */ /* set total bus SDRAM size(bytes) -- DDR */
return (msize * 1024 * 1024); gd->ram_size = msize * 1024 * 1024;
return 0;
} }
/************************************************************************* /*************************************************************************

View file

@ -22,6 +22,8 @@
#include <libfdt.h> #include <libfdt.h>
#endif #endif
DECLARE_GLOBAL_DATA_PTR;
int fixed_sdram(void); int fixed_sdram(void);
void sdram_init(void); void sdram_init(void);
@ -46,13 +48,13 @@ int board_early_init_f (void)
#define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1) #define ns2clk(ns) (ns / (1000000000 / CONFIG_8349_CLKIN) + 1)
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR; volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
phys_size_t msize = 0; phys_size_t msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
/* DDR SDRAM - Main SODIMM */ /* DDR SDRAM - Main SODIMM */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
@ -73,8 +75,10 @@ phys_size_t initdram(void)
*/ */
sdram_init(); sdram_init();
/* return total bus SDRAM size(bytes) -- DDR */ /* set total bus SDRAM size(bytes) -- DDR */
return msize; gd->ram_size = msize;
return 0;
} }
#if !defined(CONFIG_SPD_EEPROM) #if !defined(CONFIG_SPD_EEPROM)

View file

@ -20,6 +20,8 @@
#include <libfdt.h> #include <libfdt.h>
#endif #endif
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SPD_EEPROM #ifndef CONFIG_SPD_EEPROM
/************************************************************************* /*************************************************************************
* fixed sdram init -- doesn't use serial presence detect. * fixed sdram init -- doesn't use serial presence detect.
@ -116,7 +118,7 @@ volatile static struct pci_controller hose[] = {
}; };
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
u32 msize = 0; u32 msize = 0;
@ -125,7 +127,7 @@ phys_size_t initdram(void)
#endif #endif
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
return -1; return -ENXIO;
/* DDR SDRAM - Main SODIMM */ /* DDR SDRAM - Main SODIMM */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR; im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
@ -144,7 +146,9 @@ phys_size_t initdram(void)
#endif #endif
/* return total bus RAM size(bytes) */ /* return total bus RAM size(bytes) */
return msize * 1024 * 1024; gd->ram_size = msize * 1024 * 1024;
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -20,6 +20,8 @@
#include "pci.h" #include "pci.h"
#include "../common/pq-mds-pib.h" #include "../common/pq-mds-pib.h"
DECLARE_GLOBAL_DATA_PTR;
int board_early_init_f(void) int board_early_init_f(void)
{ {
u8 *bcsr = (u8 *)CONFIG_SYS_BCSR; u8 *bcsr = (u8 *)CONFIG_SYS_BCSR;
@ -216,13 +218,13 @@ extern void ddr_enable_ecc(unsigned int dram_size);
#endif #endif
int fixed_sdram(void); int fixed_sdram(void);
phys_size_t initdram(void) int initdram(void)
{ {
volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR; volatile immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
u32 msize = 0; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
return -1; return -ENXIO;
#if defined(CONFIG_SPD_EEPROM) #if defined(CONFIG_SPD_EEPROM)
msize = spd_sdram(); msize = spd_sdram();
@ -236,7 +238,9 @@ phys_size_t initdram(void)
#endif #endif
/* return total bus DDR size(bytes) */ /* return total bus DDR size(bytes) */
return (msize * 1024 * 1024); gd->ram_size = msize * 1024 * 1024;
return 0;
} }
#if !defined(CONFIG_SPD_EEPROM) #if !defined(CONFIG_SPD_EEPROM)

View file

@ -16,6 +16,8 @@
#include <vsc7385.h> #include <vsc7385.h>
#include <fsl_esdhc.h> #include <fsl_esdhc.h>
DECLARE_GLOBAL_DATA_PTR;
#if defined(CONFIG_SYS_DRAM_TEST) #if defined(CONFIG_SYS_DRAM_TEST)
int int
testdram(void) testdram(void)
@ -60,13 +62,13 @@ void ddr_enable_ecc(unsigned int dram_size);
#endif #endif
int fixed_sdram(void); int fixed_sdram(void);
phys_size_t initdram(void) int initdram(void)
{ {
immap_t *im = (immap_t *) CONFIG_SYS_IMMR; immap_t *im = (immap_t *) CONFIG_SYS_IMMR;
u32 msize = 0; u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im) if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
return -1; return -ENXIO;
#if defined(CONFIG_SPD_EEPROM) #if defined(CONFIG_SPD_EEPROM)
msize = spd_sdram(); msize = spd_sdram();
@ -79,7 +81,9 @@ phys_size_t initdram(void)
ddr_enable_ecc(msize * 1024 * 1024); ddr_enable_ecc(msize * 1024 * 1024);
#endif #endif
/* return total bus DDR size(bytes) */ /* return total bus DDR size(bytes) */
return (msize * 1024 * 1024); gd->ram_size = msize * 1024 * 1024;
return 0;
} }
#if !defined(CONFIG_SPD_EEPROM) #if !defined(CONFIG_SPD_EEPROM)

View file

@ -19,6 +19,8 @@
#include <spd_sdram.h> #include <spd_sdram.h>
#include <netdev.h> #include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
void sdram_init(void); void sdram_init(void);
phys_size_t fixed_sdram(void); phys_size_t fixed_sdram(void);
int mpc8610hpcd_diu_init(void); int mpc8610hpcd_diu_init(void);
@ -116,7 +118,7 @@ int checkboard(void)
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size = 0; phys_size_t dram_size = 0;
@ -129,7 +131,9 @@ phys_size_t initdram(void)
setup_ddr_bat(dram_size); setup_ddr_bat(dram_size);
debug(" DDR: "); debug(" DDR: ");
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -16,6 +16,8 @@
#include <fdt_support.h> #include <fdt_support.h>
#include <netdev.h> #include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
phys_size_t fixed_sdram(void); phys_size_t fixed_sdram(void);
int checkboard(void) int checkboard(void)
@ -37,7 +39,7 @@ int checkboard(void)
return 0; return 0;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size = 0; phys_size_t dram_size = 0;
@ -50,7 +52,9 @@ phys_size_t initdram(void)
setup_ddr_bat(dram_size); setup_ddr_bat(dram_size);
debug(" DDR: "); debug(" DDR: ");
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -94,7 +94,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_NAND_BOOT #ifdef CONFIG_SPL_NAND_BOOT
puts("\nTertiary program loader running in sram..."); puts("\nTertiary program loader running in sram...");
#else #else

View file

@ -111,7 +111,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif #endif
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_NAND_BOOT #ifdef CONFIG_SPL_NAND_BOOT
puts("Tertiary program loader running in sram..."); puts("Tertiary program loader running in sram...");
#else #else

View file

@ -108,7 +108,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
#endif #endif
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_NAND_BOOT #ifdef CONFIG_SPL_NAND_BOOT
puts("Tertiary program loader running in sram..."); puts("Tertiary program loader running in sram...");
#else #else

View file

@ -12,6 +12,8 @@
#include <fsl_ddr_dimm_params.h> #include <fsl_ddr_dimm_params.h>
#include <asm/fsl_law.h> #include <asm/fsl_law.h>
DECLARE_GLOBAL_DATA_PTR;
struct board_specific_parameters { struct board_specific_parameters {
u32 n_ranks; u32 n_ranks;
u32 datarate_mhz_high; u32 datarate_mhz_high;
@ -116,7 +118,7 @@ found:
popts->ddr_cdr1 = DDR_CDR1_DHC_EN; popts->ddr_cdr1 = DDR_CDR1_DHC_EN;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size = 0; phys_size_t dram_size = 0;
@ -127,12 +129,14 @@ phys_size_t initdram(void)
dram_size = fsl_ddr_sdram(); dram_size = fsl_ddr_sdram();
} else { } else {
puts("no SPD and fixed parameters\n"); puts("no SPD and fixed parameters\n");
return dram_size; return -ENXIO;
} }
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000; dram_size *= 0x100000;
debug(" DDR: "); debug(" DDR: ");
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -169,7 +169,7 @@ void board_mem_sleep_setup(void)
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -187,5 +187,7 @@ phys_size_t initdram(void)
fsl_dp_resume(); fsl_dp_resume();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -142,7 +142,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_MMC_BOOT #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot(); mmc_boot();

View file

@ -229,7 +229,7 @@ void board_mem_sleep_setup(void)
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -249,5 +249,7 @@ phys_size_t initdram(void)
fsl_dp_resume(); fsl_dp_resume();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -129,7 +129,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_MMC_BOOT #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot(); mmc_boot();

View file

@ -117,7 +117,7 @@ void board_mem_sleep_setup(void)
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -134,5 +134,7 @@ phys_size_t initdram(void)
fsl_dp_resume(); fsl_dp_resume();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -120,7 +120,7 @@ void board_mem_sleep_setup(void)
} }
#endif #endif
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -137,5 +137,7 @@ phys_size_t initdram(void)
fsl_dp_resume(); fsl_dp_resume();
#endif #endif
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -125,7 +125,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
puts("\n\n"); puts("\n\n");
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_MMC_BOOT #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot(); mmc_boot();

View file

@ -104,7 +104,7 @@ found:
popts->cpo_sample = 0x64; popts->cpo_sample = 0x64;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -118,5 +118,7 @@ phys_size_t initdram(void)
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000; dram_size *= 0x100000;
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -128,7 +128,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_MMC_BOOT #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot(); mmc_boot();

View file

@ -97,7 +97,7 @@ found:
popts->cpo_sample = 0x54; popts->cpo_sample = 0x54;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -111,5 +111,7 @@ phys_size_t initdram(void)
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000; dram_size *= 0x100000;
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -98,7 +98,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_MMC_BOOT #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot(); mmc_boot();

View file

@ -112,7 +112,7 @@ found:
popts->cpo_sample = 0x63; popts->cpo_sample = 0x63;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -127,5 +127,7 @@ phys_size_t initdram(void)
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000; dram_size *= 0x100000;
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -133,7 +133,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
#ifdef CONFIG_SPL_MMC_BOOT #ifdef CONFIG_SPL_MMC_BOOT
mmc_boot(); mmc_boot();

View file

@ -105,7 +105,7 @@ found:
popts->cpo_sample = 0x64; popts->cpo_sample = 0x64;
} }
phys_size_t initdram(void) int initdram(void)
{ {
phys_size_t dram_size; phys_size_t dram_size;
@ -120,5 +120,7 @@ phys_size_t initdram(void)
dram_size = setup_ddr_tlbs(dram_size / 0x100000); dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000; dram_size *= 0x100000;
return dram_size; gd->ram_size = dram_size;
return 0;
} }

View file

@ -91,7 +91,7 @@ void board_init_r(gd_t *gd, ulong dest_addr)
i2c_init_all(); i2c_init_all();
gd->ram_size = initdram(); initdram();
mmc_boot(); mmc_boot();
} }

View file

@ -10,9 +10,11 @@
#include <config.h> #include <config.h>
#include <asm/leon.h> #include <asm/leon.h>
phys_size_t initdram(void) int initdram(void)
{ {
return 1; /* Does not set gd->ram_size here */
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -10,9 +10,11 @@
#include <config.h> #include <config.h>
#include <asm/leon.h> #include <asm/leon.h>
phys_size_t initdram(void) int initdram(void)
{ {
return 1; /* Does not set gd->ram_size here */
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -9,9 +9,11 @@
#include <config.h> #include <config.h>
#include <asm/leon.h> #include <asm/leon.h>
phys_size_t initdram(void) int initdram(void)
{ {
return 1; /* Does not set gd->ram_size here */
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -10,9 +10,11 @@
#include <common.h> #include <common.h>
#include <asm/leon.h> #include <asm/leon.h>
phys_size_t initdram(void) int initdram(void)
{ {
return 1; /* Does not set gd->ram_size here */
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -10,9 +10,11 @@
#include <common.h> #include <common.h>
#include <asm/leon.h> #include <asm/leon.h>
phys_size_t initdram(void) int initdram(void)
{ {
return 1; /* Does not set gd->ram_size here */
return 0;
} }
int checkboard(void) int checkboard(void)

View file

@ -66,17 +66,19 @@ static long fixed_sdram(void)
return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize); return get_ram_size(CONFIG_SYS_DDR_SDRAM_BASE, msize);
} }
phys_size_t initdram(void) int initdram(void)
{ {
immap_t *im = (immap_t *)CONFIG_SYS_IMMR; immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
u32 msize; u32 msize;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
/* DDR SDRAM */ /* DDR SDRAM */
msize = fixed_sdram(); msize = fixed_sdram();
/* return total bus SDRAM size(bytes) -- DDR */ /* return total bus SDRAM size(bytes) -- DDR */
return msize; gd->ram_size = msize;
return 0;
} }

View file

@ -119,14 +119,14 @@ static int setup_sdram(void)
return msize; return msize;
} }
phys_size_t initdram(void) int initdram(void)
{ {
immap_t *im = (immap_t *)CONFIG_SYS_IMMR; immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
fsl_lbc_t *lbc = &im->im_lbc; fsl_lbc_t *lbc = &im->im_lbc;
u32 msize = 0; u32 msize = 0;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im) if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im)
return -1; return -ENXIO;
msize = setup_sdram(); msize = setup_sdram();
@ -134,7 +134,9 @@ phys_size_t initdram(void)
out_be32(&lbc->mrtpr, CONFIG_SYS_LBC_MRTPR); out_be32(&lbc->mrtpr, CONFIG_SYS_LBC_MRTPR);
sync(); sync();
return msize; gd->ram_size = msize;
return 0;
} }
#if defined(CONFIG_OF_BOARD_SETUP) #if defined(CONFIG_OF_BOARD_SETUP)

View file

@ -310,9 +310,12 @@ u32 sdram_init_seq[] = {
/* EMPTY, optional, we don't do it */ /* EMPTY, optional, we don't do it */
}; };
phys_size_t initdram(void) int initdram(void)
{ {
return fixed_sdram(NULL, sdram_init_seq, ARRAY_SIZE(sdram_init_seq)); gd->ram_size = fixed_sdram(NULL, sdram_init_seq,
ARRAY_SIZE(sdram_init_seq));
return 0;
} }
int misc_init_r(void) int misc_init_r(void)

View file

@ -66,7 +66,7 @@ static void sdram_start(int hi_addr)
* use of CONFIG_SYS_SDRAM_BASE. The code does not work if * use of CONFIG_SYS_SDRAM_BASE. The code does not work if
* CONFIG_SYS_SDRAM_BASE is something else than 0x00000000. * CONFIG_SYS_SDRAM_BASE is something else than 0x00000000.
*/ */
phys_size_t initdram(void) int initdram(void)
{ {
struct mpc5xxx_mmap_ctl *mmap_ctl = struct mpc5xxx_mmap_ctl *mmap_ctl =
(struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR; (struct mpc5xxx_mmap_ctl *)CONFIG_SYS_MBAR;
@ -181,7 +181,9 @@ phys_size_t initdram(void)
(PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4)) (PVR_MAJ(pvr) == 1) && (PVR_MIN(pvr) == 4))
out_be32(&sdram->sdelay, 0x04); out_be32(&sdram->sdelay, 0x04);
return dramsize + dramsize2; gd->ram_size = dramsize + dramsize2;
return 0;
} }

View file

@ -10,11 +10,16 @@
#include "boston-regs.h" #include "boston-regs.h"
phys_size_t initdram(void) DECLARE_GLOBAL_DATA_PTR;
int initdram(void)
{ {
u32 ddrconf0 = __raw_readl((uint32_t *)BOSTON_PLAT_DDRCONF0); u32 ddrconf0 = __raw_readl((uint32_t *)BOSTON_PLAT_DDRCONF0);
return (phys_size_t)(ddrconf0 & BOSTON_PLAT_DDRCONF0_SIZE) << 30; gd->ram_size = (phys_size_t)(ddrconf0 & BOSTON_PLAT_DDRCONF0_SIZE) <<
30;
return 0;
} }
ulong board_get_usable_ram_top(ulong total_size) ulong board_get_usable_ram_top(ulong total_size)

View file

@ -19,6 +19,8 @@
#include "superio.h" #include "superio.h"
DECLARE_GLOBAL_DATA_PTR;
enum core_card { enum core_card {
CORE_UNKNOWN, CORE_UNKNOWN,
CORE_LV, CORE_LV,
@ -83,9 +85,11 @@ static enum sys_con malta_sys_con(void)
} }
} }
phys_size_t initdram(void) int initdram(void)
{ {
return CONFIG_SYS_MEM_SIZE; gd->ram_size = CONFIG_SYS_MEM_SIZE;
return 0;
} }
int checkboard(void) int checkboard(void)

Some files were not shown because too many files have changed in this diff Show more