[PATCH 74/92] ram: rk3399: Get lpddr4 tsel_rd_en from io settings

Jagan Teki
2019-06-11T14:51:17Z

For base.odt 1 the lpddr4 tsel_rd_en value is depending
on IO settings of rd_odt_en.

Add support for it.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Signed-off-by: YouMin Chen <cym-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
drivers/ram/rockchip/sdram_rk3399.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 2ce9066d53..c0e9a4e7c8 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -646,10 +646,14 @@ static void set_ds_odt(const struct chan_info *chan,
tsel_ckcs_select_n = PHY_DRV_ODT_34_3;
}

- if (sdram_params->base.odt == 1)
+ if (sdram_params->base.odt == 1) {
tsel_rd_en = 1;
- else
+
+ if (sdram_params->base.dramtype == LPDDR4)
+ tsel_rd_en = io->rd_odt_en;
+ } else {
tsel_rd_en = 0;
+ }

tsel_wr_en = 0;
tsel_idle_en = 0;
--
2.18.0.321.gffc6fa0e3