From patchwork Tue Jul 16 11:57:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 776 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 063A13F08F for ; Tue, 16 Jul 2019 13:59:34 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id 30sf12479494pgk.16 for ; Tue, 16 Jul 2019 04:59:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278372; cv=pass; d=google.com; s=arc-20160816; b=mWV8/B7RGCup5JujWq2GGbUoO0aiyY4TQYwDFQ95ZF8MuD7+ILyM140++m+GCP+pm9 5ZrR7/KhSNi55EFEI4W0B7KI8CLQvBB7U3R5gxeAhpPUvSYdBsAL19mFi8LP+FQbqRTt JwxzGymDNCWVubiczo7JItF7IIif/GFWrdvIWHZEI0jA33Qh9pka/wQzBk4ehv+PP7Vd xBsHwOBZpIUkna+N86Bb0RuCA+BQT3fK0iunFStofpAhRD40wWUXdupJqJyqoqV7mecl k4pLQNujb/TR8UtSMCm/2M5LPDmtvtUAGt1ZYu2SgrqGKFqiTBSVASYYYJMkl+rE5E38 fXFw== 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=8dit06MLkVsRKgKg2kiSs+NSoas1cap81DcQzcwlU6Y=; b=Ab+/OYa0JWerux242WTJlmhLLvy5y4aeaSpDU0noEocOxdGFi0ho7q6R2kU6VdKUum ctw9oXYrJOKFz9hvJkDnblXDlhHalc1/cb4DJ+V4W3vtCZC0P3WK5RmOx58FbppLwn0E Mif/3zZ9jXlksRQAeK7s31V+y3tgMnjE3/XU5meTCGSG4Lm/tsBJjLBQdhCQyp5M+xT8 KkaSzzCxBjdkp4IZq/pkzQh+zrfLzsXt8OnMCg5sJ30wjytFUCG0LiUcVAQfsJGUKIDe JJKSI8PwV0nigSquUXHVr3WDf7s/YPAZwS9FZMt9jGHAiURVO8gzFL0fHcTMY5gC+4El YIeg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=phtH2Y5z; 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=8dit06MLkVsRKgKg2kiSs+NSoas1cap81DcQzcwlU6Y=; b=MZS8SVmCe9s0m6QQGMiep33c/NnC2hvtpuRJu5KeWH3ztnL+lA0Fonk5aLR3j5feWn F9Hchf0pBSvcX5lF3SmxT7ErFEMoy9BE8jYhGYjrNDI9/Xk/x5+ojpmdMSWMk85GYZnO 4aqyZmjIy+J5P7zqauiVV+87mRBdn/b4CqzBA= 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=8dit06MLkVsRKgKg2kiSs+NSoas1cap81DcQzcwlU6Y=; b=lfvb3jtF08XG2LaR74tEJwMO1W5r3zZldCRxI0q/okq3Mf1Rt82lRZHZWeb8R9tROT HDvs7J+chTFP3SZ21X9jcVk6rGf9Gj1JaA3+U1RTp+Q7cDmnAOsnZ4XEmHY1vXWPVPE4 GedMjoO5Y4SZTd/xiavoOH9QUASbcxYnckK6OI5jfvpPc5RTyzqcc7f8lTqQ0bYU46dg 0TcFvgd+iDGlyk9pJIVNikDcmBJDJ+xr3aMDCUU1AcL6kqlbbJPxh99Hzt0M9/6K9C5d N6WwXPgdxdbXSM/SHbEqmifzriMJ81+pibxpPafTu7Xhl0C/l2DZy0XR/msZNfR8EljE VT1A== X-Gm-Message-State: APjAAAUGyC1BJoqX/m2P6z1EhASENPXwTj2S2OUR0KAAD8makUOBtt7o XnNOE5m6p2uEyKvNMqsXcPOaWsMO X-Google-Smtp-Source: APXvYqzP7g2qY9fff4tH8oyfLJ4uhoSY8rG2Mto3CtRIufaUlWMHKOb4ZAwvoOB7uTkxriKwxCqq1A== X-Received: by 2002:a17:90a:19d:: with SMTP id 29mr36443033pjc.71.1563278372875; Tue, 16 Jul 2019 04:59:32 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:9684:: with SMTP id n4ls5474546plp.2.gmail; Tue, 16 Jul 2019 04:59:32 -0700 (PDT) X-Received: by 2002:a17:90a:3225:: with SMTP id k34mr35244428pjb.31.1563278372617; Tue, 16 Jul 2019 04:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278372; cv=none; d=google.com; s=arc-20160816; b=WpEE+XyOC/bCjRymoj7y6MukVnG8z3+Du+0EXOapjMSAEt8gzxDLkHdzdzutDZKAnv boJsmExZ0DCnC0oFHPAhsnv6erfDS6mh3eKaOz+HJzKLB/noTMenqxysn1TT2u77u2wo 94RLNfahKMOgY/IH1mYyP+cWDvnaKK/Z5uSGRhRQRgsXGj78OGndtQyK3JvpjBqqWbwb iy5m2MP2aO1f+vD7gFiSKJDlOmal9ETYJMOLPEpZY0ih/b9WGof9/1W6iM9/fd3TMRuh zf1KazLxhrmrww/DN2/9MXHN0AaZD1dh9JCjLtIXI+6mHlJKg0IBeuSJZZAiSxCVO/Bq 0quw== 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=ZHqXR/rfvXNWUhdf9JppdKSegbEAyVwI+s7vLkLDNcY=; b=SqntUptCpgcGC1q6fBF4M/3Sur5pGWxoowofQTf1cWMw5jlCueSyWI3/shoJ598aDM PcjKdx90vS1MxMOgkfkiRjox4jDguxZtB4YCqGBSaD1vCt61SEqvVZTGN8iBrntEisY+ yTo4r+6oYO4H2Sq+YfmtgcqINq9wdKKqOD5tcNV81bM3fFRiVVP2RSd/d2fyoNS88PSF JZIXumQlJfigH3P7Fe9M01oDfFuVI7zTTAu/PXWrebLyczlOg4ESE9O8a9Sx5XmhJKBC Lzz0rmpqCW0b4SFGSiRFrSbGfiNt3swvPLro9bV6E27TPKik0U6Bj0K3XPDjh52H6MW6 v+rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=phtH2Y5z; 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 x18sor10336829pgh.47.2019.07.16.04.59.32 for (Google Transport Security); Tue, 16 Jul 2019 04:59:32 -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:a65:500a:: with SMTP id f10mr2100018pgo.105.1563278372279; Tue, 16 Jul 2019 04:59:32 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:31 -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 27/57] ram: rk3399: Configure BOOSTP_EN, BOOSTN_EN for lpddr4 Date: Tue, 16 Jul 2019 17:27:15 +0530 Message-Id: <20190716115745.12585-28-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=phtH2Y5z; 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 BOOSTP_EN, BOOSTN_EN 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 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 7625506458..a9e092c39f 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -35,6 +35,9 @@ #define PHY_DRV_ODT_40 0xe #define PHY_DRV_ODT_34_3 0xf +#define PHY_BOOSTP_EN 0x1 +#define PHY_BOOSTN_EN 0x1 + #define CRU_SFTRST_DDR_CTRL(ch, n) ((0x1 << (8 + 16 + (ch) * 4)) | \ ((n) << (8 + (ch) * 4))) #define CRU_SFTRST_DDR_PHY(ch, n) ((0x1 << (9 + 16 + (ch) * 4)) | \ @@ -312,6 +315,27 @@ static int phy_io_config(const struct chan_info *chan, /* PHY_939 PHY_PAD_CS_DRIVE */ clrsetbits_le32(&denali_phy[939], 0x7 << 14, mode_sel << 14); + if (IS_ENABLED(CONFIG_RAM_RK3399_LPDDR4)) { + /* BOOSTP_EN & BOOSTN_EN */ + reg_value = ((PHY_BOOSTP_EN << 4) | PHY_BOOSTN_EN); + /* PHY_925 PHY_PAD_FDBK_DRIVE2 */ + clrsetbits_le32(&denali_phy[925], 0xff << 8, reg_value << 8); + /* PHY_926 PHY_PAD_DATA_DRIVE */ + clrsetbits_le32(&denali_phy[926], 0xff << 12, reg_value << 12); + /* PHY_927 PHY_PAD_DQS_DRIVE */ + clrsetbits_le32(&denali_phy[927], 0xff << 14, reg_value << 14); + /* PHY_928 PHY_PAD_ADDR_DRIVE */ + clrsetbits_le32(&denali_phy[928], 0xff << 20, reg_value << 20); + /* PHY_929 PHY_PAD_CLK_DRIVE */ + clrsetbits_le32(&denali_phy[929], 0xff << 22, reg_value << 22); + /* PHY_935 PHY_PAD_CKE_DRIVE */ + clrsetbits_le32(&denali_phy[935], 0xff << 20, reg_value << 20); + /* PHY_937 PHY_PAD_RST_DRIVE */ + clrsetbits_le32(&denali_phy[937], 0xff << 20, reg_value << 20); + /* PHY_939 PHY_PAD_CS_DRIVE */ + clrsetbits_le32(&denali_phy[939], 0xff << 20, reg_value << 20); + } + /* speed setting */ if (params->base.ddr_freq < 400) speed = 0x0;