From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Andre Przywara <andre.przywara@arm.com>
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 [thread overview]
Message-ID: <3205908.aeNJFYEL58@jernej-laptop> (raw)
In-Reply-To: <20230104003717.48eee16b@slackpad.lan>
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 <jernej.skrabec@gmail.com> 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 <jernej.skrabec@gmail.com>
> > ---
> >
> > 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);
next prev parent reply other threads:[~2023-01-04 21:12 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-11 16:32 [PATCH 0/8] sunxi: Update H616 DRAM driver Jernej Skrabec
2022-12-11 16:32 ` [PATCH 1/8] sunxi: Fix write to H616 DRAM CR register Jernej Skrabec
2023-01-04 0:35 ` Andre Przywara
2022-12-11 16:32 ` [PATCH 2/8] sunxi: cosmetic: Fix H616 DRAM driver code style Jernej Skrabec
2023-01-04 0:36 ` Andre Przywara
2022-12-11 16:32 ` [PATCH 3/8] sunxi: parameterize H616 DRAM ODT values Jernej Skrabec
2023-01-04 0:36 ` Andre Przywara
2022-12-11 16:32 ` [PATCH 4/8] sunxi: Convert H616 DRAM options to single setting Jernej Skrabec
2022-12-12 17:50 ` Andre Przywara
2022-12-13 16:23 ` Jernej Škrabec
2022-12-13 16:51 ` Andre Przywara
2022-12-13 17:08 ` Jernej Škrabec
2022-12-11 16:32 ` [PATCH 5/8] sunxi: Always configure ODT on H616 DRAM Jernej Skrabec
2023-01-04 0:37 ` Andre Przywara
2023-01-04 21:12 ` Jernej Škrabec [this message]
2022-12-11 16:32 ` [PATCH 6/8] sunxi: Make bit delay function in H616 DRAM code void Jernej Skrabec
2023-01-04 0:37 ` Andre Przywara
2022-12-11 16:32 ` [PATCH 7/8] sunxi: Parameterize bit delay code in H616 DRAM driver Jernej Skrabec
2023-01-04 0:37 ` Andre Przywara
2023-01-04 21:28 ` Jernej Škrabec
2022-12-11 16:32 ` [PATCH 8/8] sunxi: Parameterize H616 DRAM code some more Jernej Skrabec
2022-12-11 18:33 ` Jernej Škrabec
2023-01-04 0:38 ` Andre Przywara
2023-01-04 21:30 ` Jernej Škrabec
2022-12-12 1:04 ` [PATCH 0/8] sunxi: Update H616 DRAM driver Andre Przywara
2022-12-12 16:14 ` Jernej Škrabec
2023-01-04 0:47 ` Andre Przywara
2023-01-04 21:02 ` Jernej Škrabec
2023-01-04 23:21 ` Andre Przywara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3205908.aeNJFYEL58@jernej-laptop \
--to=jernej.skrabec@gmail.com \
--cc=andre.przywara@arm.com \
--cc=jagan@amarulasolutions.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.