From patchwork Mon Jun 17 07:31:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 607 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 643623F353 for ; Mon, 17 Jun 2019 09:38:23 +0200 (CEST) Received: by mail-pg1-f200.google.com with SMTP id y187sf7226256pgd.1 for ; Mon, 17 Jun 2019 00:38:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1560757102; cv=pass; d=google.com; s=arc-20160816; b=OqLh+yqrNaWRMV+o3ixzs55xrVf4ih+Hl2hmgi3Xyn9Y7CUdW4jCvOkTqnVvesmJ+j qet62m28MbqFadqGpKvdLdvUlhikg9IXccufYhbrww9ZNuW3Kbnv/dK9/74yY/x0B0Nw 6rkjv1Z7vq3DVvcSsC0gjXGoae58RychIww6kmduNrqEcqjAAmrlQh+OsWldj2TCbjcX 5s7jsSj2+B85FdrtH8tSKoR4AeIaGnslpWW/wSJnU6tLbgQp55/789ohhXiXOdXVJ+CU rv+G6YTYJbIawCGFYe4YNDWyE6zRskZjZKyHu0v9yt71ENNTnBE/4+00uy+taohl8HTT bWRg== 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=ymvHvlTWTp1Rxj9Ut0ki4a4dlqhKseIuMJfGa2Nf/O0=; b=pX4NJqjwUTLxiWkSpeI/tKozWTkpkLUSKMNiTyIhIQtYVN6SEBjg4JSSkgZcL9/ucq QZ0Krp9TLz4jOjiCB8mlFHsr+lrXptu5WfgV0qTta3SwUySgIJZ/ySA03Ijo/weMC3Zy zjkmvfyRnaSZuekjtRc/lzD/UfsRMmGM5kIiiQIC5JBAt2XxhcWWFCAGHuiitQH91X0B YziOSWdmjjmg1+lDpNgZW6eg8ddUx1KVUNnTE7I70Lget92ep97dMd5OlrIwBTzM+YDL 3EYbbmFYQiNCy1+jQZ7MsCFZqR8GpOizplknU6ZvD+516M7nMwtecJ8BVZwEsEzOIvkm fzkg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mgbiDNES; 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=ymvHvlTWTp1Rxj9Ut0ki4a4dlqhKseIuMJfGa2Nf/O0=; b=dQCPFqNY0iUcN+Utds6IA6kdJtvsA1wJdJHSMnh/rT54HodZ7Jwgq8aahkc3Sh3Xe+ fApjYoMnuWjUNsRkIlyGMv/pf6R5uI1eapWOKiwbpLisK/eLoG8JzpIiBrAR1B82ibqm UyaBU+KIkhLIC15MIW+ipUzcTOAAazNXWK6zQ= 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=ymvHvlTWTp1Rxj9Ut0ki4a4dlqhKseIuMJfGa2Nf/O0=; b=gq1BHjlmDmaUbZArUxZdQgU5gNrCi7fXXoQhBqp7bUHtYPllv0uC8tNG9uJ96Mn/3M g+ICsECF70r9ZczZTNEpvfceG+Qn+s0jnytPOrNUj4cHpJ0oSTlhG5dptuxqGBneYW3m +PZphckSJwEqH4GVE8evAhYhsPX191QqrCw2C7Zz4aJhBcf1BhUxvacyEfya++C5jyaD buinf//jm3O4nIssK90vDrHm4NIeSTRv0f5isBNtsyBnlU2ni7c8rEtyt4GQ0usN55gg 3QuHH/RjUG2KVIgDDFMouQ5lD3h/3bQ/A/WJXQOAnDb3QbS0DT+KoluOuC8QEOPIkRw3 M2ow== X-Gm-Message-State: APjAAAU+DzpQ/uHjK+jX1aNXKGngkIepgSlHmboxRKsCrUHDGah9Mde7 GYYqGy9BvZeMhcdEWs1nBTHaydjM X-Google-Smtp-Source: APXvYqxcrX0Zqb6y1fj+GHAnH+y+QDwZ8lZmXky19P2WxjvpY4wAp04w6Hvdr1jSB40+i9lL9SW9SQ== X-Received: by 2002:a17:902:704c:: with SMTP id h12mr13756588plt.343.1560757102225; Mon, 17 Jun 2019 00:38:22 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8609:: with SMTP id f9ls3748354plo.7.gmail; Mon, 17 Jun 2019 00:38:21 -0700 (PDT) X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr24710991pjq.64.1560757101826; Mon, 17 Jun 2019 00:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560757101; cv=none; d=google.com; s=arc-20160816; b=uCpKohCOYl40wbl+Vd3W2QCR0Is8RgexbqZtBKJTMZyWSzX/1utinsQcv2eIEZKjdI 4yl2DP9xP+vxlZ6qaVRQdKI+CXpdg3Rauotg789n6KvI8QqYip2YC/kEJk61KvL+wMcC 0gv46C70Ux6KPT6qJX9j5ABV7tZjq0qHMOhFOEKSzZNQRm1mQEB2w1ts8sYOfO+sWUim H73D0aj/Awsjml4U88QNzdpbTXUusQNTdpMkSe8RKGCJBkU6DRzC7TIWq6s/Tk4njXoX k0YOZ9QYOCi21TFh9R7/T1FNBUV2aZh4Nxe+QTejGT2DQE+048oDzJ50aLQUHqnhTjZD WG/Q== 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=qo6cHVT+365TgXOCO2NVSQCfWb+COdvyYs5is315K0I=; b=w2in1kkSut9CpxrnQtIZIYa7a/ZKPt9Z7cE1B6Dh17RgiVWbo30ukCkIOLkOPOpfCd BSn25KP9ea0TkYWwpnpddeu1UQLDLNUlBHFwPW03DCO2jAs8z4pwuZHcwbTwQ/BfUq/K 9GV7jt2MtIEwNwXwf+EOiVLR0uKSE/73/A6+d1gglGTYA23QLbP32nFELE+thwHdYCZP grWJK8O5nOeoqi7XAc6SkZzY9WC9ER+2O4qW29tbjSJWTbExQdtK3qjfmvy7TZwx4/4J 4oRRQ+ZtzpEy23hFluP9pw/bZ7LD1O9HeNvl71tCB0/iyw3LzIxrD5xREYRbmPtjmm+E 4Jmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=mgbiDNES; 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 b13sor12634021pjo.14.2019.06.17.00.38.21 for (Google Transport Security); Mon, 17 Jun 2019 00:38:21 -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:90a:cb97:: with SMTP id a23mr24247552pju.67.1560757101530; Mon, 17 Jun 2019 00:38:21 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.245]) by smtp.gmail.com with ESMTPSA id m41sm15205998pje.18.2019.06.17.00.38.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jun 2019 00:38:21 -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 v2 36/99] ram: rk3399: Move pwrup_srefresh_exit to dram_info Date: Mon, 17 Jun 2019 13:01:49 +0530 Message-Id: <20190617073252.27810-37-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20190617073252.27810-1-jagan@amarulasolutions.com> References: <20190617073252.27810-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=mgbiDNES; 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 --- 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 313a177417..1362a5bf2d 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; @@ -486,8 +487,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; @@ -495,7 +496,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; @@ -515,7 +515,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 */ @@ -591,7 +592,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; } @@ -1175,7 +1176,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;