From patchwork Tue Jul 16 11:57:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 774 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 C29C33F08F for ; Tue, 16 Jul 2019 13:59:26 +0200 (CEST) Received: by mail-pg1-f198.google.com with SMTP id x19sf12507324pgx.1 for ; Tue, 16 Jul 2019 04:59:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1563278365; cv=pass; d=google.com; s=arc-20160816; b=RDK1l6JZmp8YqlGc6PBVhyY//FTlRF3b8tDECJNSGUxtkLACrFyUkshXSy/XPjJTOK 7DaIkUPa4ILlCrPk9PGQhJFmPMlpkYKt+m5vuI1JQSNfJTAm5Rpo6pN8nD49h/yTKjel cLc8F7+xI2o0qHt5ZS5LG19rWzQDSu6V9/Xh6Sc1tnXhtaAbeutGG4SM9U0k66DWMS03 yS8Os+EHuBEZkY2Rqxj3E0fAjCUriBa3UJFqdj4NJ3h+huUkwRRUDflv/TEi8AeRLYxL uB0IjM1GpdQJ7rXRgEWAI9dOcDvNQkSJPFv+CFfSdRO5XsBNvB9zSKa5k+DwsSpg1rYA TB/w== 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=dJnqJCgfaLixGC0xWqtu4uSdJPBFd1shXOEOGwgrnew=; b=SyRhFN8Ly7PZ75Ecy3uU5jIv0jgCrDGbmkP13AaSOndLtCb/9ahljWXzcnm/XOkU41 R4e1U5+dCtd59n30dUj4KdnHrySpNjtXMujqGVeoy3QJUuGLa85Y4g+VO9Ti2vyEKzB6 PiWli+DbjVvhsDopUqr3bZgXqLp4GqkP0C6P0c6K/W3R0edEoi0n1xNJTuX//lBjV15R FT4cBsu/ZqBpVsDGT8/xO48IEvB96t6lotHstdv2JBrF1j+CfcFsYQtYuR7MUJcowT4o 1V/vGv8lCBAuxT1U0bSA4tpTmoheq7NJFbx8M5gWWGzHMmOnmTuf/soKb+VkOzDkf5hv OOTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=A0wocJqo; 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=dJnqJCgfaLixGC0xWqtu4uSdJPBFd1shXOEOGwgrnew=; b=UuhIcqSnsjqmXwexSlIIcV2iTk2bzJg2LbR5hWkrUazyNGMDc7MuRfuNxjExJRPJzj G1Fv1C1Jq6rKSJsoLrqG6Fv47JUDwY0s9XzNG9ICyQqdhJ4+BU9Jl0f+Cq297q324azr X4LNdn5t8EzuI53CTIvcOUwhdgVixdsHXfxpA= 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=dJnqJCgfaLixGC0xWqtu4uSdJPBFd1shXOEOGwgrnew=; b=TT82nWCEf+QfZiNG2u+bBFnG4mNgauWpkYnGgDcO19YjmfIQHvLsVfEQl/hUUBK9T0 weSPtOA5CvEo1PeKPjM9cX6TH3Rhnz70m3WPAft04H9uEjJPkB7GbQQC+bwar/hcqqnw tfoWpWFjxhvXLp/wvOTqIav+Bu8tWO4GUJNBdMMnt2mM6tDhoV2PhmPyPaoITGp7xu6J 0fyg4xgWGd7hvM2xbh7+9cXhgrh3mWWWFggMFsUmIIu+QgRlRQp+a6RUb6sNheVm5apk QMzNM4nlLjVBMDtZbedQ6a+kNdps6Tpn9/gwF2IRQo/CeF93EZLGx62luF9RNNyCBXzW Uc/A== X-Gm-Message-State: APjAAAUJ8oaHjc2zmnm9AO5R//w09AE/0oilDQVFWPf9UWvrbgTUH0jB BXGcBR9Bxal2JJduiRkR0BkqNk5E X-Google-Smtp-Source: APXvYqxaM9IhIQqzBFpp9ql3oRb3p2wc6ueGHkPf/xa83lLf9ncD7dPyhzk6/SelUFO2RQRxtZZrGA== X-Received: by 2002:a17:902:9689:: with SMTP id n9mr35239230plp.241.1563278365612; Tue, 16 Jul 2019 04:59:25 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:3662:: with SMTP id s89ls7081990pjb.1.canary-gmail; Tue, 16 Jul 2019 04:59:25 -0700 (PDT) X-Received: by 2002:a17:902:2a69:: with SMTP id i96mr34458404plb.108.1563278365351; Tue, 16 Jul 2019 04:59:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563278365; cv=none; d=google.com; s=arc-20160816; b=VT86XFaKXU1JXcxVbrdRWZaX0c9YXEr+EurxHZAlWesH835grYxBpCIyoRom1IzoM3 s1jPsjbTb0meGECsN36+MlkJrEraPKLXl72NOTZz+8hcpHU8Z8JcSCbYk3cEbxYF2yMl 1r4xFZjOl91KPp9Z1fjl80hxT30e47rt+vrwmr+O/We8C6cinIYGpXMx9zf1t3v47hnf LzVpiHa7neFM6oaOspTDM/QDwSFwciAIyjMFdkkuMBqByyucR1/5MSR97RqtWh3GqGFy YBCdJgkLIQs67RtMPiHInpi0nfNdG1B1M7ZpXEvs72sHSttIIkB4lNU+MUvBcYNm3p2h 3CfA== 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=Ytkg3u87YIDa47ShbV1haeOc0wg13Q/l2pqMvwhDtcY=; b=URewa6B65/1DCGgrrKE3Ff2oP5SeOIYC/bVH5/v8MxHYCNRRYkLZjXHWR53ATQlw9M tLlVAk/Y2nX5IsvnwX2T43svY9mbllDKRGEn199az4mhnmpg+8JissILRWwwp6IvES20 k07C2n/MrcXUtieX9JTgn46h1sS7sOA1ZqqV9Qbx9T5FcP6rH46m2vbbsX3mIx4x2Lwu c98BtUyMF5CInJqf4S9SaoymaRi+ZFEaWkNDu0onen9i5B5ZrfjyA+GP340em8ozJIMY 4Lcttq3sTF6PaimBR5Fq2PcBXmsdDWFUbBp89suqMc7GrVVfkBCZAmYW2+zZ1faRyMyf w2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=A0wocJqo; 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 j2sor24298229pll.35.2019.07.16.04.59.25 for (Google Transport Security); Tue, 16 Jul 2019 04:59:25 -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:54f:: with SMTP id 73mr34128376plf.246.1563278365055; Tue, 16 Jul 2019 04:59:25 -0700 (PDT) Received: from localhost.localdomain ([49.206.201.107]) by smtp.gmail.com with ESMTPSA id z24sm36269566pfr.51.2019.07.16.04.59.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jul 2019 04:59:24 -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 25/57] ram: rk3399: Avoid two channel ZQ Cal Start at the same time Date: Tue, 16 Jul 2019 17:27:13 +0530 Message-Id: <20190716115745.12585-26-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=A0wocJqo; 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: , It is possible in lpddr4 dram, where both the channels would start at same time with ZQ Cal Start. If it uses ZQ Call start then it will use RZQ. For example LPDDR4 366 Dual-Die, Quad-Channel Package, RZQ maybe connect to both channel. If ZQ Cal Start at the same time, it will use the same RZQ. It is not a problem of using RZQ in both the channels, but can not use at the same time. So, to avoid this, we have an option of dram tINIT3 value for increasing the frequency for channel 1. This patch increase the available tINIT3 with existing running dram frequency. Signed-off-by: Jagan Teki Signed-off-by: YouMin Chen Reviewed-by: Kever Yang --- drivers/ram/rockchip/sdram_rk3399.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c index 023838a301..beb4f6de54 100644 --- a/drivers/ram/rockchip/sdram_rk3399.c +++ b/drivers/ram/rockchip/sdram_rk3399.c @@ -550,6 +550,20 @@ static int pctl_cfg(struct dram_info *dram, const struct chan_info *chan, sizeof(struct rk3399_ddr_pctl_regs) - 4); writel(params_ctl[0], &denali_ctl[0]); + /* + * two channel init at the same time, then ZQ Cal Start + * at the same time, it will use the same RZQ, but cannot + * start at the same time. + * + * So, increase tINIT3 for channel 1, will avoid two + * channel ZQ Cal Start at the same time + */ + if (params->base.dramtype == LPDDR4 && channel == 1) { + tmp = ((params->base.ddr_freq * MHz + 999) / 1000); + tmp1 = readl(&denali_ctl[14]); + writel(tmp + tmp1, &denali_ctl[14]); + } + copy_to_reg(denali_pi, ¶ms->pi_regs.denali_pi[0], sizeof(struct rk3399_ddr_pi_regs));