From patchwork Mon Jun 17 07:32:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 633 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 63E733F353 for ; Mon, 17 Jun 2019 09:39:49 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id x3sf7206875pgp.8 for ; Mon, 17 Jun 2019 00:39:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757188; cv=pass; d=google.com; s=arc-20160816; b=EzlRCK7OhUq/q2IPAmVz4irXUt936klvmi8nCQ/6nSAdyMeFGn7XjpPZunw6RAD1sJ HUtFC5TkCKCrPonRtE40nhkOXo7T1pMs2etPIzedXJmLP78ahP+d6QSj0a93ac9u1EYG +Ycgj5QyNsuGTkN4F0GtV0VfzzldAlEhLvfUjx/AyJM47UbTj6CQK+mvg1r+qYudyKwf 6Z2/lMDHVMLI7qRWbGP5O/uyiqo7eaX2JwMJ3FQ2t9NSHptTIVqjv8wr2pEtAcc0TDkd g9Wtxl5SLdIJpXiei8nYSjUsbGPK1e0FYAbejA9ZbtMNAql0vNx5bMKZsp//p4JXEjDO OlXA== 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=WZr2BvC7MrvCWC11t0Se5wYqkpHCTIPKTBQdIr1iNaQ=; b=RTxyT6Xs1aPpWFlR0FPEjjBaYQG4HZo5XUkCr1nzjjzggSFKbu8oWlUnJJLJoBzVoC H5WBsVb450+Bj8w12BiwKdIntFU1EmlnhOoHrXIY81UrTerqmzmaOYZrI5HdOHgZ4sF5 mwZKGSuMinrUmImVf0dZzsxmIoo9mPjH5RY5OHgAAmaGgUdveYR7aIQ0ukbkoL2YmQbE o1bw14iXhKnaa5LN/HwaiEbnZ8i3yfN6Oo30Cq1zGUlo3n3+trTLUaysfS/mIajnalbA Me4Qv9aY4zYDg7F5A7M349T9At2idNG85Qigk/u/vUPRp17griWYBEV7iHe69kQpHzFM 1nRQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lMSk2q+T; 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=WZr2BvC7MrvCWC11t0Se5wYqkpHCTIPKTBQdIr1iNaQ=; b=iQBhRXNWgtuF8TAmSrgY6mF7j5u/GxRBHkYh3KiD1wAkGQGsWG3U5h1MxeRDig26f/ VRBFw/XYPbwZbBxsxip7jtwbEb20vFe+w/irE1Xr8kuRLCZwmY0g/BZt81eBQege0ZfN AwvYgG0/oFey34aSml9i4S0bUrA4pheiK7RWo= 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=WZr2BvC7MrvCWC11t0Se5wYqkpHCTIPKTBQdIr1iNaQ=; b=K7nS60hNL7s1TXI5j4SyuEclMxDFDkVcnhaOK+tl23WtX5ypAzG5kG2wPorquCqje1 T2D1Mb2sdZ1vgKnfj1A+M4N03O/vfNLAJYaBAt9wg6PwQz/8iyvz0Ti3baWnbqWGXZpL XXudtj/rr3O5MQd1/D9PICk6bJQMxbUKLdgQJy0h59I/DZXw6bz3dXwC6heQINrtbiiQ s0pobpkFMJASbJMWDDY3NZgN5Go0n0qp9FMzmS7W5KKDNoSm2dodPE3r0Nk09e5rS2B0 /Hkph0KsR5oAEi4br3J2DD35ByeR6pyZIC+kvCc+Hq+mxXD/6rorq8WL8Ti4dUTV5kyd RVMQ== X-Gm-Message-State: APjAAAV+QDVqIGKzh5fIJfj54MuqrEFGCwL4SfDZoe7vwhebpNh3d3nm LCvJj/MI1vDP23aOghXoK8Q8fRaw X-Google-Smtp-Source: APXvYqzXdvdogJhnjCukK8ZoooonWI/AF4w0JgiDMdHeJLonBpHfc3Sv+oIFpiTZUYze2lCch5H7EA== X-Received: by 2002:a63:4c1f:: with SMTP id z31mr49356335pga.334.1560757188098; Mon, 17 Jun 2019 00:39:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3227:: with SMTP id k36ls3161943pjb.0.gmail; Mon, 17 Jun 2019 00:39:47 -0700 (PDT) X-Received: by 2002:a17:902:5a4c:: with SMTP id f12mr27151886plm.332.1560757187846; Mon, 17 Jun 2019 00:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757187; cv=none; d=google.com; s=arc-20160816; b=MrwjEwd0B7THSvvf/duHaucFSXGb16E0z1i29FP8TvUwLS7vR/xHrMAQi6jdQXvmTU L2+Lax9vcc8V55s0t5gPeT+xaKi3sCsixwDDN6sW6XYusYBWMJou6jCkvO/Pj0qgpxrg EoIJZd8Tt5gjUN56dVM0/foi3s+kuFbILcvxyrGQdF1t7Z90rDWlgP5I/ZkpsHoUbUbd z0YB48DgyDFfFJfIqT5Fi+e1w0WZdqRo/2Si3G3V8sM14e1hsAeGkIQQjDogjwAX3MW8 0pt+XSB4df1Z+DdXCLW1vp3lYqahw0bdZcbAowBglPSV0CmYMOMiuAYrmBzMTB+cZoq7 7LPQ== 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=9VACJ/ApzH3IFsKQOjKHjSl5B/lOcX/9MePZIjfQHMQ=; b=YbBdnX2hiAX22BlhF59dwO1he2gRbFt+3OHR8WW/iYFEhz344Kb36wSzmd2PKlLI40 O/DWhNPdKU1j8H4EV7Fp2004sYRiyxHxMo8FIZ5tGNJtgD+dedkdFL4nofs/m+uRl8cJ tbc+zfknFOrz+JKZ7Hl+33CoffnkvGfRfsODYYJIhSrLaSxe34ulgnmuD+L6mvZQU9rw kdkslJkTqlsRfY4m4bqf7p9jXoc2vu20ezY97A71yz8YbXsZKCIh7WgDUb/AUZuU+ar8 ohlrTpIoj7m4QZombcF0WujDcWhxGyOfvzDE3fagXYzuRKKEde6pC0kGvG810SNKboQc x8WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=lMSk2q+T; 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 h25sor10946080pfn.13.2019.06.17.00.39.47 for (Google Transport Security); Mon, 17 Jun 2019 00:39:47 -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:aa7:8dd1:: with SMTP id j17mr22386074pfr.52.1560757187578; Mon, 17 Jun 2019 00:39:47 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.39.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:39:47 -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 62/99] ram: rk3399: Move mode_sel assignment Date: Mon, 17 Jun 2019 13:02:15 +0530 Message-Id: <20190617073252.27810-63-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=lMSk2q+T; 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: , mode_sel assignment is based on dram type. In phy_io_config, already have vref setting based on the dram type, so move this mode_sel assignment on vref setting area. No functionality change. Signed-off-by: Jagan Teki --- drivers/ram/rockchip/sdram_rk3399.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 935e3c495e..3e7261a950 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -205,6 +205,7 @@ static int phy_io_config(const struct chan_info *chan, vref_value_dq = 0x1f; vref_mode_ac = 0x6; vref_value_ac = 0x1f; + mode_sel = 0x6; } else if (params->base.dramtype == LPDDR3) { if (params->base.odt == 1) { vref_mode_dq = 0x5; /* LPDDR3 ODT */ @@ -265,12 +266,14 @@ static int phy_io_config(const struct chan_info *chan, } vref_mode_ac = 0x2; vref_value_ac = 0x1f; + mode_sel = 0x0; } else if (params->base.dramtype == DDR3) { /* DDR3L */ vref_mode_dq = 0x1; vref_value_dq = 0x1f; vref_mode_ac = 0x1; vref_value_ac = 0x1f; + mode_sel = 0x1; } else { debug("Unknown DRAM type.\n"); return -EINVAL; @@ -292,15 +295,6 @@ static int phy_io_config(const struct chan_info *chan, /* PHY_915 PHY_PAD_VREF_CTRL_AC 12bits offset_16 */ clrsetbits_le32(&denali_phy[915], 0xfff << 16, reg_value << 16); - if (params->base.dramtype == LPDDR4) - mode_sel = 0x6; - else if (params->base.dramtype == LPDDR3) - mode_sel = 0x0; - else if (params->base.dramtype == DDR3) - mode_sel = 0x1; - else - return -EINVAL; - /* PHY_924 PHY_PAD_FDBK_DRIVE */ clrsetbits_le32(&denali_phy[924], 0x7 << 15, mode_sel << 15); /* PHY_926 PHY_PAD_DATA_DRIVE */