From patchwork Mon Jul 15 18:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 733 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5F3F43F08F for ; Mon, 15 Jul 2019 20:29:21 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id h27sf10699596pfq.17 for ; Mon, 15 Jul 2019 11:29:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563215360; cv=pass; d=google.com; s=arc-20160816; b=0CtUEUv1SDDjpfn39Bm2XwgwA4uE45igY3yKl5TI7Tfy8unxMKXu23EtRRdKnCGeRF qHz5KDOPW1OAVpiKZePmzYTgyUHdjAUOpoZxhvlG+plNngd2cE2QkMcB3DYRHrHZ4Z6K s5WeYQPx0QQXekcL+bu2TSxRWe60Y4UnFEAPfMYYWfQVnmsNJ7yiRdkAnuclXVQvpJOI 3Ny1nK91HM3XOmJj+lh9tojYqgJQxJj+upIMjqnkVze+W/cqUbFR6aGWZRad4sH0hN0N 7FtBSbnABlsTFBnc7iKNQrGLPJcZ4iJFncTau8fDiatIxPB5tFRY824GnmcgfMNxz3ug 291w== 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=GlHnaAS4AdYf3byLmHx29JEaE87rVs/IrdhvWoDz9Tg=; b=qiQv3rFnsnOVCOl5/rz3vqHeMCL1Cn0mQC9BdAp6vGRZipnC+dj7EYqvOxTUMJzK3J wVdWRGKVUTE3rpK4gKli2PmXUBVL1i8S6VNS4UYg/+ZVh+dsH2MgnjivmNjDdBrJdAdp ORpk0qPWMbNzAnUlU5DhVeB2dm5Saqb0Krsm6FOA5xTJZv368y0R0Rcfj3sReLQfmJeI 6wbf2a4mjMuOZ23PJT6YjUQRW7qE/HBhguKQBbLpX1aPp2Zjwr9fp860CIYfHmyI/z+i L5kasZEmNMQdABEl20DM87xVpNoy6bSSXqohNb0SR3Rui5luIyzrdbHxPahISk8o6/k+ H9Rg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=U6sp09yQ; 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=GlHnaAS4AdYf3byLmHx29JEaE87rVs/IrdhvWoDz9Tg=; b=eFnymJZgJqwpjb+ztIwvQI0VJnjpKo3uPhiHXlpfTD0lvxZNzk9NmrZxCnaiTXg/cN TKhZzjT97Q+TyHifsTQin/YelOiFCgcadhVi0yKNmuMn5cKfb7yztU57AvwEdo7+/Qvn oJ0ZOlDZIggIse/aD4t2v9WdIDIwIpj1ouEa8= 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=GlHnaAS4AdYf3byLmHx29JEaE87rVs/IrdhvWoDz9Tg=; b=hmcvfvbhKDH/IlyeuZlRE3hk1NjMol+gljfrdYRZMfMaKIRzqRvySjUo6/YEpghxKw kJ8dArQfEH0715oBYMQOosRPswlXz6wLgEjNHsr2y177fmKMhTLFqcMcxwWGdjfuECHM Ms97GdA0317HGQe9dCPVXW1xVwXZnA6Cp9ZjWA5BDRY9k6OdpT7cEz7XcjQBgIJp6CFU 0AiAdA1p5OcUEIMCN719eMHvUxht9j3z87m8x6F2/gAsDM9J3vZHjv2Ec49jCyU/Td8C W+r+q3gweGRe63IDmIi+d6i++ymlUeI3w5nE9+RGlkxk5K3g/pi//nzBXiCrXC8RlOC4 L0Sg== X-Gm-Message-State: APjAAAUULPMiH/u1+SN8+lV67B1yrbfXR5LofATwqLmjV7vtmG03xrY7 +RBVz18ZWcyWwhBmt8xezHO8UzGr X-Google-Smtp-Source: APXvYqyNvlRWn5tqSXgDJOTSdybJjEM5rQIHiEZU10Dau4Wl6DaeEhVrCFumnaIXC2BOOyCr49r+oA== X-Received: by 2002:a17:902:2f84:: with SMTP id t4mr24663936plb.57.1563215360228; Mon, 15 Jul 2019 11:29:20 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:e444:: with SMTP id i4ls2982916pgk.13.gmail; Mon, 15 Jul 2019 11:29:20 -0700 (PDT) X-Received: by 2002:a65:6288:: with SMTP id f8mr24049548pgv.292.1563215359822; Mon, 15 Jul 2019 11:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563215359; cv=none; d=google.com; s=arc-20160816; b=BxJLRt8fWqN3eOG4WSqCa4RsNQ2ws9cyr0Qo+iy456qGh0pWKmc7XpgOpom+joVlS8 d5nnJDx5JjBlI4s+2aJXZHT2lbVTGgYP4C+eGvc/4NNrhkF45i1Gzo3n9Ok7jBrAwPkZ hqNPlEcan1owFG3GuAlXDWNUdzBBr0OpFPu9dFGx6lkI9jeZW6jnwkJi5BrumglvVqX2 NKEqIqFnJ6G9Oule1n2Ys2IKVJyDwIBZjY2lxGQlQeegZ9fM5ToQYCGTIUHK/cS8BPcA mzrAoqpaLYtZpTK9KNLpaZhvBQKAhTKdotyvWkTdxlTPkAUyMfFnuW1tBkrXSJZQF0Z/ A88w== 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=6YcwdqbfN/fN4UE6eAEHodKdaNOFzJ1BoEfhJmEKtss=; b=0ZWmlJ0sRTuVtA9NSjsbmOHbBo2TZ70CwBwsSOueTCqveSrmopsH/Pjj4+O9ka5cEY zQySJXniORyvmB2OQb0/VOnWiNjEEKeaDJA7rHzNgPBKGJ9OgmGUcNB39yq1blxLaeut hPilosJoIagqt3Ta+Ez/bZDrny5DurpL7kXSPxW3JNhI5lspS5ZpK71PWTWMK5Vf0+Jt 7gJdTM+4Dy++Qbqlklj1ZrFMkD4wyXWSX72eVHY+2Y+j7viRoHQgrapecT/apn2H3yvy EU45P1LF0zZ2seQTXUyvPnpersn8uZCYNaG05A2J5Ylfgxr9DjZbM2r6CcCAGLuAL2H0 PuNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=U6sp09yQ; 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 a20sor9441514pgm.3.2019.07.15.11.29.19 for (Google Transport Security); Mon, 15 Jul 2019 11:29:19 -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:a63:e24c:: with SMTP id y12mr27612919pgj.81.1563215359423; Mon, 15 Jul 2019 11:29:19 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id y133sm20250075pfb.28.2019.07.15.11.29.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:29:19 -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 v3 03/18] ram: rk3399: Use rank mask in ca data training Date: Mon, 15 Jul 2019 23:58:41 +0530 Message-Id: <20190715182856.21688-4-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182856.21688-1-jagan@amarulasolutions.com> References: <20190715182856.21688-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=U6sp09yQ; 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 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 --- 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 fe26144f27..b98df20fa5 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -626,11 +626,17 @@ static int data_training_ca(const struct chan_info *chan, u32 channel, u32 i, tmp; u32 obs_0, obs_1, obs_2, obs_err = 0; u32 rank = params->ch[channel].cap_info.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); /* PI_100 PI_CALVL_EN:RW:8:2 */