Message ID | 20190617073252.27810-94-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBKUITXUAKGQEZVMPZRQ@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 406B83F353 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 17 Jun 2019 09:41:31 +0200 (CEST) Received: by mail-pg1-f199.google.com with SMTP id k36sf7213261pgl.7 for <linux-amarula@patchwork.amarulasolutions.com>; Mon, 17 Jun 2019 00:41:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757290; cv=pass; d=google.com; s=arc-20160816; b=k7iLFTquhdvkEsUniVOwyaR7btf3vuBdUJuSjJn+CBewJKLAJC5DEEjum19dbmtUTo OliM6HRs+GfukhJPtIkLdmf6ams4lVrh94AvOb0shttZd+61xT3mVcSoyo8T+hTPgbjw daleawP5/qp1uecuAuVoxMFyymC42GFKbIsLVDkS+jd6ct0to8Vge0e6avFLXD+D2ALA ALzCNFHu4fgnJdDrC3b88PZxPW4PEwV4ktea9Z6FK3qDCzWbsP7e9XIvFgMLlFUn8l+9 ikrZ/lD9pdeK0ORjYja3be6/Av/2ZfeVOwwehQFiZRO2Kx/519+VHzkkEBtOH59kCl+W 5vUw== 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=6hhRLb1+b+fNskUReHBD6RGawnTQaVi6iiUcWv4VM94=; b=aKh5XhC7Dxfj74IbQ3esJchveyg8L7F7WoaR18Rcuz008I3pbKLY7TxUD+dVTyeBIf RqgfFPxzGwz5fd64BErKqYe4uH2gZ46rKg1/IS+6ApyapGxAWtS9UYYXZdW6EHTcm8pI JNRCJZqCthKRt8dXid+tBsUQK1on+B22fkW29FSum2KR4pv8ouYKTQZk4iniYCfWdl2G y8FUTLktJUJ1ebs6mmyXbR94BI/zRuDPbgDlXt6ucow/9OSgzP852yFCmLP28Ynb3oM1 xsAzcgptZmrWHD5lAyenVKEl/7UOAwyaSzA0HBUucLAtHAi273Ox42dJRGF4kbT+LJkF DlHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cVKhqc6i; 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=6hhRLb1+b+fNskUReHBD6RGawnTQaVi6iiUcWv4VM94=; b=pQUNmWKbpkjOjeEgCifQWhmNB/TEKWpwjy5A8Mh7HYzMifHF0sOe0M5SzGte0Km0JI FoDtayyo/0Re7VYwkjSO5EjQIjxrdQNfaZdpRKXpDNw8uofOsC7zNvovBS6C2jSCO2pK CnUXh/CX2FwVc/nwVh/zHj7laypnzbARj3v0o= 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=6hhRLb1+b+fNskUReHBD6RGawnTQaVi6iiUcWv4VM94=; b=VBTvZgy+v8vemWNizNFBwYZ1Ie/7ab/l+I2cZUqH/jrEQBsp+5djGLjMx3af30j5zC IppHxV7cIw75HOSOmfQq6gmnGxUtPhuCnsa/2Ke0CJrcC+dVo3MQpDo+0v+zsqXWpJgQ smj0Gx9fOyzg7lOI16qg7zaC4FwGuVsFMZuQBOtp556/VHum0g5s2x8XFLHjpjniozHF BW2+d/cqQh6rrhZmqrn871BuARuC/O4RTlrCZIReYB2qz41XTsEEF9b3yufqTpkNfRA+ LMCr51auGEncDEqpq298vYKIXw614c2SQt+UMYp2WUwT2TAt4JoG/8NaH7uaAhujcT4H WF7g== X-Gm-Message-State: APjAAAV+Otk1GKamE9iLOPncgJ1HMBQ1WXisnK5Ol08LRlzgIyLZmmTn E0WPMh7xDKYtRUNxFC5Bu9vUigdZ X-Google-Smtp-Source: APXvYqxTAd9Mqct4UbfzXzUmtVSbVX5kfFajSxgmyLKih8IJGgihPZGYETcKehnTQemMkKsV6AYN4A== X-Received: by 2002:a17:90b:d82:: with SMTP id bg2mr1847799pjb.87.1560757290091; Mon, 17 Jun 2019 00:41:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8a8f:: with SMTP id p15ls3755216plo.2.gmail; Mon, 17 Jun 2019 00:41:29 -0700 (PDT) X-Received: by 2002:a17:90a:9503:: with SMTP id t3mr24794025pjo.47.1560757289773; Mon, 17 Jun 2019 00:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757289; cv=none; d=google.com; s=arc-20160816; b=bUKRfSsI5IUEgVPIz4ubeYQD34UMcB3ElRCH8XCru9nCMcvaWsjs6HRoGtpWZN9ksR Gk6pY5pioIcv4V24hhNMWc2p7fMnYEjuuPuyagAVEx+hVIpM4IYFMtmKKGi3PxRoRef+ 1dSNAnJNianlmqZMY53kvv3ByDpgcfpP1ppX4my7iog5HfXeuW2gRUJ3cP6jEBMl7ct6 fq+271suMXCnyUFIudq8xtTaAtVGjzIwGphiZ1oggyaXVDb3NLW0EScekobT4cJnf1Rs A1jUKkyYZ15lCxZYabhHZSAGHPfb1HzgKAJZOpmlA148xzty1PGZ3hZDKIZjtTkYDnXZ OWPQ== 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=PQWH9ukfTdjRbywMISY+qcE2oqHuZ5y3usrU2Fjsdo0=; b=yhJzJdaDUZjOY2DcKLlxlKxOw+hBgQ1DEqNKC4WXb/xVNBNgfzJ98yZkYpLQizwfNd r8fX/fdaqsx2Di1Mut/0CeAIpT0Ft96RPPGSer/r1CbyaRvuovpfUhHXsOnHiGL6UTHh BB/M9zxCZ4yO5l0oJw2ZHHvtMssSthTeC4ZWHeSAklcJyxTqOGF5IBEtVFNxCeQL4EAo aEez5CSAVsUc+QiOK/HaXvqt/x0NGdBS08ZctYg5OlxlCGdljsCsBIOBbjOsD3NyIjzD FQIPkkhgAoToCSV36ailN/wxGf+uEJiWhjRCXbPBSqBMH5Kyl31GJaSFJ3BzV34g3732 1FJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=cVKhqc6i; 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 go5sor12600391plb.37.2019.06.17.00.41.29 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Mon, 17 Jun 2019 00:41:29 -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:27a8:: with SMTP id d37mr107115254plb.150.1560757289513; Mon, 17 Jun 2019 00:41:29 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.41.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:41:29 -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 v2 93/99] ram: rk3399: Set lpddr4 MR12 Date: Mon, 17 Jun 2019 13:02:46 +0530 Message-Id: <20190617073252.27810-94-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=cVKhqc6i; 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 61b886ba68..5c0914f40d 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -1940,6 +1940,55 @@ static void set_lpddr4_MR3(const struct chan_info *chan, } } +static void set_lpddr4_MR12(const struct chan_info *chan, + struct rk3399_sdram_params *params, u32 ctl, + bool ctl_phy_reg, u32 mr5) +{ + u32 *denali_ctl = get_denali_ctl(chan, params, ctl_phy_reg); + u32 *denali_pi = get_denali_pi(chan, params, ctl_phy_reg); + struct io_setting *io; + u32 reg_value; + + io = lpddr4_get_io_settings(params, mr5); + + reg_value = io->ca_vref; + + switch (ctl) { + case 0: + clrsetbits_le32(&denali_ctl[140], 0xFFFF << 16, + reg_value << 16); + clrsetbits_le32(&denali_ctl[154], 0xFFFF << 16, + reg_value << 16); + + clrsetbits_le32(&denali_pi[132], 0xFF << 8, reg_value << 8); + clrsetbits_le32(&denali_pi[139], 0xFF << 24, reg_value << 24); + clrsetbits_le32(&denali_pi[147], 0xFF << 8, reg_value << 8); + clrsetbits_le32(&denali_pi[154], 0xFF << 24, reg_value << 24); + break; + case 1: + clrsetbits_le32(&denali_ctl[141], 0xFFFF, reg_value); + clrsetbits_le32(&denali_ctl[155], 0xFFFF, reg_value); + + clrsetbits_le32(&denali_pi[129], 0xFF << 24, reg_value << 24); + clrsetbits_le32(&denali_pi[137], 0xFF << 8, reg_value << 8); + clrsetbits_le32(&denali_pi[144], 0xFF << 24, reg_value << 24); + clrsetbits_le32(&denali_pi[152], 0xFF << 8, reg_value << 8); + break; + case 2: + default: + clrsetbits_le32(&denali_ctl[141], 0xFFFF << 16, + reg_value << 16); + clrsetbits_le32(&denali_ctl[155], 0xFFFF << 16, + reg_value << 16); + + clrsetbits_le32(&denali_pi[127], 0xFF << 8, reg_value << 8); + clrsetbits_le32(&denali_pi[134], 0xFF << 24, reg_value << 24); + clrsetbits_le32(&denali_pi[142], 0xFF << 8, reg_value << 8); + clrsetbits_le32(&denali_pi[149], 0xFF << 24, reg_value << 24); + break; + } +} + static void lpddr4_copy_phy(struct dram_info *dram, struct rk3399_sdram_params *params, u32 phy, struct rk3399_sdram_params *timings, @@ -2189,6 +2238,7 @@ static void lpddr4_copy_phy(struct dram_info *dram, set_lpddr4_dq_odt(&dram->chan[channel], timings, ctl, true, true, mr5); set_lpddr4_ca_odt(&dram->chan[channel], timings, ctl, true, true, mr5); set_lpddr4_MR3(&dram->chan[channel], timings, ctl, true, mr5); + set_lpddr4_MR12(&dram->chan[channel], timings, ctl, true, mr5); /* * if phy_sw_master_mode_x not bypass mode,