Message ID | 20190611145135.21399-76-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBMEC77TQKGQENU5U7UY@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E63523F08A for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 11 Jun 2019 16:56:49 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id f25sf9754827pfk.14 for <linux-amarula@patchwork.amarulasolutions.com>; Tue, 11 Jun 2019 07:56:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560265008; cv=pass; d=google.com; s=arc-20160816; b=nh6GOR23Z9Fg+d9ptTutqdBtsBQdbZQPajtiRdAFMVG+XhWUMclyvLf2vho1BUpqm7 p03henkGirX1Ee8efbZgghlglOmGmH6HkWJK/7c21A0wg28k7clsyezAXnWe92ypFq14 /6Kv8CPNKB6dB1SiRHz0Mve80lmVh1t3xJGx8sqmDQXG4LU+b5Lj71iWg5h1jlDbTxYr 74MywDr0l1NYKlbDlSDk89L3mbq7j4Wy05VHIYvEdzlJuT2Fr5gY0vrR/TSHI3/Zf3Mj UPPDovqBB4GckJ8/bBKJIoS6TifqzKmqo7i9ksYYSzW+ugES6xkDIU0SlLzb/ML4jbZ+ a5iQ== 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=wwFfqsbIX6XP+5gX0pLc7UMx3mYSC9kxZUMo8SwLaNQ=; b=XhJxojI+k6yUNEoz5sM3gXxBdRolzaz4ryC/N6tBLJ750XjfsHt4tX7lxoDqpVyBSN HulOY8a05VQs6pRUQtiLsjsms9Ys97EZ79ZcmbXsslhYS0TG+s5LGK1X6P1C7lCruwLn pbmJVHr0iwsPYy1Y0s+IrhnV0ILB2TyW2do/wUNaXRsKHeYcR5vOoboe57Xh8jKSFkxN mElS6lFEWbMKD2sIJ8UQhhrcLK5AaSKx/kH35TGRIOMgv3hH3hkjfgjlHvdT0ZJVaeB+ kIUTNqO17qnAQu4+d+6oR0hEdsP+KXIJq3kNjKRe5601LU0QKKrCHYqEHRmipdLedN6a /RCg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jqgj6lY1; 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=wwFfqsbIX6XP+5gX0pLc7UMx3mYSC9kxZUMo8SwLaNQ=; b=ca6ob4FGh0vtMG9STcPYQVA2mS5y6q4sIevvqIAWF+TWMUpiFN9hI+EPAUthK8X7/N 7dJ95iu6ro4ncvmnRUJmymgMrLbTTfWY7OF0SgkGLlH1yIlYrg/YliR9r9An5hQuSJqU u+vc6DxpKcSjnVHvM1FMti5VqSbS4r7Orm67U= 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=wwFfqsbIX6XP+5gX0pLc7UMx3mYSC9kxZUMo8SwLaNQ=; b=SrBUtughTp8YmjYKZWugUlnL8DYrfla4G82U8YaLYds0SkI4Nm45q2xrxTXRZBh+md ylR6jvayyTYS6Xti6GdHFxfDOr1uSrJeXqErmm7waX9yPIP2alvjnm82oaObpYzpyTn6 ICqieRjfAxCWVZZCNUxuhH7wzhyo6tnRXSH/OViLeRv90vsTGgnXLyYgSzHK/XUFgNeC wV4MzCoFm7PAFfLNurWvf7IUhEcXjZkYxkXJkaCsUwYKExSjOTqTTNQKPao1iX1Kzn48 x8QP7XXkBrNLbKfwbx/VcmS9MKfSL8TulOhOJ2LzZHf6a7n/naK0QvazGDa0WoSA1mKa AEpw== X-Gm-Message-State: APjAAAXxb7jrvlc0/XCRUKelHwdtlVKx7lRTyDvSqBk5Mt/cYIzvxuWW 9IYSVqjQKcUK4oYRc0OqeM6D095d X-Google-Smtp-Source: APXvYqwCRggayjwslK3/sM9eKC7AaiHj8vsEjqH3bylBRpjmM5m+mJk4S0wnAfyqtcWhBzWuQykouw== X-Received: by 2002:aa7:824b:: with SMTP id e11mr79336336pfn.33.1560265008759; Tue, 11 Jun 2019 07:56:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:a584:: with SMTP id b4ls865631pjq.0.canary-gmail; Tue, 11 Jun 2019 07:56:48 -0700 (PDT) X-Received: by 2002:a17:902:2a28:: with SMTP id i37mr74507996plb.52.1560265008444; Tue, 11 Jun 2019 07:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560265008; cv=none; d=google.com; s=arc-20160816; b=rCumCTFBireuAZYMEziMLTEHGfD0wvuj0rs+t60rGTi+aZ7AyJq2btmOQ4cOrXhJtH COB8BO/gwaEGU9OJVN9OfcyuG+lgPwfwey8TPN0mQYsaBbfXZ90JQEPigVJgxTDgY0LR 9psgs4y3O7T1UjX9dGirp3M0LLCIc12kfdFH6di+VTZKLKwMQjrAQfIJMiBXm0mo4EOO lC0AJTXBI3OiDGJxxigpL34lC0oDkJVxhB+vu7QX/veyeYhz+zCeQ0BRMrQ6JHQ3jQgQ wQeXSlkQNC/7Co3I4bvG12ZQtDEydtIqtNPK4EHhrBIeGGbxkg6M64Il4Xsmx9jhGnpt wtFg== 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=MPayWhbGgEs+DGe2m5E7+3IPn0K+3R0BZ007ckgTzeM=; b=BQpWyHy2cFw2WRVhWNSJ3Pf4jPTehAubDWZDvp9yaClf1zXCo0HepvUcfEXXo5h3kn TRAJBRt17MT8RFrv22XYIKtR78mQUfknEAlM5wZpZ1xpq+ldSf8IEwi5RLMLqfJcgSO2 ySOvIFdywq02EQSapV4v3ChdQlwPFNRtyMLtkL9GIzNYy5803T0MzQUVrl2/vQfYs1un COc4FRB6ieh0oHnGfRSn+9/X9UwoExVx3x5cxWxIvlvoxXsYm1aKxLArsQo+vu4DH+vd QbgIi9N1rs91WhF3xRtBSTBd1BcGrhFc8/nQipem1fvqEUz7kTas9GpcyhxcCf2aF78o cJWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=jqgj6lY1; 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 l68sor15323847plb.69.2019.06.11.07.56.48 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Tue, 11 Jun 2019 07:56:48 -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:a98b:: with SMTP id bh11mr50065341plb.8.1560265008029; Tue, 11 Jun 2019 07:56:48 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.56.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:56:47 -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: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH 75/92] ram: rk3399: Update lpddr4 vref based on io settings Date: Tue, 11 Jun 2019 20:21:18 +0530 Message-Id: <20190611145135.21399-76-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=jqgj6lY1; 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 |
|
Related |
show
|
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index c0e9a4e7c8..413469f4cc 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -339,7 +339,8 @@ static void set_memory_map(const struct chan_info *chan, u32 channel, } static int phy_io_config(const struct chan_info *chan, - const struct rk3399_sdram_params *sdram_params) + const struct rk3399_sdram_params *sdram_params, + u32 mr5) { u32 *denali_phy = chan->publ->denali_phy; u32 vref_mode_dq, vref_value_dq, vref_mode_ac, vref_value_ac; @@ -350,9 +351,19 @@ static int phy_io_config(const struct chan_info *chan, /* vref setting */ if (sdram_params->base.dramtype == LPDDR4) { - /* LPDDR4 */ - vref_mode_dq = 0x6; - vref_value_dq = 0x1f; + struct io_setting *io = lpddr4_get_io_settings(sdram_params, + mr5); + u32 rd_vref = io->rd_vref * 1000; + + if (rd_vref < 36700) { + /* MODE_LV[2:0] = LPDDR4 (Range 2)*/ + vref_mode_dq = 0x7; + vref_value_dq = (rd_vref - 3300) / 521; + } else { + /* MODE_LV[2:0] = LPDDR4 (Range 1)*/ + vref_mode_dq = 0x6; + vref_value_dq = (rd_vref - 15300) / 521; + } vref_mode_ac = 0x6; vref_value_ac = 0x1f; mode_sel = 0x6; @@ -771,7 +782,7 @@ static void set_ds_odt(const struct chan_info *chan, /* phy_pad_fdbk_term 1bit DENALI_PHY_930 offset_17 */ clrsetbits_le32(&denali_phy[930], 0x1 << 17, reg_value); - phy_io_config(chan, sdram_params); + phy_io_config(chan, sdram_params, mr5); } static void pctl_start(struct dram_info *dram,