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 1491BC46467 for ; Wed, 4 Jan 2023 21:12:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 728AC85301; Wed, 4 Jan 2023 22:12:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="klQSSha5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 922248545D; Wed, 4 Jan 2023 22:12:05 +0100 (CET) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2EBC785279 for ; Wed, 4 Jan 2023 22:12:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jernej.skrabec@gmail.com Received: by mail-ej1-x636.google.com with SMTP id tz12so85695037ejc.9 for ; Wed, 04 Jan 2023 13:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g77DtRpmNbv7nHtvAKOkdKmcVnctUkWjVHrp88pCh4I=; b=klQSSha5IMx8PQv0Nyl60mggYB9liqLdessqi/2xVPZdcacd9g9+0ydTDbv1w+UYbx +KQQXtcdGkLoDnupDcxfK87DKGIkqJolP2n7Fjq6NKRb9Ae0d0vB1MnwEuSbF/VCQVTJ xwj70nWEOjG9xFZ96HA54kDvLnqC3+Zkh+eJQzEeVgcpsXeJV+BY59hUXWxTcr79x2pu 3Q2mjFtSOdSf6O8gs9IJ4UuoPHeS3CgRuXTJesb5++l4MZSismMETs2MPHrb7IjP/HUl k/KSuZgdLsPckDyT7ibjZ6dZblXb8c3IQ1HNDuOjg6i4N7CXn5QzmQ43OaHBGZk599WM G9ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g77DtRpmNbv7nHtvAKOkdKmcVnctUkWjVHrp88pCh4I=; b=xhUadFTr10Vbu7ZYtCynQVG3kZ7ZBvgjhsLGJb9MzY2h9vlyZXOCWQG/c4uO2NjC1C jeOKCgz2xaZQWUH9a48YB3ETjCFq+ezZsw/tNmRUHoUZW6/xukCdtOpgLHJ3NbJJxaJb YY1YgtSA7N1vsYi8tBjvnP7oZkvv2PKHWH9Xp6F5eGQOlQciRz2yOqrr2HZsGCn6j78u gmsNa1xNpOH3666zKVRhSLhvKYXkvQvKhU0jOcHkH4BjixtlWTVvLDFN0T6lCDtV2Ri5 eSljWiBpsw1ZQe2OTwwY1dYNCVt6TvyldbMVs/kepT5utNS7pI/GZe7DNhdZ1C0oYHg7 m4Ew== X-Gm-Message-State: AFqh2kqaLXsyB4wKvu/YhEChLshTcxApAHre45s/OuTtrF8osg/bsSmT HlQWYgQvDq/Oozml7Hwa0+8= X-Google-Smtp-Source: AMrXdXvXDiFzYFnuX/F+aQ11ZmtKs477k19VXzWfRwIKyu5NqmsefCtpchPttXGkxRYTQRrbXeEEBQ== X-Received: by 2002:a17:906:8806:b0:829:6036:eaa1 with SMTP id zh6-20020a170906880600b008296036eaa1mr49977344ejb.49.1672866721772; Wed, 04 Jan 2023 13:12:01 -0800 (PST) Received: from jernej-laptop.localnet (82-149-19-102.dynamic.telemach.net. [82.149.19.102]) by smtp.gmail.com with ESMTPSA id s10-20020a1709064d8a00b007815ca7ae57sm15894638eju.212.2023.01.04.13.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 13:12:01 -0800 (PST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Andre Przywara Cc: jagan@amarulasolutions.com, u-boot@lists.denx.de Subject: Re: [PATCH 5/8] sunxi: Always configure ODT on H616 DRAM Date: Wed, 04 Jan 2023 22:12:00 +0100 Message-ID: <3205908.aeNJFYEL58@jernej-laptop> In-Reply-To: <20230104003717.48eee16b@slackpad.lan> References: <20221211163213.98540-1-jernej.skrabec@gmail.com> <20221211163213.98540-6-jernej.skrabec@gmail.com> <20230104003717.48eee16b@slackpad.lan> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 Dne sreda, 04. januar 2023 ob 01:37:17 CET je Andre Przywara napisal(a): > 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. I don't see it that way. It just means it's unused for H616. > 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? The thing is that I can't give you good explanation for anything above due to nature of reverse engineering. It's just how vendor code is done and I would argue that my original assumption when I was writing this driver was wrong and I shouldn't use this symbol at all in first place. I'm not even sure if I named mctl_phy_configure_odt() completely correct. It has to do something with ODT, but I don't know if it gets enabled here or not. To me, it looks more like that just some parameters are set here. Best regards, Jernej > > 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);