From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 497A5C433F5 for ; Tue, 4 Jan 2022 15:28:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8EE70801EB; Tue, 4 Jan 2022 16:28:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="YXRUUOP5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 711E48015E; Tue, 4 Jan 2022 16:28:38 +0100 (CET) Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 89A7582EC6 for ; Tue, 4 Jan 2022 16:28:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 06B9114099A; Tue, 4 Jan 2022 16:28:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1641310112; bh=642NA/IgWnIo94XLY8GVOzTk7qQuCUytES/MUabO3ns=; h=Date:From:To; b=YXRUUOP5922ihjrncg9IJXZTOuEJe8MF0rSJIDJIy9GU5Xb0FbAJvUGURP20hTxEk 8Kcgik+EfDqoQkdxR9xZi1vkDJa2JpmNMi01GXkU5hCzd+gVCzUNHyfeDcLdpxEQWH ktcAE0c9oDxLk/dNrNes8y2kiOLZPrauYynPC7DM= Date: Tue, 4 Jan 2022 16:28:31 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Chris Packham , Chris Packham , Stefan Roese , Baruch Siach , Pavol =?UTF-8?B?Um9ow6Fy?= , u-boot@lists.denx.de, Dirk Eibach , Mario Six , Dennis Gilmore , Kostya Porotchkin Subject: Re: [PATCH u-boot-marvell] ddr: marvell: a38x: Fix Synchronous vs Asynchronous mode determination Message-ID: <20220104162831.63647587@thinkpad> In-Reply-To: <20220104145749.18626-1-kabel@kernel.org> References: <20220104145749.18626-1-kabel@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Tue, 4 Jan 2022 15:57:49 +0100 Marek Beh=C3=BAn wrote: > From: Marek Beh=C3=BAn >=20 > Before commit 4c289425752f ("mv_ddr: a38x: add support for ddr async > mode"), Asynchornous Mode was only used when the CPU Subsystem Clock > Options[4:0] field in the SAR1 register was set to value 0x13: CPU at > 2 GHz and DDR at 933 MHz. >=20 > Then commit 4c289425752f ("mv_ddr: a38x: add support for ddr async > mode") added support for Asynchornous Modes with frequencies other than > 933 MHz (but at least 467 MHz), but the code it added to check for > whether Asynchornous Mode should be used is wrong: it checks whether the > frequency setting in board DDR topology map is set to value other than > MV_DDR_FREQ_SAR. >=20 > Thus boards which define a specific value, greater than 400 MHz, for DDR > frequency in their board topology (e.g. Turris Omnia defines > MV_DDR_FREQ_800), are incorrectly put into Asynchornous Mode after that > commit. >=20 > The A38x Functional Specification, section 10.12 DRAM Clocking, says: > In Synchornous mode, the DRAM and CPU clocks are edge aligned and run > in 1:2 or 1:3 CPU to DRAM frequency ratios. >=20 > Change the check for whether Asynchornous Mode should be used according > to this explanation in Functional Specification. >=20 > Signed-off-by: Marek Beh=C3=BAn I forgot to mention that we discovered this on Turris Omnia by comparing DDR speed with the time mtest 10000000 10100000 0 1 command. In Asynchornous Mode this takes ~27 seconds, in Synchronous mode ~22 seconds. Marek