From: Jagan Teki Date: Tue, 16 Jul 2019 11:57:09 +0000 (+0530) Subject: ram: rk3399: Add lpddr4 rank mask for ca training X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=3dae87da89e4c9edb4da9e05bde2e10bb98bd885;p=u-boot.git ram: rk3399: Add lpddr4 rank mask for ca training Add rank_mask based on the rank number for lpddr4. This would keep the ca data training loop based on the desired rank mask value instead of looping for all values. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index cca809a7e3..b7cad9274b 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -687,7 +687,10 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); - rank_mask = (rank == 1) ? 0x1 : 0x3; + if (params->base.dramtype == LPDDR4) + rank_mask = (rank == 1) ? 0x5 : 0xf; + else + rank_mask = (rank == 1) ? 0x1 : 0x3; for (i = 0; i < 4; i++) { if (!(rank_mask & (1 << i)))