From: Stefan Roese Date: Fri, 4 Dec 2009 09:51:45 +0100 Subject: [U-Boot] [PATCH] mpc83xx: spd_sdram.c: Disable memory controller before initializing Message-ID: <1259916705-6639-1-git-send-email-sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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. Signed-off-by: Stefan Roese Cc: Reinhard Arlt Cc: Kim Phillips --- cpu/mpc83xx/spd_sdram.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cpu/mpc83xx/spd_sdram.c b/cpu/mpc83xx/spd_sdram.c index 0f61180..952afeb 100644 --- a/cpu/mpc83xx/spd_sdram.c +++ b/cpu/mpc83xx/spd_sdram.c @@ -150,6 +150,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) + */ + ddr->sdram_cfg &= ~SDRAM_CFG_MEM_EN; + asm("sync;isync"); + /* Read SPD parameters with I2C */ CONFIG_SYS_READ_SPD(SPD_EEPROM_ADDRESS, 0, 1, (uchar *) & spd, sizeof (spd)); #ifdef SPD_DEBUG -- 1.6.6.rc1