From patchwork Tue Jul 16 11:57:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 778 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5D23C3F08F for ; Tue, 16 Jul 2019 13:59:41 +0200 (CEST) Received: by mail-pf1-f197.google.com with SMTP id x10sf12224090pfa.23 for ; Tue, 16 Jul 2019 04:59:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278380; cv=pass; d=google.com; s=arc-20160816; b=EAjk+PuFvo9KmseQ36NcNacMGhPgPhf4u4TFAR/SzdDe7g5Q+aUb40FZ7e+Q4uqTmg Zx9Kx4ZjDHauY/q0oGKv+35mAkNxSftVOZ2qEGUoHvTVAcBQqtmQI668qJ/ShePkiPeb f/9F26AJ2BtZ2i7lP8VATEooENvkz1Rp0e+o9C9UtN6mZ26BQRHGaVkCmUUNpI8hDELz Qa7uXD1Vupi0BlF07Uwr832y6/mpKS6JHBpnSZa3hGZxPJu+uY4RiqViL6rF74sddU1n q8cIAv+g6eQ69pg7owasi7Cijs6W2L1TWAUqqjucAHKWx/S5sb+4Bo60N8kWQlKrvh/E jPiw== 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=/0WHYrOvNPom82yif4YUtVg0eK8LadM8nqNfKHagPLs=; b=gHmhJncuMBCM/Q5Q0D9aNY+M9d0/We+eqdyGI+RKkdFFPKLZi5gyn22jx4MEfoN1qb KjGFtseL8yGXwEUjJ43542UrQs/ErnpwihxLfna0LY+ls4xljXcm0SdDbO/bHkN/39L3 ZbeKcdIC619yQRjLSXb5b3NO6KRiRYZ37asT1YA0cGGSwr6KO3vtAMQr3bPgLdwxJN51 T30tjlhJMn4EA6nwnuwozT5SPgPMiwiInHuhW7VOW23jV1rEaKUp5/Zz2cDPgftTBN8T 5uRgBvhWGII/QJNBTl/Z5473s+if8tFZXreaS2buSYxSOIJ8GdYXkNBJmUz35GeYStBA 0fTQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Itj3aDGO; 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=/0WHYrOvNPom82yif4YUtVg0eK8LadM8nqNfKHagPLs=; b=auACvZvrlAfBZCG5XoQVfW8Atbcs2zzuKSUitiBwXUan2IqTlnkUslnfKzhovg8SIw 8H2rG6vcGkT8xPx0/t5q3Q4qVIX7uRQSa4tfb19e9FAKNCMK+9Sgjdqx2pDlr2rIJKt6 /NgxXRS/Mzadc95vjC4CU9IX2mmUMyDLhyWJ8= 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=/0WHYrOvNPom82yif4YUtVg0eK8LadM8nqNfKHagPLs=; b=JOASExDvjh2UpAjRmw66AUXFNcXsWyoCPj05BXsmFeQVPBbniTqPDopeBIHgWPrRb+ lsG/rri3UK+poHXXmNtBnR2j148O/C5qyVb/vYqlmpY3bXzlZOZT3s1JX406fWNGlpye V5ybfG5FjaGnDIRshHKEbQL7gcAfoxjo44OBL/O9SaIg/+l85PSniFmGXlfDkld9F6NO uPPfqyGNVVFryotRxOt5WtvGccUvXAFHVEIslvqwmD9SHDFuiFohzQOrC9kcEuGeK3a3 LTyL1UnBDKVW7lu8ewPZPgT2/IlJKy6ruC0P/SynPm44C8itauJemCzXbpZ6jZePuLG+ RDtw== X-Gm-Message-State: APjAAAVWCRsjiu8VVyRJy/6RIqqCJeJnn7UqqaTDxVUhdZJgCrxbofvC GbQIxZf2kvFBCmRkHABloSRdWfTr X-Google-Smtp-Source: APXvYqzwu46w8ODI7U6ePwOI3SxzpcOWKoZNNRHDKoZUwi0GbHNET68aUUb+O+H3+M4ZfXlub3aEpA== X-Received: by 2002:a17:90a:b387:: with SMTP id e7mr36871099pjr.113.1563278380148; Tue, 16 Jul 2019 04:59:40 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:740a:: with SMTP id g10ls5467126pll.0.gmail; Tue, 16 Jul 2019 04:59:39 -0700 (PDT) X-Received: by 2002:a17:902:e58b:: with SMTP id cl11mr33951466plb.24.1563278379841; Tue, 16 Jul 2019 04:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278379; cv=none; d=google.com; s=arc-20160816; b=UHLwMgR9RuoO/38qIlsHpmdc8JvqDmb1IudiqnnHBrbtjCzPeQxpchSl73QNyK9KFK pSdi0ANfkF14okUadFgD8MLK5Zsc7bShd5gZ863PzeGW/5fRUd7yB5ek7y0/7ol2FfMn sIrhCZREAmT+zsA2IAdHe+QTkVsQLqD/m+5Ec5S0Oh7H+xs5qXRLDRnHyXVqSCSC89Jq oAq9dUVuZhnGfr/o28Rao46cRawHoKg3whY+vAI/kdpmYazg0qMezWv7fUqhiwbgFfTS XExoeACgFfmYhHY1UL/IV1AOOQmIpnKjyx7jnNvwU1o/hHEu+r1TvyEozvQrv1R2i/Dp SocA== 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=RoiJzXN2kGueDRn1Z7nVcE+ruU+rxsmtLatjH9HI/xo=; b=AhZDgIwx43Qfww7K8HVDMdvjNWmMJut2lwEfFENpVVfIZPxXs5gxqkmZKAkf7Vyn15 Tf2pEZmS7UfoGj63eAK9INkoj4Q8qpF1cYkOEqYWwefxH59uLVZVyxAlRWD9o6SfvYGn kP3/uN45rqEym17azMOdZvi5NeZfrnpgvzqe2RqLuVfDHPD2ifLBPE25d7VDtwKSS1cu O67hFkl1cMONK7H1EuiB4HsxJUnz4IVDWTju/8zfxBZAk0XrMY6tCzYGrkHyALMFUBCX uUQTbvdCrE1WW8PhB9R1q+3cp9r8HyiEfWTowZPGwtK5nduR+dgJ6R+NXTN/ejF7oR6j yjaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Itj3aDGO; 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 196sor10345226pgg.26.2019.07.16.04.59.39 for (Google Transport Security); Tue, 16 Jul 2019 04:59:39 -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:a63:2606:: with SMTP id m6mr32924627pgm.436.1563278379515; Tue, 16 Jul 2019 04:59:39 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:39 -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 29/57] ram: rk3399: Configure PHY RX_CM_INPUT for lpddr4 Date: Tue, 16 Jul 2019 17:27:17 +0530 Message-Id: <20190716115745.12585-30-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=Itj3aDGO; 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 Reviewed-by: Kever Yang --- 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 c02f936f2a..2ab10da53f 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))) @@ -384,6 +385,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 (IS_ENABLED(CONFIG_RAM_RK3399_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; }