From patchwork Tue Jul 16 11:57:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 780 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 704D73F08F for ; Tue, 16 Jul 2019 13:59:48 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id t18sf2522318pgu.20 for ; Tue, 16 Jul 2019 04:59:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278387; cv=pass; d=google.com; s=arc-20160816; b=YSGLN1+vUbHvdWu27QKL1tF8+mEUFaS5m70EzR3t4hbk/Dj3d4oFMqudRkvuPyjvQO 5EXaGpYVGzWd3Jf3gqubAZt2ey8BIygYfI/DDtMk4PsWP+1tg6tz0M59QiFy18vdpnGO B/gA1/Gk8+Na7Yr7ewIA1b9TNTVAV8nV2YsgacjLwK/ZasI7w7cCDxcMasZsN1YzM9u4 WAf9b8aR0fIAcgRawIhK9MoYX7JM+76n33mVCmRBEd3a8/HwoLnVRC0IlDTvgu4haSPq 0zj3WZJWoUO+8a3WILnG5J1YLozUF5uSXyIZ9f1Flsu+WxP8FrsgSzanwf8O66LzHnym S8CQ== 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=6rSP7m4rPeJcKquc8xbwsbBzsPrLyAWxOvs3Y8BsxNE=; b=pQX9ZRMCq6b+u2WhLSrs2OhpzHsC/CBnxQvlvNsJUyn9yzgBLM8DIvrxuDtjHy+lQ+ N7knb6A3Sal+0zprXzP66oZhfAraB/mUaHKiu/jPlhCYDxYFjxbE/BqCd8uXMfS7vftS 6FSPPUBwn1yuCn2lMXt32+jUrX9mYlx40LVyWw/NZuye7ZclMHyuTxwptD7C+Wt4jzZQ WuOl96LnsRGd/+5fgF5wx2ckp5FB993XucCx3bVyXbJqAxAZ0wr7+oHPNGF0VFxcCS+X Eo0K4gGAi3AQfDzzQV98wNyeZPh/Oo5vE9eplB4LeJxXzziZbfgpybasfQBMOhCoZy5z BQww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aX9gVM3W; 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=6rSP7m4rPeJcKquc8xbwsbBzsPrLyAWxOvs3Y8BsxNE=; b=CSnZaqqD7gEXBJiRQQzlbpIAdQN2iZhZB0RGixx3ivd2JpkDA7foGeHvD9aDS4c7DJ Kk3FdGDlQ2ppAMLVBxiPGGRahIN9khjqTuWyfOGaOEaSc4xMYlo8PuRwSs6OGS/9WnDo ZQwkrNu7reryzOvGEnIGNGkJx2a0ffM+nJea8= 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=6rSP7m4rPeJcKquc8xbwsbBzsPrLyAWxOvs3Y8BsxNE=; b=YO6N2B/L5fm5i53hihcN0Vv9kH7qheA9wMskojxfE1KhTu/vjcwXub/QvmA3A/wOiK vXB58sEZ8gXRtEqzV8oui9tIoZEdAkDY43xyvPRH56NgasM4MmnkpayqJwOjB8BRihFL wIDsdOkpHq7J8INzf8UvthlhSb/WrmpKVJKSp19zAegulJeG0kw2i09Ysd3ACiAHU2Rb pFutalEgyMegKKxxCJJrQK7AOCCF1xo8ragJVpnf1izTgEYGcgNlGkdpBeavv+x8S3ri cc0kjW1TzDLda802F8LqrILVo+8q1INPhWL+ugssI5MVHZkglVq2FQm9rlhnv4rAnsws Bo/A== X-Gm-Message-State: APjAAAWgsPCvrZaDWAy8Oleyyy0J781vGY11ksxJy7pwdyZ1l/MJsWL6 KucVFvISRa7Otd/M4a87OlDfwrnH X-Google-Smtp-Source: APXvYqzgaxEM8xajkHgT0OqjqukXHoIhc/Pd32Us/RSAOFjmwekcMkZL6aMo1Hc3U6Ni5mVmqFFwlg== X-Received: by 2002:a63:d4c:: with SMTP id 12mr33745868pgn.30.1563278387213; Tue, 16 Jul 2019 04:59:47 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3aa7:: with SMTP id b36ls7080423pjc.5.gmail; Tue, 16 Jul 2019 04:59:47 -0700 (PDT) X-Received: by 2002:a17:902:324:: with SMTP id 33mr33971937pld.340.1563278386912; Tue, 16 Jul 2019 04:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278386; cv=none; d=google.com; s=arc-20160816; b=oOnv95Xzs9rea3NgInZn7HAtksA9R70cmXAehSmT6ZhH2OSsWB/6aUVwtWPuR5tNBL hYrZ99UjJRna5V/ZlAifDGgUAO89AciumKh0brHKsvU9eSLTCVWxQgDwJs14UR+ns6bm ///HNk0OW0TX62XNW5LqkybLbvAyKvhOzwDDSILmgotXoZ0Y6Dq/S2rMyt5GYDf+G3lH 1yWr9sCMUSzKbqsVt2Fk2naVibtedLYWLjLLxw7Rp007+h1p+eOnoTiBZT921uL5HauF Dkr7WH6JU/gBbb92YnpIKTKol5nEz1lhyQrGoLFBLE7UxfLiUxvi3srYiJARjVQEYRdl +Q5Q== 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=ShnizxVOFJJJ3jmxPzb0Nn+OAjZ/FrAS/NyUepu9UZE=; b=DIN6yfI1Hft+9ypZ6gS/7iJ+2t+pT2Qp901U5qngoz0M54ZrlxBjXnUlkdl0cGkH9X 33I78BmAXHi93WL/Ix/hOdYJcARCKzb6i9Wkant1nh7r9LcgY4GuNMiPMDcsAjtmO42J iGafz5ULuIVY/X2dr934xD5pAUi8t5O+o3F2cx/XP5xMkdyoP1cTW/BX9cAgQJClSu5J BqQV49gq6EyzYI1+1H+tgCI8K0rq+kN0/lZgp6/61bS4QFoerY42ZGGJoE0gbkbpC7/D KCvV4tcyw2Qmsz1LRxDKlFtMGDw5VFlqOhRHJ++JO6YyGDc7+Ig8o2HRxCETm7NJfZ0D t/Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=aX9gVM3W; 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 11sor15727396plc.47.2019.07.16.04.59.46 for (Google Transport Security); Tue, 16 Jul 2019 04:59:46 -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 t24mr35700706plo.320.1563278386651; Tue, 16 Jul 2019 04:59:46 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:46 -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 31/57] ram: rk3399: Configure tsel write ca for lpddr4 Date: Tue, 16 Jul 2019 17:27:19 +0530 Message-Id: <20190716115745.12585-32-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=aX9gVM3W; 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: , tsel write ca_p and ca_n values need to write on PHY 544, 672 and 800 to configure ds odt. Configure the same PHY register for lpddr4 would require a mask value of (300 << 8). Add support for it. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 7689711a99..1050cbdb07 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -502,9 +502,18 @@ static void set_ds_odt(const struct chan_info *chan, /* phy_adr_tsel_select_ 8bits DENALI_PHY_544/672/800 offset_0 */ reg_value = tsel_wr_select_ca_n | (tsel_wr_select_ca_p << 0x4); - clrsetbits_le32(&denali_phy[544], 0xff, reg_value); - clrsetbits_le32(&denali_phy[672], 0xff, reg_value); - clrsetbits_le32(&denali_phy[800], 0xff, reg_value); + if (IS_ENABLED(CONFIG_RAM_RK3399_LPDDR4)) { + /* LPDDR4 these register read always return 0, so + * can not use clrsetbits_le32(), need to write32 + */ + writel((0x300 << 8) | reg_value, &denali_phy[544]); + writel((0x300 << 8) | reg_value, &denali_phy[672]); + writel((0x300 << 8) | reg_value, &denali_phy[800]); + } else { + clrsetbits_le32(&denali_phy[544], 0xff, reg_value); + clrsetbits_le32(&denali_phy[672], 0xff, reg_value); + clrsetbits_le32(&denali_phy[800], 0xff, reg_value); + } /* phy_pad_addr_drive 8bits DENALI_PHY_928 offset_0 */ clrsetbits_le32(&denali_phy[928], 0xff, reg_value);