mpc83xx: spd_sdram.c: Disable memory controller before initializing
PATCH v2 1/1 mpc83xx: spd_sdram.c: Disable memory controller before initializing
The memory controller could already be enabled, when spd_sdram() is called. This could be the case for example, when the SDRAM is initialized by the JTAG debugger.
The "sync" after the register access via the accessor function is still needed, because the macro uses the sync before the real write is done. So until not all accesses are converted to using accessor functions, this sync still needs to be made "manually" here.
---
v2:
- Use accessor function instead of pointer access
cpu/mpc83xx/spd_sdram.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
cpu/mpc83xx/spd_sdram.c +8 -0
@@ -29,6 +29,7 @@#include <common.h> #include <asm/processor.h> +#include <asm/io.h> #include <i2c.h> #include <spd.h> #include <asm/mmu.h>
@@ -150,6 +151,13 @@ long int spd_sdram()unsigned int ddrc_ecc_enable;unsigned int pvr =get_pvr (); +/* +* First disable the memory controller (could be enabled +* by the debugger) +*/ +clrsetbits_be32 (&ddr->sdram_cfg,SDRAM_CFG_MEM_EN ,0 ); + asm("sync;isync" ); +/* Read SPD parameters with I2C */ CONFIG_SYS_READ_SPD (SPD_EEPROM_ADDRESS ,0 ,1 , (uchar *) & spd,sizeof (spd));#ifdef SPD_DEBUG
Signature · 1 line
1.6.6.rc1
PATCH v2 1/1 mpc83xx: spd_sdram.c: Disable memory controller before initializing
cpu/mpc83xx/spd_sdram.c long int spd_sdram() · line 159
Quoted 6 lines · On Tue, 8 Dec 2009 09:10:04 +0100 Stefan Roese <[email protected]> wrote:
cpu/mpc83xx/spd_sdram.c +6
-0+/* +* First disable the memory controller (could be enabled +* by the debugger) +*/ +clrsetbits_be32 (&ddr->sdram_cfg,SDRAM_CFG_MEM_EN ,0 ); + asm("sync;isync" );
applied after changing to use [i]sync() accessor fns.
Kim