]> git.sur5r.net Git - u-boot/commitdiff
rockchip: rk3036: sync os_reg2 define with other soc
authorKever Yang <kever.yang@rock-chips.com>
Tue, 13 Jun 2017 08:10:46 +0000 (16:10 +0800)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Tue, 11 Jul 2017 10:13:48 +0000 (12:13 +0200)
Rockchip using the same bit definition for dram info and write
to os_reg, the col and bw info is not correct and let's fix it.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
arch/arm/mach-rockchip/rk3036/sdram_rk3036.c

index ec8305cff82c5048f8456fb52c8a351e490e7ce4..460dd6074e607c00e5c565ec7c8ae697d1d97f71 100644 (file)
@@ -710,11 +710,12 @@ static void sdram_all_config(struct rk3036_sdram_priv *priv)
        os_reg = config.ddr_type << DDR_TYPE_SHIFT |
                        0 << DDR_CHN_CNT_SHIFT |
                        (config.rank - 1) << DDR_RANK_CNT_SHIFT |
-                       (config.col - 1) << DDR_COL_SHIFT |
+                       (config.col - 9) << DDR_COL_SHIFT |
                        (config.bank == 3 ? 0 : 1) << DDR_BANK_SHIFT |
                        (config.cs0_row - 13) << DDR_CS0_ROW_SHIFT |
                        cs1_row << DDR_CS1_ROW_SHIFT |
-                       1 << DDR_BW_SHIFT | config.bw << DDR_DIE_BW_SHIFT;
+                       1 << DDR_BW_SHIFT |
+                       (2 >> config.bw) << DDR_DIE_BW_SHIFT;
        writel(os_reg, &priv->grf->os_reg[1]);
 }