From patchwork Mon Jul 15 18:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 734 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id D2F403F08F for ; Mon, 15 Jul 2019 20:29:24 +0200 (CEST) Received: by mail-pf1-f200.google.com with SMTP id 21sf10717184pfu.9 for ; Mon, 15 Jul 2019 11:29:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563215363; cv=pass; d=google.com; s=arc-20160816; b=OaIGw7Pe8S5Xi7pK3gphGfQcdebZbjtRT7aWbtVcazk1/QOl35nzPPr8rt61LW265/ xFnYLHvcy+msSt6fbDBX+ze/p0vInS8Lk3rw2UzURTm5AfNCdbZLDCJqL4sBq5lHH6Hh ByyEV25P5NFCfZ+aMcmKJUHM3UVt7h80D12qaDv81I9jQ3eO9rj6FzWgdXKf+AVLmA5X mNV1sKIjOJ5veZb/HE9DmW2xMdMxY6JA0468P4voW3uqCXBqYli1HU9pUpG4c2vCjZPU Jh60urEccxT6s6q0N7CSZUGH3NTnQgNXfeSiK7e9e7VjNXGQEIJk2uWzCRO34z+49Mxt q0bQ== 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=Xc1jW9Jb9F8s/IWYLT6xdjq5D1WGuKZ7QLLRPR/Wd9o=; b=QFgzyHDN7GylEYFza5KZE/ICUDW1tJrYNsxxPqKzxTiVT8ixJV6nE8uxl3TW/6UBhp RTsE8gz+yfhCxrrPuBCrM/eGPPg/AKn/M36o1zsBpmx1/ZVa6YAjM30gB+Wai/anQ1ub uiIcj+XMwc1kLjLMcTEMpytjs4AbUAA4VFVh4+PBigCy8obCLrlzi0anUOFioKoopTvU cmbyUiVdK9yfatXzD5rsbjtp6UOjGGtk53KOmqHpJXKYvnlbaK070efcTq2Qw5gywrRm zKp3QWjX+acsJZMIl7BgXr7T46W69Ko1p+qxz1TdZSKBDj01VRBQ9y4eI62MIa6EvCHm 0Uog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=C8OkKD3X; 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=Xc1jW9Jb9F8s/IWYLT6xdjq5D1WGuKZ7QLLRPR/Wd9o=; b=nNdU7fwvyXQjR6jzPWLJV9LLau3i+qy+YO7qFh45g9FsHUns7DYkWNjIHRLGk0uidL 8fue+8kCA38FjZvRFFVeg0U34lwgpySYvaQ2ROmO/w1VMQ7QzqoDV75nYGP1udWpJINw VZ9rmQs1fErY++iwtCRPzTrYA8FAODw1d0aTc= 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=Xc1jW9Jb9F8s/IWYLT6xdjq5D1WGuKZ7QLLRPR/Wd9o=; b=pz8uoYwlAeu6TXFANS2kzj0b6Tt/WTqbBcBpCACpbVTK+oP5Jg6rN282PcYNfyYOO2 MTJN6RS6Rewswoe9o6Ej2+Bs1k5/13001ybm644lVW13RtKqtRTiEGp40BSsJeDIqYw5 z+phqTSx7Rt5WGYCu92QcOlWX1lE7djhrJ3aBxNcYHanTOvgfoQf7KMwF/r4AqxE8TLt mes8rfONV2PppTKLwvLduuqCCb+HNNr3QG+lqzU1W3yeof88+NLguJX4/nmRLKNS80DP VwMAHeVsTGNGLjuF6Zbv7lOmzJP7cp4x7xuwwzWyQ2kvCBXBZ2PggYMt/8cGaY1puiSX IbLA== X-Gm-Message-State: APjAAAXhhtrnXsE+JYuLBR/sZUQ6oDFjzJ+3jDeDdeu5GX588mtBB2// EfSc5dayRi2QpmhDodoHeiuat+zQ X-Google-Smtp-Source: APXvYqz6HiubgIRn2jJiZM9E6vIonnJ75JW6CV6mTE2OX8nB12OJ8mmrfNrYqacYWHS3tMV+yWaVLA== X-Received: by 2002:a65:51c1:: with SMTP id i1mr6922914pgq.417.1563215363601; Mon, 15 Jul 2019 11:29:23 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:580d:: with SMTP id g13ls1900905pgr.5.gmail; Mon, 15 Jul 2019 11:29:23 -0700 (PDT) X-Received: by 2002:a63:ec48:: with SMTP id r8mr1854938pgj.387.1563215363234; Mon, 15 Jul 2019 11:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563215363; cv=none; d=google.com; s=arc-20160816; b=uZTsDfF7I1tAcFEyJMBrFVF0Zxtop14jgPpEAOQMAky+7zBFf12t5tGACROl54brjn VOoH6nbU8rNhlkO0PvOQpthFHsyuKMuoZ2kSNjjWhE/pjLN+OeCgQwFZacYKmeVM9ZKq e+NoflJnAO5WIHJatuYA8gwCHWMNKefSEOb+CEW4GSLxIB6QxGvlAKs/rVajuQO6oD4P QnZKoveKDelja8nY9bzQgawrtJk8m21Vd36RfsY6QvXExz/Im3nskZ5Msa26+UsToADZ xpaBbuf5Gg+G274cz2ypxyQe7LT1GFJqxkVJmcCg76YEJCBh2jMt4CLpEka6fxiOVjLX XxXQ== 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=4Bs78cyfY3NVUOTscJFg+EkWdj0SkzHYhqOkdIflyNc=; b=ZbBkVVKy3mcfAmhnB5dto/FIlfcNAbzIOvX7OnDcincVLIXtoPLAWNZbrBFMaVik2L 42fgVBlBMiY73iRJoUviGIpYZw7B2C55NvWQc1rIYmZHkWsLD5MV8c7WXQ1NyvLDyQk7 FKhEwUHL64Cz51l/MixUUTRZQ5kgk6B2Fu65LSovrMPsg769VRjZOs2QAa4pbglvO9wX VvJLJGpE+0Et0L9CTuc3kaqL7R/dMweRV6C+um4ri++3Kz4r4gMPPR/usd5EXDOSOdtm 7Ege6aHMwyMoSRhdU2IsQT6iY1NUjJjjh13g71bTWSOMWpMHLnTgpFKr5EfRL5ae1Y2L VjjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=C8OkKD3X; 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 q30sor22093869pjc.13.2019.07.15.11.29.23 for (Google Transport Security); Mon, 15 Jul 2019 11:29:23 -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:ff17:: with SMTP id ce23mr30679911pjb.47.1563215362898; Mon, 15 Jul 2019 11:29:22 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id y133sm20250075pfb.28.2019.07.15.11.29.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:29:22 -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 04/18] ram: rk3399: Use rank mask in wdql data training Date: Mon, 15 Jul 2019 23:58:42 +0530 Message-Id: <20190715182856.21688-5-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=C8OkKD3X; 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 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 b98df20fa5..16bd9427a6 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -861,11 +861,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].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); /*