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 7D346C53210 for ; Wed, 4 Jan 2023 23:23:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3674A85016; Thu, 5 Jan 2023 00:23:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 150F28553D; Thu, 5 Jan 2023 00:23:33 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 1ECF8833E8 for ; Thu, 5 Jan 2023 00:23:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DE1C1063; Wed, 4 Jan 2023 15:24:11 -0800 (PST) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BE6C23F23F; Wed, 4 Jan 2023 15:23:28 -0800 (PST) Date: Wed, 4 Jan 2023 23:21:48 +0000 From: Andre Przywara To: Jernej =?UTF-8?B?xaBrcmFiZWM=?= Cc: jagan@amarulasolutions.com, u-boot@lists.denx.de Subject: Re: [PATCH 0/8] sunxi: Update H616 DRAM driver Message-ID: <20230104232148.5456b4ba@slackpad.lan> In-Reply-To: <4767183.GXAFRqVoOG@jernej-laptop> References: <20221211163213.98540-1-jernej.skrabec@gmail.com> <20230104004716.5a07be57@slackpad.lan> <4767183.GXAFRqVoOG@jernej-laptop> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-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.39 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.6 at phobos.denx.de X-Virus-Status: Clean On Wed, 04 Jan 2023 22:02:33 +0100 Jernej =C5=A0krabec wrote: Hi Jernej, > Dne sreda, 04. januar 2023 ob 01:47:16 CET je Andre Przywara napisal(a): > > On Sun, 11 Dec 2022 17:32:05 +0100 > > Jernej Skrabec wrote: > >=20 > > Hi Jernej, > > =20 > > > Current H616 DRAM driver is completely customized to Orange Pi Zero2 > > > board, which is currently the only H616 board supported by U-Boot. > > > Needless to say, this is not ideal for adding new boards. With changes > > > in this series, all DDR3 boards are supported and all that is needed = is > > > just vendor DRAM values extracted from Android image. New DRAM types > > > should also be easier to support, since a lot of constants used before > > > are not really DRAM type dependent. > > >=20 > > > Changes were verified by decompiling driver and generated values were > > > compared to previous, hard coded ones. This was done without dram_para > > > structures, so compiler was able to heavily optimize code and produce > > > constants. =20 > >=20 > > so many thanks again for putting this together! > > I came to like (the idea of) this series very much lately, as this > > removes timing/delay values from the code, and easily allows putting the > > vendor provided values in the defconfig. > > I used that approach as well for the D1 driver, and am wondering if we > > should extend this to other SoCs, potentially unifying the Kconfig part= ? =20 >=20 > While it would be nice, I'm not sure it's worth the effort and there is a= =20 > chance that something might break during rework. Fair enough, was just an idea. > > And you hinted at a v2, can you provide an estimate for this? If you > > send it still this week, I would like to put it into U-Boot's next > > branch, otherwise it goes straight into master, should the merge window > > open next week as planned. =20 >=20 > I have changes for v2 in my github repo. I don't have any estimation, sin= ce I=20 > had some time off from programming lately Sounds good! > and I'm just only catching up.=20 > Weekend at earliest, but no promises. No worries, that was a genuine question, for my planning. I have plenty of other things to do, and we have still plenty of time (till end of January or so) to get things merged. > > Btw., to verify the feasibility of drivers/ram/sunxi, I moved the H616 > > driver into there, together with the Kconfig parts, I wonder what you > > think about this? An example of how this looks is in the D1 driver > > patches. =20 >=20 > Looks good, but I don't know what are implications regarding interface. I= s=20 > just code move or that implies that some ram framework must be used? I don't know what Simon and Tom will say, but I was cheekily just using the directory, ignoring the current DM_SPL preference for code in there. For the D1/T113s code this is probably a no-brainer, but I also found it a nice and simple solution to declutter and cleanup arch/arm/mach-sunxi and its Kconfig. So yeah, it's just moving the files and Kconfig stanzas there, and otherwise leaves the actual code untouched. We still call sunxi_dram_init() from our legacy SPL code. Cheers, Andre >=20 > Best regards, > Jernej >=20 > >=20 > > Cheers, > > Andre > > =20 > > > Please take a look. > > >=20 > > > Best regards, > > > Jernej > > >=20 > > > Jernej Skrabec (8): > > > sunxi: Fix write to H616 DRAM CR register > > > sunxi: cosmetic: Fix H616 DRAM driver code style > > > sunxi: parameterize H616 DRAM ODT values > > > sunxi: Convert H616 DRAM options to single setting > > > sunxi: Always configure ODT on H616 DRAM > > > sunxi: Make bit delay function in H616 DRAM code void > > > sunxi: Parameterize bit delay code in H616 DRAM driver > > > sunxi: Parameterize H616 DRAM code some more > > > =20 > > > .../include/asm/arch-sunxi/dram_sun50i_h616.h | 18 + > > > arch/arm/mach-sunxi/Kconfig | 67 +-- > > > arch/arm/mach-sunxi/dram_sun50i_h616.c | 445 +++++++++++-----= -- > > > configs/orangepi_zero2_defconfig | 8 +- > > > 4 files changed, 348 insertions(+), 190 deletions(-) =20 >=20 >=20 >=20 >=20