From: Ian Campbell <ijc+uboot@hellion.org.uk>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] sunxi: Make DRAM_ODT_EN Kconfig setting a bool
Date: Tue, 19 May 2015 19:41:25 +0100 [thread overview]
Message-ID: <1432060885.5748.95.camel@hellion.org.uk> (raw)
In-Reply-To: <555B6732.6030900@redhat.com>
On Tue, 2015-05-19 at 18:39 +0200, Hans de Goede wrote:
> Hi,
>
> On 05/19/2015 04:13 PM, Ian Campbell wrote:
> > On Tue, 2015-05-19 at 14:56 +0200, Hans de Goede wrote:
> >> diff --git a/arch/arm/cpu/armv7/sunxi/dram_sun4i.c b/arch/arm/cpu/armv7/sunxi/dram_sun4i.c
> >> index c736fa3..f7b4915 100644
> >> --- a/arch/arm/cpu/armv7/sunxi/dram_sun4i.c
> >> +++ b/arch/arm/cpu/armv7/sunxi/dram_sun4i.c
> >> @@ -508,7 +508,7 @@ static void mctl_ddr3_initialize(void)
> >> /*
> >> * Perform impedance calibration on the DRAM controller side of the wire.
> >> */
> >> -static void mctl_set_impedance(u32 zq, u32 odt_en)
> >> +static void mctl_set_impedance(u32 zq, bool odt_en)
> >> {
> >> struct sunxi_dram_reg *dram = (struct sunxi_dram_reg *)SUNXI_DRAMC_BASE;
> >> u32 reg_val;
> >> @@ -556,7 +556,7 @@ static void mctl_set_impedance(u32 zq, u32 odt_en)
> >> clrbits_le32(&dram->zqcr0, DRAM_ZQCR0_ZCAL);
> >>
> >> /* Set I/O configure register */
> >> - writel(DRAM_IOCR_ODT_EN(odt_en), &dram->iocr);
> >> + writel(DRAM_IOCR_ODT_EN, &dram->iocr);
> >
> > I think at this point previously odt_en would always be 0x1 here (0x0
> > having been short circuited earlier).
> >
> > Whereas this...
> >
> >> -#define DRAM_IOCR_ODT_EN(n) ((((n) & 0x3) << 30) | ((n) & 0x3) << 0)
> >> -#define DRAM_IOCR_ODT_EN_MASK DRAM_IOCR_ODT_EN(0x3)
> >> +#define DRAM_IOCR_ODT_EN ((3 << 30) | (3 << 0))
> >
> > ... now behaves as if it were always 0x3.
> >
> > AFAICT up until now, at least with the in-tree defconfigs, odt_en was
> > always 0 for sun4i anyway, but this is a surprising change I think.
>
> This is deliberate, as Siarhei explained in his reply to v2 the 2 bits
> we are setting here enable odt for the DQ resp. DQS lines, having them
> enabled for one but not the other does not really make sense.
>
> I'll amend the commit message to explicitly mention this.
Thanks.
Ian.
next prev parent reply other threads:[~2015-05-19 18:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-19 12:56 [U-Boot] [PATCH v3] sunxi: Make DRAM_ODT_EN Kconfig setting a bool Hans de Goede
2015-05-19 14:13 ` Ian Campbell
2015-05-19 15:28 ` Siarhei Siamashka
2015-05-19 16:39 ` Hans de Goede
2015-05-19 18:41 ` Ian Campbell [this message]
2015-05-19 14:54 ` Siarhei Siamashka
2015-05-19 16:50 ` Hans de Goede
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=1432060885.5748.95.camel@hellion.org.uk \
--to=ijc+uboot@hellion.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox