From patchwork Mon Jul 15 18:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 736 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 9D4993F08F for ; Mon, 15 Jul 2019 20:29:31 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id m17sf2046822pgh.21 for ; Mon, 15 Jul 2019 11:29:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563215370; cv=pass; d=google.com; s=arc-20160816; b=cuOD0ffrScQ8DOD6zXTeVbya2ZRo+nAwDwANe38MFPTJ2q1B9NjUzkbsl/lumRJ15G R1xh1XBGnDKgWDgOODPpjXjDzHTUUUfC47dvc/vat3non3j0Ll2abhc5mxoqpnpZJSD2 be3TdbboL1obtSllM94NuXlNu/PkVfFJI4nsdevRo4DU7IsOZxQcdwFlOUGvYG0UNcXC tVOIRzlbOYppB51X1CU3FWt6d9idu6l/nVQzYfVCBbLVg8H0P0PPVs5xf7SW+DDj+jcc aEiwJDe8L4AFXEP742uU+OfMwKnK/ICIl84MgDhIndPQ5RbxAsbiuZ23DEdaMcJ8FDBC WX3A== 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=Dl0U0X46iW06eiphOJJZQ9UZp7aOKJyW1Qkede2/aF4=; b=Z+x8Ijic32GCFgLBH7S0TxkSB9QSO7Et9uTwEAKeZF1z0hDmZ8hn6/P1k/ydAg3puW dMKmWEWCNpIo4a6txKhPtwumlQi6OlrqttGCjkY7Np26mRBrJP4FnOyTjwBgE2aTVnSY zJ3t424/u/eU/BCkGSQ3h05yTVdDzEFzfIDIq31RPWr8Hv6/lVs1GKetCRs5dsqeAy2d QIXgrKM/wIYt5YXrVg3PhYkjjYtCXaJrxiCVwFmMEtGcl3/uoKxI9/CdU7dx48Pak4QA oR1NkmnLX6IWmUFutmPJEVNLUAbSnlySD/aOnLbttPM1itaG7mcx2rY4+g5GlKApHdeB XA2A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="J1G/MjaF"; 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=Dl0U0X46iW06eiphOJJZQ9UZp7aOKJyW1Qkede2/aF4=; b=eYJHl3/+3qaX1nO7Fzd4Vk20ZS98HlM3WbeaTZqqzFp930g4w8xIpOcwFBF8xBooh1 ocH6hG9achO53EXOjGokpnJgG6DyM6OoCkmN+NCp6LcfgzEM6p+3z83E6KEspF4j6bSZ gVGv2a4N1KgVLW6I+OWY3uSrGp+2RCiULoVOw= 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=Dl0U0X46iW06eiphOJJZQ9UZp7aOKJyW1Qkede2/aF4=; b=ExvlbyS+p8cZTtVjQhgzRZJffhFWJNXY70j0qteYesuPprx1/mJIWXDvq7mPgiR1mj oTC/QF4fDXpX8xNLM0h6ceVSwF/9FBvabAjDKYCCHcYyJehhzUwzqZvr0SRSQN+d4YUK RjGSS4TBAlbrM7TDY2fJhCHS8GbHPeHGbIHJ4DrUais3URFlM05i9s0Uuoev7VK7ZD+E NlnZhgIQi+0QSuiohXaTLEG4V/y0QRaIg4fXdVca7atuodTUHv3SduJVWGSP9M81epKe 6vzvA6dBQ947HPQgAdX3LDY/Js4RenYzL0Gdeb5567kuJJiq3N9XFwEHta62rsPCmEw6 GpEA== X-Gm-Message-State: APjAAAUjJZY/Sk43a75NWinzxsKP+L7ygSQ3EjH+bkYOirynht/VDlBx V/dDCEbleLbmgDWhS4+Nps8w61+R X-Google-Smtp-Source: APXvYqwVWV6doulkY32iD/qLTSjmWp18VSg4K0DQ0vCkQ6ztZ8DoRk3UqY+qaIT20Z+Y86aklv/J1w== X-Received: by 2002:a17:902:be15:: with SMTP id r21mr29253464pls.293.1563215370479; Mon, 15 Jul 2019 11:29:30 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:52d2:: with SMTP id g201ls3003384pfb.9.gmail; Mon, 15 Jul 2019 11:29:30 -0700 (PDT) X-Received: by 2002:a63:3fc9:: with SMTP id m192mr28935913pga.429.1563215370035; Mon, 15 Jul 2019 11:29:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563215370; cv=none; d=google.com; s=arc-20160816; b=UgXm3ZIx1jYSraf+AdrXFu7Ha4zq0q5CA7XoHrOsLG7JVT7Cr3uUYNdY6orHHEMJIu YZO32FpMC8JBX8IYuRAVbTf6Isr70oOXwzBs6h2+QBPcn3KdoMg/pCsIMlcHeRyLcAlc zitnRuk7bEETTh6ViaxsilY/lkVkmw9xwSFEMKtbAUVvHJqyzxiYJIRKRQyqp/p7jN8Z 7MgGgCYc6u6d1UJDS7inmyojMT0GvZqFetGpyrsWpqWLxWxyxOW9tg6NPrthnnhV+RUj oQn5Fep6oV4LlH1Bol8eFLl51YD306quJanvfiXU3mFv6cTcP9IAf/39+791+o9AOcuk tZGQ== 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=Rl7swlURdE/LDJNQb1LtixpuiUQXln+fnRJTxC/bfZU=; b=AEpRen5Yk5wVXF05XUK00HCb4uR4ClDSdJs8/pk5ykpL8ebxdhkkVghhek4bbRjkFW NorQF9u2Guu4ONQrrdlssEYx5sqgx5j6r1vo7pIxLjRYk7LovgKpHb43Um73tjwLces8 bbdvB+90uHtfsFrgQoa2lj+UTT26V6tL5+057FT0exFacQ6KMse1zPcI2LpZNFbUDe/R DBU8HGJfhCtu3aBO83gAda7ZsFUqt0OzA4YPiD8Y2oCihl5uX0OtBIvnlTHSyuH7EWfH LUeWP7kN6hic2ygZFNoaOQQO7sHUQeBz2BuNCM5SD9l4sA9w8GoINofBPDyrXXXQcHI0 FoHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b="J1G/MjaF"; 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 q10sor21648645pls.59.2019.07.15.11.29.30 for (Google Transport Security); Mon, 15 Jul 2019 11:29:30 -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:2868:: with SMTP id e95mr27967021plb.319.1563215369738; Mon, 15 Jul 2019 11:29:29 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id y133sm20250075pfb.28.2019.07.15.11.29.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jul 2019 11:29:29 -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 06/18] ram: rk3399: Move pwrup_srefresh_exit to dram_info Date: Mon, 15 Jul 2019 23:58:44 +0530 Message-Id: <20190715182856.21688-7-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190715182856.21688-1-jagan@amarulasolutions.com> References: <20190715182856.21688-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="J1G/MjaF"; 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: , Add pwrup_srefresh_exit to be part of dram_info so-that the it can help to support pwrup_srefresh_exit in individual channels while starting pctl in future. No functionality change. Signed-off-by: Jagan Teki Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index a5da985e1a..6e944cafd9 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -49,6 +49,7 @@ struct chan_info { struct dram_info { #if defined(CONFIG_TPL_BUILD) || \ (!defined(CONFIG_TPL) && defined(CONFIG_SPL_BUILD)) + u32 pwrup_srefresh_exit; struct chan_info chan[2]; struct clk ddr_clk; struct rk3399_cru *cru; @@ -487,8 +488,8 @@ static int phy_io_config(const struct chan_info *chan, return 0; } -static int pctl_cfg(const struct chan_info *chan, u32 channel, - const struct rk3399_sdram_params *params) +static int pctl_cfg(struct dram_info *dram, const struct chan_info *chan, + u32 channel, const struct rk3399_sdram_params *params) { u32 *denali_ctl = chan->pctl->denali_ctl; u32 *denali_pi = chan->pi->denali_pi; @@ -496,7 +497,6 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, const u32 *params_ctl = params->pctl_regs.denali_ctl; const u32 *params_phy = params->phy_regs.denali_phy; u32 tmp, tmp1, tmp2; - u32 pwrup_srefresh_exit; int ret; const ulong timeout_ms = 200; @@ -518,7 +518,8 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, writel(params->phy_regs.denali_phy[911], &denali_phy[911]); writel(params->phy_regs.denali_phy[912], &denali_phy[912]); - pwrup_srefresh_exit = readl(&denali_ctl[68]) & PWRUP_SREFRESH_EXIT; + dram->pwrup_srefresh_exit = readl(&denali_ctl[68]) & + PWRUP_SREFRESH_EXIT; clrbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT); /* PHY_DLL_RST_EN */ @@ -594,7 +595,7 @@ static int pctl_cfg(const struct chan_info *chan, u32 channel, debug("DRAM (%s): phy locked after %ld ms\n", __func__, get_timer(tmp)); clrsetbits_le32(&denali_ctl[68], PWRUP_SREFRESH_EXIT, - pwrup_srefresh_exit); + dram->pwrup_srefresh_exit); return 0; } @@ -1179,7 +1180,7 @@ static int sdram_init(struct dram_info *dram, if (channel >= params->base.num_channels) continue; - ret = pctl_cfg(chan, channel, params); + ret = pctl_cfg(dram, chan, channel, params); if (ret < 0) { printf("%s: pctl config failed\n", __func__); return ret;