From: Kim Phillips Date: Fri, 4 Dec 2009 20:43:34 -0600 Subject: [U-Boot] [PATCH] mpc83xx: spd_sdram.c: Disable memory controller before initializing In-Reply-To: <1259916705-6639-1-git-send-email-sr@denx.de> References: <1259916705-6639-1-git-send-email-sr@denx.de> Message-ID: <20091204204334.ae17c965.kim.phillips@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 4 Dec 2009 09:51:45 +0100 Stefan Roese wrote: > 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 thanks for this, Stefan. > + /* > + * First disable the memory controller (could be enabled > + * by the debugger) > + */ > + ddr->sdram_cfg &= ~SDRAM_CFG_MEM_EN; > + asm("sync;isync"); I realize that this file already doesn't use accessor functions to any large extent, but that doesn't mean that we should continue this bad habit. Kim