From patchwork Tue Jul 16 11:57:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 773 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 7809A3F08F for ; Tue, 16 Jul 2019 13:59:23 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id 91sf10051669pla.7 for ; Tue, 16 Jul 2019 04:59:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278362; cv=pass; d=google.com; s=arc-20160816; b=UKVa7uxHzotNN17JdzliCXigrqKR2adVpteL7IeQIZTNGFGsNCQNTQbLN0ZSG1FRm0 XptYa2ll2DivcZOKrHzWsxyhjjXIVUBHhNZwJIGRWyIRsr0YKHkhPJPq+Mfq7sPdx7TJ AfLhiYvi3Rp9ETvuMJr271NOuaiaAGvnyhet+o9CxSr/aZTxAlKABj6M5DJBaRCM8Xm8 ZtZ4CviFGry+aXrjdam/sUHk4ozlplyTqg3D2MxisACCAFdLv5e0OExk7x4YN4QRYuV6 2fCNNF2zCXVj64A67ezj0nx4BWSYqHDXdBMBPxJ6Rz9i5VNIZS4EJ/vnAX72BJoDi7tu WKGg== 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=2Fulb5qHSSddhBVjtERi1NCViDJ6IrUELxPhZp9HHvE=; b=Wv5r13ixDSO4jdVTguW2cZMP5DF4nr8mRDgb7ffhGNPM/pvxHydj8Ef9exaF01q2D+ wstToTCN7ws5xo0UCM+2CzP/7Hwjlns+PY8UX5ltVCSVzrer69EqYtDsplHC+e/pYbkc 8bgAyTH/4xd909Pokic/YUu3+szZsQFoOi24Fm/j1n4nNzyv+Jq6McZnycIUXjpyh0/a rxzIdy/0+9QWLaf7XPFV/ixHyNRlsOdt03XMKLNBoIcgDhPAHoIG6DaJWQ5QiBPXVm5y KRxnmD5E1q6m67971otHmpjNiRTBXi10e/3vH19iCfJ+TuOR3qYZkgKqSF0AiEoNNZGt 0EmQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=G9GmkIyM; 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=2Fulb5qHSSddhBVjtERi1NCViDJ6IrUELxPhZp9HHvE=; b=eqHSc9l/0zBYNna2yAWFXllr732tmrTeAXQ9Ggtb0wvcS49KQxXil0VOTI5xmfRiea y3wdFej+MAoArPEE4uMRCjzXuMpItlB/BsTeC2e18+nkxk9EiDx7Mmpr9LUnwINUKo/4 Psx5QXlTJEnNQzo80pdJaeLQJHmNi7JTYV3SY= 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=2Fulb5qHSSddhBVjtERi1NCViDJ6IrUELxPhZp9HHvE=; b=gPeolRWIQwRn6hZnqi1tEoAb28igskn6TtzbtjSRphHrtLEmq2UMz6+yeiDbar/E6M 5i9fdGy1NM1IuqjwTJlz9MQAfwpqzMQ4X84yyQCpJ9oDozzI1Nj+FFIgZL15QHjip/UD 1lt6XONRxfaTzIz1yjSCsTGDo7I2EUrDc4htL1qpfx1DB2yvt4kauW/k86sPJ4svLHzA Rl83MGmm9c/ufJ7/RS7/UROFgdqMzcDPkZJgRrmxMe1isqSQ2nV361J4qxX9wKfhYedb 9KrxyFov9TKCDrRK55ZmstgYDDHAgqppvrsV5t5TnVLNrHI/1XE8CgYNWD++cABrgiIZ Alag== X-Gm-Message-State: APjAAAUgo9y6DaoLb+BxR/azN4srQvlBWnw+0G0YLYFzlD+RBJ8+6rb5 yvfV/SDpisqfgG+NktHbT4vCoJCc X-Google-Smtp-Source: APXvYqyGVQbPaDlS/b+ka5QYvnmJwa80lEnOdWU2Q3X3jNrsTiWIY4WZ/pCU/QJYNdLwZuE9aWgb0w== X-Received: by 2002:a17:902:694a:: with SMTP id k10mr34515369plt.255.1563278362350; Tue, 16 Jul 2019 04:59:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:18c1:: with SMTP id 184ls3474069pfy.10.gmail; Tue, 16 Jul 2019 04:59:22 -0700 (PDT) X-Received: by 2002:a65:4045:: with SMTP id h5mr33994141pgp.247.1563278361860; Tue, 16 Jul 2019 04:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278361; cv=none; d=google.com; s=arc-20160816; b=gQ512YLWkeyqHq55jfCTCjaaILo1dHUidsiAhzByCpQmX5Ke3DhWsl4+Hl05c1xDwK K/QffdLpB2VhuxHNK1IzKfv21o3tUY8M2FWw5YLr8r4D7mCIySHN/iPSC9x71hMi7JnM LzP+Yjw3Mi/67hsSnlWMIdC76/0apPhlYw6XfyMz5gFpBDR87zmyzwxo82jehFlPvFQ7 ZkGQJScoPAzJt0MnM01f88CJ6+c+h6iy76iVzBMWm3+sjeB3HNehypPXV7TAkEl+nnc8 1T/Yn8qMPuIn4fTomBLNNoGULNlNsbUQpdzOjEEyIwY2vkwN1luoAbyWQrNx9qIfNH0c /DTA== 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=QafmgbriflDoZckEsWmBvRP9dqWRhbWXJvx5leo6fWE=; b=vP4esVW95zXyInpvox462+mbYIPvOFyaZUagV87oKyy69//z5ChiC15dsFZRXVLQRG TUhbJHTvfTyYoE2djwD9UmMLrg6kB+XGbCRziC/wFlXjfIXzJGTfuc2+wjl9Y6sXauv0 0rZBUAHKy6kOi3sWTVa1rI1R1F7QN4kN33V+3/8GCv/P1jRYorwfk0kcAIAJCv5uQmAx 1/FO6WmqFxz0E4Nst6WhDgbQ8Ctc0ctgWE2/vaMx2+wD5z1oaptCsFhjPl/Wz9TVxvaH fbr358r1HYVMzrrpURgcG3JlNYOuRu/8Lvn3FYQPniHCXGBL3f7lhAYtSFWs+J5Y0ZKF PXtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=G9GmkIyM; 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 f89sor24622947plb.5.2019.07.16.04.59.21 for (Google Transport Security); Tue, 16 Jul 2019 04:59:21 -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:8c98:: with SMTP id t24mr35697603plo.320.1563278361602; Tue, 16 Jul 2019 04:59:21 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:21 -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 24/57] ram: rk3399: Don't wait for PLL lock in lpddr4 Date: Tue, 16 Jul 2019 17:27:12 +0530 Message-Id: <20190716115745.12585-25-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190716115745.12585-1-jagan@amarulasolutions.com> References: <20190716115745.12585-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=G9GmkIyM; 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: , lpddr4 has PLL bypass mode during phy initialization phase, which does all pll configurations. So no need to wait explicitly during pctl config. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 88fbfa440d..023838a301 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -570,16 +570,22 @@ static int pctl_cfg(struct dram_info *dram, const struct chan_info *chan, setbits_le32(&denali_pi[0], START); setbits_le32(&denali_ctl[0], START); - /* Waiting for phy DLL lock */ - while (1) { - tmp = readl(&denali_phy[920]); - tmp1 = readl(&denali_phy[921]); - tmp2 = readl(&denali_phy[922]); - if ((((tmp >> 16) & 0x1) == 0x1) && - (((tmp1 >> 16) & 0x1) == 0x1) && - (((tmp1 >> 0) & 0x1) == 0x1) && - (((tmp2 >> 0) & 0x1) == 0x1)) - break; + /** + * LPDDR4 use PLL bypass mode for init + * not need to wait for the PLL to lock + */ + if (params->base.dramtype != LPDDR4) { + /* Waiting for phy DLL lock */ + while (1) { + tmp = readl(&denali_phy[920]); + tmp1 = readl(&denali_phy[921]); + tmp2 = readl(&denali_phy[922]); + if ((((tmp >> 16) & 0x1) == 0x1) && + (((tmp1 >> 16) & 0x1) == 0x1) && + (((tmp1 >> 0) & 0x1) == 0x1) && + (((tmp2 >> 0) & 0x1) == 0x1)) + break; + } } copy_to_reg(&denali_phy[896], ¶ms_phy[896], (958 - 895) * 4);