From patchwork Tue Jun 11 14:51:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 509 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id CA6BE3F08A for ; Tue, 11 Jun 2019 16:55:43 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id 59sf7891455plb.14 for ; Tue, 11 Jun 2019 07:55:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264942; cv=pass; d=google.com; s=arc-20160816; b=P+odiXFslCxi1grR+EIs6kOqQ0zaC0GC62CGsJC3zjocBQe4XcDs4Z3o10l0FQIbZN +fR6KoJDYRda/QE+AKewumiaFmyhOm/WKnTdoHQG4XoQFTrVsSFgj6uS+od47bUt1Sec t4Jqi4AWhs04b2BJe23SbKQUL6hl7g/iiF521Ou8RlletmNqe9HsAjq98yO6gI04IZuQ eK/xfkj7wxMfpD1rXdv5daebMwtJmCkyneKCYftfi42dZ2tANSAZ8zXZ/TKUMg6P7OBu yjKeLQG3jXI4j5+jBMthf3xpP8SmKby8t7J9T9ua/a9KzgMc768ELIiRdlNdng2b/fmY HmxQ== 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=v6fO8BdpOTUTAApnVs35oaE7fiG1+ITpC6Q6cmmk650=; b=BocdHu4qZfnNl8WbdENomZvGmuN0/8lbxe8KzSBef6LJ5qNdWhjBkxSM+C+UhWvpgK 6P8Xp0YxABaOSbr2vhBsRl4QptW4VB3N8vlcViHRS0xS+MXqZkoI1ppMgroUQ90+SPJk y2gfRjzhloHOJIE0b1/Nj8Q1d+YRsx3rCXsSbJ86NqGbPZdg5GXidKM5ijMWsN5nrPtJ ATk3N+laSZLTjbMLdJtrk1CyK3k40ZMkLPFYrKLb8rOpNkWoZMV7uYyTNt4X105wQLaQ 4Q0ySEVcb+jrEt9m3crohSdeclvIcyYRoqNAPgIQR2CVo3HtvRF5J2R7Aacs2F/oqOFi miXQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ryg2ctVp; 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=v6fO8BdpOTUTAApnVs35oaE7fiG1+ITpC6Q6cmmk650=; b=k0MWLOIpYBDKcbBi1VtFrz/2DPTc8yTwrR2CbdGJzMlw2AFsk4M7sOj/Y+KBY1EPrn HXj96J4Qs40bIbi6iKUBwdNsVcB8sB2upZx+uqWFAafquAbRTagQu5sftMe7aYlNLdOv kOt6Hhr2abYtRWS0//UUBXZJGJbBk8dRAaHjU= 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=v6fO8BdpOTUTAApnVs35oaE7fiG1+ITpC6Q6cmmk650=; b=aKkPF0huQVRE0h1N1HHj4K6XPZY4HImw1X2r/J3NnhHX2L3PcRncDLsJcGGKhFGCG4 J7+abXKnyClHxrwN3AvWePhg3Vi/jArw0RY1CtX9yItwhTTxrU0etkERv/sEyvPt32Lb UNj2vNdcG9LLDpvwuA3DZbgHEyi1zsF+8Lexu+Iwe3vfa9WoDxJZ0jg29ehxxt8qNiSA rOlXdZm0njHxFl+TSYgjn1bVPmKz5OCPQwIe0htyIiZQNrDcFuKIrAyv+Bnui2SL0PKR g3n2lf12e2PGsEAHZ2601+ajf/fq9bb7VHhwGVT4TmLNaXlalGOHrdwD7Ip49Xj4VKGk fxMA== X-Gm-Message-State: APjAAAWHejnolpGuIYsn2iHaroXPB8RGq0WlrfHyRZjRkKitYVnFGvgk WQK+DySFFo9rWXr4fpGPJWJZBg2b X-Google-Smtp-Source: APXvYqxhuEhTerP7ZItgFJkAmBiNyOneXW1mBN5F6c+/0ShgkDoFKFhX3by4yGxYiP6phdl8CrSWaw== X-Received: by 2002:a63:ed06:: with SMTP id d6mr18284363pgi.267.1560264942479; Tue, 11 Jun 2019 07:55:42 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:e444:: with SMTP id i4ls4508286pgk.13.gmail; Tue, 11 Jun 2019 07:55:42 -0700 (PDT) X-Received: by 2002:a62:2cc2:: with SMTP id s185mr79403948pfs.106.1560264942158; Tue, 11 Jun 2019 07:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264942; cv=none; d=google.com; s=arc-20160816; b=NIut4V5/R9JHxEAiZZkZ8BnTN1/vqwtsWhIu3wJZJ+3eThjOAMybz89TeEAgZVwLTB o5/HBWxE+hJniDHpGl0inAE5+OgfmwLlPOkIOh2GcQqik6mz6P0I1dHnHsAO3uNGnSc8 HTC8SaFuM0UbGPpWB8ja88Z1xv+tL+0cIiS6+kRsAh83wdX+qU7UvStCYRw48+mz7QAV qhBrsieb9HSEpPjYs4O25M7Ubg5+frh7h+zKaRqlN0Ohl30g4MREi9WyqiQd7/A0uBYC iIMYYh/9TxlTcfFocAJQ0iNMl03ZZVfRk/3HUKFlf3pbkBjQHeQ5LPZOw0ol19aRTbWx S+wg== 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=ih+Anadf88MvP50WAMrcs/65Vc6e/HWE4U7h04mB5FU=; b=xVECyUtMm641BWHz9epNSIppLE1/l1w14bCtTZsb+gv8wMIOxVsGs3CQWI5LBV+lti 5+UoL+2noCi35yDlAl0qU3DnGcJQ/2YV7NdfHcBASI+OPruuXJiTZkEQ17Jc6YCzjKHf +5CT3noDX3abLfpU+tWCB5kOtdf/u634+7hOSk+R38SvK4orbxyBTGHaeMd44Qat8aMb bPiR/9ZX70DKwubEfGEaEw/QYScEmeBvELFidQjZledUWfFhsLqJo1f96z2vAcYOV9Aw vvD7q1bVdFzMbIY+iR/OdRm93DOgfWqj8SO8kZskLhL3uylRa82LaMEu2uPrsbkYT2vn emzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Ryg2ctVp; 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 x5sor3268012pjp.9.2019.06.11.07.55.42 for (Google Transport Security); Tue, 11 Jun 2019 07:55:42 -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:90a:372a:: with SMTP id u39mr27500295pjb.2.1560264941836; Tue, 11 Jun 2019 07:55:41 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.55.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:55:41 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 58/92] ram: rk3399: Add lpddr4 rank mask for cs training Date: Tue, 11 Jun 2019 20:21:01 +0530 Message-Id: <20190611145135.21399-59-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190611145135.21399-1-jagan@amarulasolutions.com> References: <20190611145135.21399-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=Ryg2ctVp; 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 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 --- drivers/ram/rockchip/sdram_rk3399.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index a5fa41e498..004a4819ff 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -692,7 +692,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 (sdram_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)))