| Message ID | 20190716115745.12585-24-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBFXYW3UQKGQEVCNMJUA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id ECFFE3F08F for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 16 Jul 2019 13:59:19 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id m17sf3563627pgh.21 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 16 Jul 2019 04:59:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278358; cv=pass; d=google.com; s=arc-20160816; b=mvvaHl4GZnG35TKtZPT3DrPro+/Bi/M1J5eyfXCfVrmDAkdGhBDI+/Lohr/mCT1p47 WkrSuUQqptutHvtHlggASkl/3W2n7Yz8w4eBHtAna6xnBDIMaAoWaWD79KJ+CbZMyZfp 58dMrNZ/FmbeVDu5DYtz1mWa8aMBSiLA01hkerDCIaSwCTVXngw4mj/VPVg56usP57Aq /WBu4v4v0DZVK7lHtqcrQ5k0KnYNuEf6UmEaXalXmyQ4Uu3Cdn5yPujzWt+ach0sj4k/ SVQpHi/5HK+0jpCbGLpvp72lZeiRfeAx5OczPg0kJ6rSmqafpiCHuFYdr3PytXAjNIuK pFkg== 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=nMut2PEJQMvNeJEnH8fdIiXtTltSuBYv5+rXoAih02c=; b=kMw1lag+fJIJKzgMf4jyzy5sY5zElkCJMPNZrV/UOKn5HhvgjQGLelmorz9dW36Cqy zuwJlhUgfOu8xOeg56fm4YDoEGMTW3t1owLQ8MIkM2WnFFGCjvLzWE2OVYej1QB3WRoP LL/Du9tT9AnE0/gLpP2H0fI/4hMz5MDgXEtJ9WcKSlauyniqj7i1J3IhLsJHY5v95YCg rPEaSMi1UXKMtWzI5iMGvWCwtwDXPmQfdYO41KyvgKnG7wlgDO7uxaaDDvx5oDg+iQvf Gzja6DFXVicfoUiCLpoyvYLcwjVQkxfR+5uxN5q1rd0qFlRmZRlKA11XllWlOab9E0PE HB3w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eMdikiLI; 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=nMut2PEJQMvNeJEnH8fdIiXtTltSuBYv5+rXoAih02c=; b=SLKgaEEODJP9JFO3aRU0M13AhBtcA5AFtICjh+MpHq2aXCQtnAN0Al+tl1oluPO0KN FSCH1XyVVMvZB35bzKxoZmnL6YGZiLAiHwlebjgAfmYZ+Qms+00eDGfoz+BFsct0fUvO JkAR8KB4b9rJ9Wkl1+9GQ3so1iSvZSAKDeYw8= 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=nMut2PEJQMvNeJEnH8fdIiXtTltSuBYv5+rXoAih02c=; b=tpAa7ti9LsS9xDdvIMykBuT8KyFq0B0bhenDz/thcmXsDtQAq/b2TLxdxZgBhGWrDf FzIJ4lGOnwUxMgGSpFr89gZUlDNImGwlcy7l0+4dBzCMKzDsExL3PVaKh+tRpd3Gl6eJ AMewRq7IyKmn0IsiTmMqRqf9Iv8rL/FT2a8zEqECd8NwoItfymcMBmTgV2vcIxagNos7 hmb1kDTDhCNqPAcMWGdUb09TAKU2DZqHGiOv0oUvHDT0qB+vD7Sxsx0htv+pWsCv1BxZ JQJwsFo+JpRtdgNY6f62tP8tDfff88KoIK4TYvlnX1OdMGzo7WolM5woSA/XiCJqJtaF D0hg== X-Gm-Message-State: APjAAAWjTBweBNFxlQehMkQsb7CvZdoobXdTJpl3WcPEy9XwipWUH189 ZwyJLv1QzUSvJUqz1RaqxpVc8YY9 X-Google-Smtp-Source: APXvYqzS6Yyr38Dtv8twAhNr64p0GUPd1ANyas0LTGFs6zWh0vYwYWgCjn5P762R0PGSP04K5pg33Q== X-Received: by 2002:a17:902:9a85:: with SMTP id w5mr34838060plp.221.1563278358771; Tue, 16 Jul 2019 04:59:18 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:18c1:: with SMTP id 184ls3474039pfy.10.gmail; Tue, 16 Jul 2019 04:59:18 -0700 (PDT) X-Received: by 2002:a63:c24d:: with SMTP id l13mr33439155pgg.330.1563278358380; Tue, 16 Jul 2019 04:59:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278358; cv=none; d=google.com; s=arc-20160816; b=AhuiaSy7VrIFanENGEZpxtKfWbkrI0nDFCf9TnTefjh7YSpBCEw84Mwv0eCDzG0HBm v2TdOaG4LN5Kz+nvnkEg8gIqJKPEsTpj4E7fvBWm4xoWgSXd837IkACgNVksAw13eo7Y DW5unZeY88MmxT1wKyCN2t2RZimGp0gUzbCEsZcHE5PDDp2XIuwtZB9o7dIS5g70hbPn P/b7rlwn8HSbl1bNUDuN4Ng2CxQULQ/rLgdnLKfFikCOvSsAMZhEQfVJzstR8BCYwn4r BlGh5UmO6QxO+vW9fpo4mcMM4PtOHuCC3J205uoiIagqij3lyMOMLGMKywvyXgY7usFt I99g== 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=Xv7hs5BBvaJWXNOawbd4P577U6W22vvaUZK7CZedUbs=; b=w27F/O7x1w+YDzkO0InbHG8H8jZuRwEggSRUhIOv6ouuV2y4UaK80yEMS4VfSsHaSQ onxCnMgtxzArHfXdF+KnjWFN8yVOMm7p2KCiTA6MMywa3JYvCTelsCAtSrm5/7CKxntj BC9xU5A0M+QAZVdjC6VFUimHbyxB3NzJEY9oG4vNbH9bBG4h4s8aI+EVMpKs6Vwfo/AQ E9njq8f0W+mjhDBzrahgEJ3eBOEwX5iAzpw0NA26e++aaBvRHguL5tTOh/HoprjmFmMH g/kYNNuyUDcuvADEC3ZjqYsTDcj4zcv9S44OsZSi9dF6QCheGVR/In50WUJSbIzBz0OC nApQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=eMdikiLI; 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 r69sor24819870pjb.8.2019.07.16.04.59.18 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 16 Jul 2019 04:59:18 -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:d814:: with SMTP id a20mr35839248pjv.48.1563278358060; Tue, 16 Jul 2019 04:59:18 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:17 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Simon Glass <sjg@chromium.org>, Philipp Tomsich <philipp.tomsich@theobroma-systems.com>, Kever Yang <kever.yang@rock-chips.com>, YouMin Chen <cym@rock-chips.com>, u-boot@lists.denx.de Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v3 23/57] ram: rk3399: Move mode_sel assignment Date: Tue, 16 Jul 2019 17:27:11 +0530 Message-Id: <20190716115745.12585-24-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=eMdikiLI; 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: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
ram: rk3399: Add LPDDR4 support
|
|
Commit Message
Jagan Teki
July 16, 2019, 11:57 a.m. UTC
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 <jagan@amarulasolutions.com>
---
drivers/ram/rockchip/sdram_rk3399.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
Comments
On 2019/7/16 下午7:57, Jagan Teki wrote: > 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 <jagan@amarulasolutions.com> Reviewed-by: Kever Yang <Kever.yang@rock-chips.com> Thanks, - Kever > --- > 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 711477188e..88fbfa440d 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 */
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 711477188e..88fbfa440d 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 */