From patchwork Tue Jun 11 14:51:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 517 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id EC2C43F08A for ; Tue, 11 Jun 2019 16:56:14 +0200 (CEST) Received: by mail-pl1-f198.google.com with SMTP id q6sf7886843pll.22 for ; Tue, 11 Jun 2019 07:56:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560264973; cv=pass; d=google.com; s=arc-20160816; b=xH6Gn6sYkoKo7VCV0jMbZ8zm5FO4AQxPpk4gPwkAC5u1FYncO4sFeEp1z+dUDqjOHP fz4/vj8zbfY7H6ewmFfRkgLuD1/PGPu7uz012zJ/USsFJVIdYT/306aePchEstSiqVtE 8TaCylp00KBm8N8+0rDCcKpP4fiPqh64zD0hWlxiiFa2RmkmGTLYxK+DW1Vr9rVlTq5s qVU8xtUpnDp68ALdtYJeKejgj5xeYAEGMJLhtmlQWl4/E1ZB9m8xz7BIcygLvuecACS+ NwpLvjUJ7UoEDsw2DHqiZ1qCVl2nQlUbjoROhbM+2hALnDqYU2miP5elncql/71Vs94E i5Gw== 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=B5xj+xOu/pC7F0TjjN6w6tJTgGGjFJdYa1SM6ZQm7pA=; b=ckU4EqD8gIX/DZyyoLnPgk6rAiJFqkQk0y0kT2j6RdB2p7LzN+w6O17i4hi+I1Q7+9 nQ42hNG2IEaWo8mzt/JPSsv0MghKIhcH2pPaL4ZdgC258zapXsHsseN3AQ0AylsDWaYn ckUhEVzMngzkslqiQ0BEkInkd2gKVd3mCHG5cN/RAEDI+L6X/InA8e4Cd1T5B1hQ6I8n LcnCMM5m5AQ9PxBnrLuzzVxNVbDprvO8C14kSRN832ZZqCeQHUcb3nkoilXpp3+iSg3/ gQJEzsRFc9SKn1kL9j9tfwDa5miQ4paczd1cR5BrPkS8a9hpg+OYfaVNDsXTO6zSnlRJ oDrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oZa0p48o; 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=B5xj+xOu/pC7F0TjjN6w6tJTgGGjFJdYa1SM6ZQm7pA=; b=T7LdECtpMiS3TPuull5TluwHVH6d5A2LQJz2fE+ohH5S1bBqzpQDSCsYYjP6snwfaL OXcP2STrihrHod9fWe1PXNV53WNYqIeDuEjv7DgR0m72lHTJLISuokBmfusZzKSIRV0U 9r1lH0psn66LAvwSSNMs/JGOSlZyx1m+XOGs4= 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=B5xj+xOu/pC7F0TjjN6w6tJTgGGjFJdYa1SM6ZQm7pA=; b=QobTOvwaut1xK24/JcvXt4VXqJrXU4ISf1pV5HhnUUCkHamIk+p50bJa9J0yeRCs6u 0nv8uchBerdgYfGSayPTALr4UXcii4VX4MT0PzMQBOTzmwuqa1mTDnQ+UlNkVatXLTE9 EGerk2qCBFtxPtuSuAryrZhar+DHxeGEYw1FdDmb5RW6TrnEx3xxVCwaZDife0khzmQS 8ZCxueefR79tc26TweGhEAqoiwU0g8HcJJcmwSL7yXKJVhlluOnayUo4FrZVCrCBJ7ZK qN+Ih2yhxCwJmp3gZGCkQLB+NVFvNqgBU4OFZMlsa6P/kTEPmzFY34slJo2dO349tjhH iKeg== X-Gm-Message-State: APjAAAVdugo+U1iNQcurlfec5e62xG2TXFSLdK/ZBloibd7MaWXVZfET Bx2U3XW0JQFbc8NWPULa1Y68Xb6m X-Google-Smtp-Source: APXvYqzXQ4O8btQLX9F0WUGyxwi0nk4LEeQ3fWtBLO8xlasuTU51X5WnzzqoirnUoIL2PHdDXc+ARA== X-Received: by 2002:a17:90a:22ea:: with SMTP id s97mr27061825pjc.39.1560264973743; Tue, 11 Jun 2019 07:56:13 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:2a57:: with SMTP id q84ls4513660pgq.15.gmail; Tue, 11 Jun 2019 07:56:13 -0700 (PDT) X-Received: by 2002:a62:5306:: with SMTP id h6mr81693936pfb.29.1560264973456; Tue, 11 Jun 2019 07:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560264973; cv=none; d=google.com; s=arc-20160816; b=QD8FZOm1cCbHkaWHHfYqxF9h9DSTWcoH/seX2oLDxPHXnDlmH//T1UNE5mgO6USfR9 trS5ZCNu03pxg3bvoy2uNxp2Ahg7880BgYqEuLNjOyb2kDOGGVDD2GgWZBaVui3dXRc4 UM5UBOWtD0DrYlkeRvqU2VA3owNnSSeD5v0yWt48EFqmqazRIdjqucXekVgGG7as3DWs FsOZxPtXh/BGIIMYcr7fuKYhCh3XoFD/jkWDulAK7YhVBs3nFh77r1E8s+0lWf4oR48C jZpXLaIrt6xy0G78SYVzeJZtpMINCPDzIDxhJFzJ7QE2MxBxMl/28nKup5gzy0ozFyyu izgg== 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=lHIlhtc4hn8aPvwui/UYtP3RQ7a5tpEUgL/90QN/WxU=; b=nnABBkFlRefaPLSTvA4iWTOrnnW8vC6xWCsMM4CRC2Dly4CQPTxiG9FD9ON22qeTDd YlC11A5E3L8Pn+mx23vmKrlxtbXBsLFw1PrZX5U4VyKTUEAFsOugCuVSS/zjk6E+yDwg zUNlrvWonhce8U5jcAwHuUw0RqylDWI5jZU5ChxE+DNCwZGI6vDIY5nPRHR1J0oiP1k1 Vm7MJTULDx2IuwiMtBPKWZ4p+RWI9Qp69uhAmAy5EYBLC4x6NxOvD+LMjIBRx/AOkCRN wDVHnoht8bzD21d6p2li9vWo98hEwFYQrRF3byzLV9Ir7l7LbZKBchPqEAYxBNSQP7mj RR/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=oZa0p48o; 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 k22sor13375936pfk.22.2019.06.11.07.56.13 for (Google Transport Security); Tue, 11 Jun 2019 07:56:13 -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:9f8b:: with SMTP id z11mr14189987pfr.121.1560264973127; Tue, 11 Jun 2019 07:56:13 -0700 (PDT) Received: from localhost.localdomain ([115.97.180.18]) by smtp.gmail.com with ESMTPSA id e9sm16206208pfn.154.2019.06.11.07.56.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jun 2019 07:56:12 -0700 (PDT) From: Jagan Teki To: Simon Glass , Philipp Tomsich , Kever Yang , YouMin Chen , u-boot@lists.denx.de Cc: gajjar04akash@gmail.com, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH 66/92] ram: rk3399: Configure PHY RX_CM_INPUT for lpddr4 Date: Tue, 11 Jun 2019 20:21:09 +0530 Message-Id: <20190611145135.21399-67-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=oZa0p48o; 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: , Configure PHY RX_CM_INPUT for lpddr4 during phy IO config. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen --- drivers/ram/rockchip/sdram_rk3399.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 78e249e164..13c552649c 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -39,6 +39,7 @@ #define PHY_BOOSTN_EN 0x1 #define PHY_SLEWP_EN 0x1 #define PHY_SLEWN_EN 0x1 +#define PHY_RX_CM_INPUT 0x1 #define CRU_SFTRST_DDR_CTRL(ch, n) ((0x1 << (8 + 16 + (ch) * 4)) | \ ((n) << (8 + (ch) * 4))) @@ -385,6 +386,27 @@ static int phy_io_config(const struct chan_info *chan, /* PHY_939 PHY_PAD_CS_DRIVE */ clrsetbits_le32(&denali_phy[939], 0x3 << 17, speed << 17); + if (sdram_params->base.dramtype == LPDDR4) { + /* RX_CM_INPUT */ + reg_value = PHY_RX_CM_INPUT; + /* PHY_924 PHY_PAD_FDBK_DRIVE */ + clrsetbits_le32(&denali_phy[924], 0x1 << 14, reg_value << 14); + /* PHY_926 PHY_PAD_DATA_DRIVE */ + clrsetbits_le32(&denali_phy[926], 0x1 << 11, reg_value << 11); + /* PHY_927 PHY_PAD_DQS_DRIVE */ + clrsetbits_le32(&denali_phy[927], 0x1 << 13, reg_value << 13); + /* PHY_928 PHY_PAD_ADDR_DRIVE */ + clrsetbits_le32(&denali_phy[928], 0x1 << 19, reg_value << 19); + /* PHY_929 PHY_PAD_CLK_DRIVE */ + clrsetbits_le32(&denali_phy[929], 0x1 << 21, reg_value << 21); + /* PHY_935 PHY_PAD_CKE_DRIVE */ + clrsetbits_le32(&denali_phy[935], 0x1 << 19, reg_value << 19); + /* PHY_937 PHY_PAD_RST_DRIVE */ + clrsetbits_le32(&denali_phy[937], 0x1 << 19, reg_value << 19); + /* PHY_939 PHY_PAD_CS_DRIVE */ + clrsetbits_le32(&denali_phy[939], 0x1 << 19, reg_value << 19); + } + return 0; }