From patchwork Mon Jun 17 07:31:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 581 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E15883F072 for ; Mon, 17 Jun 2019 09:36:55 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id w31sf7177675pgk.23 for ; Mon, 17 Jun 2019 00:36:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757014; cv=pass; d=google.com; s=arc-20160816; b=v7vicVjwhKCuIgawX6GA4wAgRYDCIZ3GJvuqgSGHIF9qkti0s5WVEzwYwhTCUsEDyN V0iorOFFKRppTAbY+6eV6Xb6/+s3y6osTfVj2kCHnu30pvJWh+fj9a41GadiJ5td/oG/ JTyyFZuKnnwN0ul/ql0vT0H8hJSOwCUqd/g7NnBDzePx5//oljZXiuQScSEEOvSQk/dW 5L1ZtVVJxZ7TS1Jaw17WSwfB27nGUAHFQuC8+dVhJ0CFPFoAQM78IG0tu7Sb4Hch57VS R7PkVTA1gK1RpfrZzXaVgzn8ODfXAHR0OSlRLkWeY6fUHO+fbjn4cwN/9VY4XrH+Juce fraw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=chICTtFbfPcSGuAOX1uX64es/9fuaL3v5PAhbvNfMqw=; b=ZUVAjfmA3p0f+XDvrjTOC2lB/wJoFfmPjjau0/9TrpikBsdyjozWtDfsF2wUa9gRvf LlEBbYOGfRkmFhPgxhYJWjS/NyL6cScWwl/iPu4ZUAjKyhVFqzst/UVkcBeDVjmefonz IxsMEnc32kxD41AaaLK/lqpvPTxGsz3c61cC8DvnDyHYkFKcC/PwuT4iAxgRLgnyC/Q2 19m5+jVgk5Qiz4AX2atYbYBapD5uuiUyG35ciL1oxO6CBIaL8OPj5e81me6BKFktr6us IxswkurEW3vAxVVRHKczUKa6aOGpH5/c5nvcFJAZbc5ryl+/ErLWyQkzQgY7l1HhnqbI hceQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Gly4A/0c"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=chICTtFbfPcSGuAOX1uX64es/9fuaL3v5PAhbvNfMqw=; b=avHU8hsKSAUhAJw9A0KYYrwsE1T9d1ZO0tLvlgiB8+Nb3d5obczVvS7lmUOKI1kFK8 rA1oBefKtgB8fmVehjH+WOHeFy75nCjWNkudcsI6IdAJjN/eno91+/NG6LUARTDYbqps wZHDjudSW7mCSfUzzg/sb7r4Oee5mtVIbcCmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=chICTtFbfPcSGuAOX1uX64es/9fuaL3v5PAhbvNfMqw=; b=Np+C8jRw+4BmgW3bVFnG5D/FVz4Hm+ca/uqGkTOgLTs4q41PukTb7V+191VYiTiaPY BbtbcJ7InASqtzTZ678KRShNYwM2VGkCseKQBj9OSJoQ7xofPkwRkFuBROBAIH74BjO7 zxFV4vXFd1oMDabk+DO6CUxqjOXyB4p2A1lpBAaj7ttXBqXBXSGAmSS9mWYOckoWRBEJ oR0lfjKNVBJ6wfOfJN5JvpS3K6HjmFWWx5gRJ60fmXf4kmWBdrbXCfr/Lu/8/oBLy5d/ H4gPrlip/JyWcj/ttMaWJBObSY8ysL2fESJPLl7RkYEQEqZgH3HVc51dbGYYKf6fwm16 wiPw== X-Gm-Message-State: APjAAAWIypY9KUfs7y23q5QQ524eQq/ZinYnj+GX9fL1wvTYtGn8P2dC vHkC6pa254QLQG+eO2OTry1QYnpV X-Google-Smtp-Source: APXvYqwTlCcIU9pO+aswNu7P6TM9NCs2hVI0fFmmEvQKW2AgzcSjUIczjl78QSgciHofUzX2PmZAsA== X-Received: by 2002:a17:902:2ba7:: with SMTP id l36mr105573673plb.334.1560757014763; Mon, 17 Jun 2019 00:36:54 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:aa7:8056:: with SMTP id y22ls3371614pfm.6.gmail; Mon, 17 Jun 2019 00:36:54 -0700 (PDT) X-Received: by 2002:a62:5306:: with SMTP id h6mr113935192pfb.29.1560757014413; Mon, 17 Jun 2019 00:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757014; cv=none; d=google.com; s=arc-20160816; b=0m5aU8TIlGe1YH4YPGjCQg+2DpE/0hA0m1fbI44i1ffoJcEL3ANrmFPPuR3hd5UxR8 YPIDqruuiYgjtFBzmFCssTCPVhr42q8gH30C5ZLQSZYX5qHHtDd285dc9PTIPvu2ZJ5O J/M8bMxOi0s3LO9zmQQr1OnPIKtXcxW7Ed7suEr41+DALzJSujRo70F/dFY3EJffJbCJ POVQv4ZH8UzCuDEZ3MSktXkNtgovqqWaHZdIqnISigMf4UhGTIO1eXy1S3jEVzRQ5s+Z 0kVWekYhJ+oi+oFwkg0zXz3/TVSEADoUVPlVzmev4dl/s3sWXr44JpIk5LFGIvjKDy0T TX1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=jjOaByF6DG4Wi5iXKaE8Y5nHQba8rk25ZozVxH6G5Gc=; b=nQrJKxeOZP/24IFQGysv5Wtk2yWo61h5VCeyvcI2sHr0HkelCJq18Rl5vH5BtlH5vD FdK77dFVUdt0VletHEx+Sw5RCdGYsJjBbYazTsFgKZALfsCyaPYtNm/t435EUWKRSLGW zv9ExJ/e4WRcFdMvGGbw9gIrg6MlEtfqjh5EXCynqwhm3oAQHIB1VynuoI/6Wu2nY/54 yehdYVOU7UqyESG1ccsOZxLfzmazBaZfkGn+P2/4VsvsTv4FwMFwF0u4OOzF0USu6dyN vnTQASsRr62m3TxCVjDt5Rl3h2wVpF4GlPZV597OcwOax17pW+oo3pFG6jZvLTSzhHBp 44aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Gly4A/0c"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i1sor12561303plt.55.2019.06.17.00.36.54 for (Google Transport Security); Mon, 17 Jun 2019 00:36:54 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:902:6ac6:: with SMTP id i6mr92870588plt.233.1560757014113; Mon, 17 Jun 2019 00:36:54 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.36.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:36:53 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: Manivannan Sadhasivam , gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v2 10/99] ram: rk3399: Use rank mask in wdql data training Date: Mon, 17 Jun 2019 13:01:23 +0530 Message-Id: <20190617073252.27810-11-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190617073252.27810-1-jagan@amarulasolutions.com> References: <20190617073252.27810-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="Gly4A/0c"; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add rank_mask based on the rank number, this would keep the wdql 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 --- drivers/ram/rockchip/sdram_rk3399.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 76d6440f9a..32fc7771b3 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -851,11 +851,17 @@ static int data_training_wdql(const struct chan_info *chan, u32 channel, u32 *denali_pi = chan->pi->denali_pi; u32 i, tmp; u32 rank = params->ch[channel].rank; + u32 rank_mask; /* clear interrupt,PI_175 PI_INT_ACK:WR:0:17 */ writel(0x00003f7c, (&denali_pi[175])); - for (i = 0; i < rank; i++) { + rank_mask = (rank == 1) ? 0x1 : 0x3; + + for (i = 0; i < 4; i++) { + if (!(rank_mask & (1 << i))) + continue; + select_per_cs_training_index(chan, i); /*