From patchwork Thu Feb 14 15:58:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 1042261 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="COUKp+uV"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 440gzl5Sb3z9sN9 for ; Fri, 15 Feb 2019 02:58:43 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 638F1C2205E; Thu, 14 Feb 2019 15:58:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3237CC21F3A; Thu, 14 Feb 2019 15:58:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 12ECDC21F4A; Thu, 14 Feb 2019 15:58:35 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id A2AE0C21F37 for ; Thu, 14 Feb 2019 15:58:35 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id a62so6850900wmh.4 for ; Thu, 14 Feb 2019 07:58:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=Rf40CkADl0z7ysjxEERxzyyNG4Od8xKCvHmtEFqKUoQ=; b=COUKp+uV3G6fiZCJGH+bjz/gfipZd455B0L78keEpoc0B8pXp2YgCvH51VA4TQp2Dt 1Mu+7HKVk8zSzWlKnMKMSXFhjrmyar0Vs+aAVpTBIciAZgM7iQpmuC4Jej7cw7sKBxCX E+dSBng+x/fTbxSQrcSQhRYyXxfyXtzCGxqPE= 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; bh=Rf40CkADl0z7ysjxEERxzyyNG4Od8xKCvHmtEFqKUoQ=; b=ggeA7PsD6c7UxfXwNjLN5JZLAAiYt8Pn6/xrT+scKVbSnZjZRxEKgyZVwZt6KyVay2 nGyOWWm+25OHe3RYvwpjW0jGX5EFqyNCMUmVoCDa8vTYt5ScpR5oMzaduAwqhMWiU2t9 2pop5b3WeuDWis57zULhRONnCsMDIrgkWumdW630tqJsoDG6Y2ZFlBMuBn+vCORLlJJT AVIV9Y58uG1RtgrU1e2udORHHfJWa9Ph8Ya1+F+4snnIe1giP24l2BhORrapg+HBqOGZ UTXRmJiM9NhVlUJs6WwMazW63iY51QWSM5iM7uDSGw2CjguEKUhRUGfwO+A9RlOljrst 9gWA== X-Gm-Message-State: AHQUAuaaREJcn7+TWUG+NnRNAgr9DZsZqnUv60JTOrhRgr70wRrikOgG ZmRsugS7yRRk3CkiipH+qYSeqw== X-Google-Smtp-Source: AHgI3IaNp5Rl3e+vL9dIV7PKRe2f3YeF9br7/4J9gBDO4P2S6rqu9buLgby3U4fEdejuK3wUaxfgZw== X-Received: by 2002:a7b:c76a:: with SMTP id x10mr3379242wmk.101.1550159915036; Thu, 14 Feb 2019 07:58:35 -0800 (PST) Received: from localhost.localdomain (host211-95-static.0-79-b.business.telecomitalia.it. [79.0.95.211]) by smtp.gmail.com with ESMTPSA id b12sm2406123wmj.3.2019.02.14.07.58.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 07:58:34 -0800 (PST) From: Michael Trimarchi To: Maxime Ripard , Jagan Teki Date: Thu, 14 Feb 2019 16:58:31 +0100 Message-Id: <20190214155833.11984-1-michael@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 Cc: andre.przywara@arm.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V2 1/3] sunxi: Use clrsetbits_le32 instead of multiple instruction X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Signed-off-by: Michael Trimarchi --- V1->V2: none --- arch/arm/mach-sunxi/dram_sun8i_a33.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-sunxi/dram_sun8i_a33.c b/arch/arm/mach-sunxi/dram_sun8i_a33.c index 1da2727f98..83212aaddf 100644 --- a/arch/arm/mach-sunxi/dram_sun8i_a33.c +++ b/arch/arm/mach-sunxi/dram_sun8i_a33.c @@ -148,12 +148,8 @@ static void auto_set_timing_para(struct dram_para *para) reg_val = (tcksrx << 24) | (tcksre << 16) | (tckesr << 8) | (tcke << 0); writel(reg_val, &mctl_ctl->dramtmg5); /* Set two rank timing and exit self-refresh timing */ - reg_val = readl(&mctl_ctl->dramtmg8); - reg_val &= ~(0xff << 8); - reg_val &= ~(0xff << 0); - reg_val |= (0x33 << 8); - reg_val |= (0x8 << 0); - writel(reg_val, &mctl_ctl->dramtmg8); + clrsetbits_le32(&mctl_ctl->dramtmg8, (0xff << 8) | (0xff << 0), + 0x33 << 8 | (0x8 << 0)); /* Set phy interface time */ reg_val = (0x2 << 24) | (t_rdata_en << 16) | (0x1 << 8) | (wr_latency << 0); From patchwork Thu Feb 14 15:58:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 1042262 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="ijp1rCM6"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 440h0G5X2tz9sN4 for ; Fri, 15 Feb 2019 02:59:10 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 651A4C2209D; Thu, 14 Feb 2019 15:58:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 98198C22082; Thu, 14 Feb 2019 15:58:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 55895C21F69; Thu, 14 Feb 2019 15:58:40 +0000 (UTC) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by lists.denx.de (Postfix) with ESMTPS id 43CC6C21F69 for ; Thu, 14 Feb 2019 15:58:37 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id f16so6597316wmh.4 for ; Thu, 14 Feb 2019 07:58:37 -0800 (PST) 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; bh=3KQz6LfW8sk1IHkep4P3xfGZdL9Hi7BBwlFznNbY8zw=; b=ijp1rCM6NDxA880VGaP0/DJZdJjIlOggeWH0fEZe4Gf6EOfXCxrZzHf4N1cSBqkaT6 l0+7DHYVC0glosk1cgbQdlUCQq6EuA4GBjgB2pH6YDRf/2w5jPCjCLDcyBNC8lm65jYL piUKU9T6ME1gPWtxtLlfAYtk+Gaq6G2EHmHg8= 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; bh=3KQz6LfW8sk1IHkep4P3xfGZdL9Hi7BBwlFznNbY8zw=; b=MjYdQqy0+J7SNsT7MeydLEEs2Oeude8itsJc3jp4XjMti5yK9CUWemx1n+SQtUiUN6 nGoVjU1p1zm0m3d+Lx5kkM/ER/04/oGBiLDQC06N6aBHRGndo1Ao5SVnWgVYLIrS9ckC fl9LMQKnsOoDyiCYJ2ZT0q479NXqkMOt8R+xr++W1XzVeqji03qFOxOByoq73ar0odvS 3zknQI8J8vM+5ARoR4RIFyW2IxCYDvJdarGy4ovgDmJgDVtUz7gs4q/XSyvWjrUBxbD0 2SflBDjIIPd57QuvhhJ5rsiFIiCVNBli6U7FePNer91ddNP3hxXG/mKyR99vcFLGzvmu IcBA== X-Gm-Message-State: AHQUAuaZahhGk7vNci3BbtLQ9cRgjthN4MZMeO9ThYJYezRjggCD4u9/ 4+KBdRyNJvLqCE6dLwCTH8hvhQ== X-Google-Smtp-Source: AHgI3IaCSKir8w+ZdpXjHN56J8scdoN+TwGmtXcMuWiDumVo/ufdi2tnXCgasc2mTnTtbnLQjQc6hw== X-Received: by 2002:a1c:b189:: with SMTP id a131mr3383633wmf.38.1550159916527; Thu, 14 Feb 2019 07:58:36 -0800 (PST) Received: from localhost.localdomain (host211-95-static.0-79-b.business.telecomitalia.it. [79.0.95.211]) by smtp.gmail.com with ESMTPSA id b12sm2406123wmj.3.2019.02.14.07.58.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 07:58:35 -0800 (PST) From: Michael Trimarchi To: Maxime Ripard , Jagan Teki Date: Thu, 14 Feb 2019 16:58:32 +0100 Message-Id: <20190214155833.11984-2-michael@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214155833.11984-1-michael@amarulasolutions.com> References: <20190214155833.11984-1-michael@amarulasolutions.com> Cc: andre.przywara@arm.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V2 2/3] sunxi: Don't change the rank in dram size detection in A33 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Change the size create a glitch in the clken signal on second bank. According to the ddr manual the clken need to be sent accros the reset signal coming the cpu. The rank is calculated just before this function is called and the mctl_set_cr should not change this value anymore Signed-off-by: Michael Trimarchi --- V1->V2: Adjust commit description --- arch/arm/mach-sunxi/dram_sun8i_a33.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/mach-sunxi/dram_sun8i_a33.c b/arch/arm/mach-sunxi/dram_sun8i_a33.c index 83212aaddf..d73a93a132 100644 --- a/arch/arm/mach-sunxi/dram_sun8i_a33.c +++ b/arch/arm/mach-sunxi/dram_sun8i_a33.c @@ -45,14 +45,12 @@ static void mctl_set_cr(struct dram_para *para) static void auto_detect_dram_size(struct dram_para *para) { - u8 orig_rank = para->rank; int rows, columns; /* Row detect */ para->page_size = 512; para->seq = 1; para->rows = 16; - para->rank = 1; mctl_set_cr(para); for (rows = 11 ; rows < 16 ; rows++) { if (mctl_mem_matches(1 << (rows + 9))) /* row-column */ @@ -69,7 +67,6 @@ static void auto_detect_dram_size(struct dram_para *para) } para->seq = 0; - para->rank = orig_rank; para->rows = rows; para->page_size = 1 << columns; mctl_set_cr(para); From patchwork Thu Feb 14 15:58:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 1042263 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="i+ernm9o"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 440h0d0kxmz9sMr for ; Fri, 15 Feb 2019 02:59:28 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id ADC87C220B2; Thu, 14 Feb 2019 15:59:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 1F6FDC220BD; Thu, 14 Feb 2019 15:58:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5A281C21FEF; Thu, 14 Feb 2019 15:58:42 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id AFACCC21FB1 for ; Thu, 14 Feb 2019 15:58:38 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id j125so6617526wmj.1 for ; Thu, 14 Feb 2019 07:58:38 -0800 (PST) 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; bh=x1c2bOVce7PyjlQvQv5jUlXQjBMNwxFGDyRgP33/YPI=; b=i+ernm9o9v2+cI6IpOaR0wZaYfdi1ffth/5KxzCO2elAqE2KyJdMWN59Choai4stgE SVdRS4GLq0nirdYTyPzX9ilGGfl3AhbOznjl4aiaOmb4ehADQYIEeBQaqKHTt3Pqc8Ji YgAG1AvbUjWRGHYcgd1HYhPNngxD49iQGPe98= 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; bh=x1c2bOVce7PyjlQvQv5jUlXQjBMNwxFGDyRgP33/YPI=; b=d41n0cQq3whNb3ZkOji4epa08nDLXL4DFzk1LNv8R+glstpq9VVo7kyHHMWZJabbQy Clci401CcalBho5VpzTj1vPcodIpV1sjIr0usFFAe5M3zPS4h91V6TDfHbp5/rMsWm7t WjlfP/nFDX8AQ9xJfNS0vy/EbzQ/4hNiPA5VGlawMV1wShLf/PxOt81p0eu9p2eEtAfQ hqN0BjrT2foJ01/QN/Pgok7ChbOuq5ALUuXBaNi5Bz02sm72CSSAPf1lPWi+w6enT8gn hdumoYGdm6MefjJ3aq2Zyo+VcvDvUzdj+xUTy5HZvdfhKYKodDFtBxO56fjhU1mz2K5r 69Vg== X-Gm-Message-State: AHQUAubyo7BY/38vmthH6xoHDOgXjXerpYGpFNHHB1nHLe+YgCxmOP3d BxNqfV3Ex77MXQgv9PImY70ufA== X-Google-Smtp-Source: AHgI3Ib3RQR6cOk4RfRf2s+PSW9TOTbD2ji2FR72jTDVhlsH5nSpH6VR5m7NmC7E4YWi5c/GdojHig== X-Received: by 2002:a1c:990c:: with SMTP id b12mr3372419wme.106.1550159918096; Thu, 14 Feb 2019 07:58:38 -0800 (PST) Received: from localhost.localdomain (host211-95-static.0-79-b.business.telecomitalia.it. [79.0.95.211]) by smtp.gmail.com with ESMTPSA id b12sm2406123wmj.3.2019.02.14.07.58.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 07:58:37 -0800 (PST) From: Michael Trimarchi To: Maxime Ripard , Jagan Teki Date: Thu, 14 Feb 2019 16:58:33 +0100 Message-Id: <20190214155833.11984-3-michael@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190214155833.11984-1-michael@amarulasolutions.com> References: <20190214155833.11984-1-michael@amarulasolutions.com> Cc: andre.przywara@arm.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V2 3/3] sunxi: Fix A33 memory initialization X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Set two rank timing and exit self-refresh timing seems not done properly. We know use the same write that we are using on H5 silicon. Tested was done in A33 allwinner cpu, dual rank connection connected with two MT41K512M16HA-125:A memory model. Memory is configure as DDR3 1.5V Signed-off-by: Michael Trimarchi --- V1->V2: adjust commit message --- arch/arm/mach-sunxi/dram_sun8i_a33.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/dram_sun8i_a33.c b/arch/arm/mach-sunxi/dram_sun8i_a33.c index d73a93a132..355fe30aba 100644 --- a/arch/arm/mach-sunxi/dram_sun8i_a33.c +++ b/arch/arm/mach-sunxi/dram_sun8i_a33.c @@ -146,7 +146,7 @@ static void auto_set_timing_para(struct dram_para *para) writel(reg_val, &mctl_ctl->dramtmg5); /* Set two rank timing and exit self-refresh timing */ clrsetbits_le32(&mctl_ctl->dramtmg8, (0xff << 8) | (0xff << 0), - 0x33 << 8 | (0x8 << 0)); + 0x33 << 8 | (0x10 << 0)); /* Set phy interface time */ reg_val = (0x2 << 24) | (t_rdata_en << 16) | (0x1 << 8) | (wr_latency << 0);