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 190E8C3DA7D for ; Wed, 4 Jan 2023 00:40:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EA5F8556C; Wed, 4 Jan 2023 01:40:20 +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 740AC8555F; Wed, 4 Jan 2023 01:40:13 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id B9ABB8555D for ; Wed, 4 Jan 2023 01:40:09 +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 5CE451596; Tue, 3 Jan 2023 16:40:50 -0800 (PST) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 28CD53F71A; Tue, 3 Jan 2023 16:40:08 -0800 (PST) Date: Wed, 4 Jan 2023 00:37:17 +0000 From: Andre Przywara To: Jernej Skrabec Cc: jagan@amarulasolutions.com, u-boot@lists.denx.de Subject: Re: [PATCH 5/8] sunxi: Always configure ODT on H616 DRAM Message-ID: <20230104003717.48eee16b@slackpad.lan> In-Reply-To: <20221211163213.98540-6-jernej.skrabec@gmail.com> References: <20221211163213.98540-1-jernej.skrabec@gmail.com> <20221211163213.98540-6-jernej.skrabec@gmail.com> 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=US-ASCII Content-Transfer-Encoding: 7bit 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 Sun, 11 Dec 2022 17:32:10 +0100 Jernej Skrabec wrote: > Vendor H616 DRAM code always configure part which we call ODT > configuration. Let's reflect that here too. I wonder if we need this patch at all. "depends on !H616" looks counter-intuitive, since this suggests it's always off. As it stands, it doesn't hurt. "default y" does the right thing, and if people want to shoot themselves in the foot: fine by me. At least I would like to keep the Kconfig part. We could change the condition in the code into an explaining comment, if you still want to force this on. And coming back from patch 7/8: how does this correspond to DRAM_SUN50I_H616_ODT_EN? Cheers, Andre > > Signed-off-by: Jernej Skrabec > --- > arch/arm/mach-sunxi/Kconfig | 2 +- > arch/arm/mach-sunxi/dram_sun50i_h616.c | 3 +-- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig > index abcbd0fb9061..778304b77e26 100644 > --- a/arch/arm/mach-sunxi/Kconfig > +++ b/arch/arm/mach-sunxi/Kconfig > @@ -488,12 +488,12 @@ config DRAM_ZQ > > config DRAM_ODT_EN > bool "sunxi dram odt enable" > + depends on !MACH_SUN50I_H616 > default y if MACH_SUN8I_A23 > default y if MACH_SUNXI_H3_H5 > default y if MACH_SUN8I_R40 > default y if MACH_SUN50I > default y if MACH_SUN50I_H6 > - default y if MACH_SUN50I_H616 > ---help--- > Select this to enable dram odt (on die termination). > > diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c > index 14a01a3c4e54..bf5b4ddfb5c2 100644 > --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c > +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c > @@ -736,8 +736,7 @@ static bool mctl_phy_init(struct dram_para *para) > writel(0x80, SUNXI_DRAM_PHY0_BASE + 0x3dc); > writel(0x80, SUNXI_DRAM_PHY0_BASE + 0x45c); > > - if (IS_ENABLED(CONFIG_DRAM_ODT_EN)) > - mctl_phy_configure_odt(para); > + mctl_phy_configure_odt(para); > > clrsetbits_le32(SUNXI_DRAM_PHY0_BASE + 4, 7, 0xa); >