am33xx: Bugfix to config_sdram()
authorTom Rini <trini@ti.com>
Thu, 26 Jul 2012 00:04:12 +0000 (17:04 -0700)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 1 Sep 2012 12:58:12 +0000 (14:58 +0200)
When we change SDRAM_CONFIG this triggers a refresh based on all of the
parameters that we have programmed so we must do this last.

Signed-off-by: Tom Rini <trini@ti.com>
arch/arm/cpu/armv7/am33xx/ddr.c

index e59260937d4bb8b99a10f0dd73cb83190b621062..c37f91b2f1a02945a0bd031eace86993c14fd884 100644 (file)
@@ -49,10 +49,9 @@ static struct ddr_cmdtctrl *ioctrl_reg = {
  */
 int config_sdram(struct sdram_config *cfg)
 {
-       writel(cfg->sdrcr, &emif_reg->emif_sdram_config);
-       writel(cfg->sdrcr2, &emif_reg->emif_lpddr2_nvm_config);
        writel(cfg->refresh, &emif_reg->emif_sdram_ref_ctrl);
        writel(cfg->refresh_sh, &emif_reg->emif_sdram_ref_ctrl_shdw);
+       writel(cfg->sdrcr, &emif_reg->emif_sdram_config);
 
        return 0;
 }