[v3,37/57] ram: rk3399: Get lpddr4 tsel_rd_en from io settings

Message ID 20190716115745.12585-38-jagan@amarulasolutions.com
State New
Headers show
Series
  • ram: rk3399: Add LPDDR4 support
Related show

Commit Message

Jagan Teki July 16, 2019, 11:57 a.m. UTC
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@amarulasolutions.com>
Signed-off-by: YouMin Chen <cym@rock-chips.com>
---
 drivers/ram/rockchip/sdram_rk3399.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Kever Yang July 16, 2019, 1:15 p.m. UTC | #1
On 2019/7/16 下午7:57, Jagan Teki wrote:
> 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@amarulasolutions.com>
> Signed-off-by: YouMin Chen <cym@rock-chips.com>

Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>

Thanks,
  - Kever
> ---
>   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 e0be9d2485..9e40880835 100644
> --- a/drivers/ram/rockchip/sdram_rk3399.c
> +++ b/drivers/ram/rockchip/sdram_rk3399.c
> @@ -645,10 +645,14 @@ static void set_ds_odt(const struct chan_info *chan,
>   		tsel_ckcs_select_n = PHY_DRV_ODT_34_3;
>   	}
>   
> -	if (params->base.odt == 1)
> +	if (params->base.odt == 1) {
>   		tsel_rd_en = 1;
> -	else
> +
> +		if (params->base.dramtype == LPDDR4)
> +			tsel_rd_en = io->rd_odt_en;
> +	} else {
>   		tsel_rd_en = 0;
> +	}
>   
>   	tsel_wr_en = 0;
>   	tsel_idle_en = 0;

Patch

diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index e0be9d2485..9e40880835 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -645,10 +645,14 @@  static void set_ds_odt(const struct chan_info *chan,
 		tsel_ckcs_select_n = PHY_DRV_ODT_34_3;
 	}
 
-	if (params->base.odt == 1)
+	if (params->base.odt == 1) {
 		tsel_rd_en = 1;
-	else
+
+		if (params->base.dramtype == LPDDR4)
+			tsel_rd_en = io->rd_odt_en;
+	} else {
 		tsel_rd_en = 0;
+	}
 
 	tsel_wr_en = 0;
 	tsel_idle_en = 0;