summaryrefslogtreecommitdiff
path: root/drivers/ram
diff options
context:
space:
mode:
authorKever Yang <kever.yang@rock-chips.com>2017-09-25 08:33:22 (GMT)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2017-09-30 22:33:32 (GMT)
commita27290a6f892421d335ffbdd5b8724135132b991 (patch)
treea65877293eb5e05a3130802a93a22a1107ad3605 /drivers/ram
parentffd1cd67daf322a9c450c6b2d7e2c3413aaa830a (diff)
downloadu-boot-a27290a6f892421d335ffbdd5b8724135132b991.tar.xz
rockchip: rk3188: ram: add support for 16bit row address
RK3188 using the same ddr_conf for both 15 bit and 16 bit row address. Signed-off-by: Kever Yang <kever.yang@rock-chips.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [Fixed compile-error by declaring 'row':] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Diffstat (limited to 'drivers/ram')
-rw-r--r--drivers/ram/rockchip/sdram_rk3188.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ram/rockchip/sdram_rk3188.c b/drivers/ram/rockchip/sdram_rk3188.c
index 9d8b225..365d00e 100644
--- a/drivers/ram/rockchip/sdram_rk3188.c
+++ b/drivers/ram/rockchip/sdram_rk3188.c
@@ -682,11 +682,18 @@ out:
static int sdram_get_niu_config(struct rk3188_sdram_params *sdram_params)
{
- int i, tmp, size, ret = 0;
+ int i, tmp, size, row, ret = 0;
+ row = sdram_params->ch[0].cs0_row;
+ /*
+ * RK3188 share the rank and row bit15, we use same ddr config for 15bit
+ * and 16bit row
+ */
+ if (row == 16)
+ row = 15;
tmp = sdram_params->ch[0].col - 9;
tmp -= (sdram_params->ch[0].bw == 2) ? 0 : 1;
- tmp |= ((sdram_params->ch[0].cs0_row - 13) << 4);
+ tmp |= ((row - 13) << 4);
size = sizeof(ddrconf_table)/sizeof(ddrconf_table[0]);
for (i = 0; i < size; i++)
if (tmp == ddrconf_table[i])