public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chee, Tien Fong <tien.fong.chee@intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] ddr: socfpga: Fix IO in Arria10 DDR driver
Date: Thu, 7 Mar 2019 13:55:21 +0000	[thread overview]
Message-ID: <1551966920.9744.45.camel@intel.com> (raw)
In-Reply-To: <CAAh8qsycoA_V6EfNHke8zYCJ3fcWioGO=Y-bFLL=nBebFOha4g@mail.gmail.com>

On Thu, 2019-03-07 at 09:14 +0100, Simon Goldschmidt wrote:
> On Wed, Mar 6, 2019 at 10:05 PM Marek Vasut <marex@denx.de> wrote:
> > 
> > 
> > The Altera Arria10 DDR driver was using constants in a few places
> > instead of reading registers associated with those constants, fix
> > this.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Chin Liang See <chin.liang.see@intel.com>
> > Cc: Dinh Nguyen <dinguyen@kernel.org>
> > Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> > Cc: Tien Fong Chee <tien.fong.chee@intel.com>
> Reviewed-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
> 
> > 
> > ---
> >  drivers/ddr/altera/sdram_arria10.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/ddr/altera/sdram_arria10.c
> > b/drivers/ddr/altera/sdram_arria10.c
> > index 29ea7492f3..6724eb29f1 100644
> > --- a/drivers/ddr/altera/sdram_arria10.c
> > +++ b/drivers/ddr/altera/sdram_arria10.c
> > @@ -304,7 +304,7 @@ static void sdram_mmr_init(void)
> >          *      bit[9:6] = Minor Release #
> >          *      bit[14:10] = Major Release #
> >          */
> > -       if ((socfpga_io48_mmr_base->niosreserve1 >> 6) & 0x1FF) {
> > +       if ((readl(&socfpga_io48_mmr_base->niosreserve1) >> 6) &
> > 0x1FF) {
> >                 update_value = readl(&socfpga_io48_mmr_base-
> > >niosreserve0);
> >                 writel(((update_value & 0xFF) >> 5),
> >                        &socfpga_ecc_hmc_base->ddrioctrl);
> > @@ -394,7 +394,7 @@ static void sdram_mmr_init(void)
> >                         caltim0_cfg_act_to_rdwr -
> >                         (ctrlcfg0_cfg_ctrl_burst_len >> 2));
> > 
> > -       io48_value = ((((socfpga_io48_mmr_base->dramtiming0 &
> > +       io48_value = ((((readl(&socfpga_io48_mmr_base->dramtiming0) 
> > &
> >                       ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK) + 2
> > + 15 +
> >                       (ctrlcfg0_cfg_ctrl_burst_len >> 1)) >> 1) -
> >                       /* Up to here was in memory cycles so divide
> > by 2 */
> > @@ -424,7 +424,7 @@ static void sdram_mmr_init(void)
> >                 &socfpga_noc_ddr_scheduler_base-
> > >ddr_t_main_scheduler_ddrmode);
> > 
> >         /* Configure the read latency [0xFFD12414] */
> > -       writel(((socfpga_io48_mmr_base->dramtiming0 &
> > +       writel(((readl(&socfpga_io48_mmr_base->dramtiming0) &
> >                 ALT_IO48_DRAMTIME_MEM_READ_LATENCY_MASK) >> 1) +
> >                 DDR_READ_LATENCY_DELAY,
> >                 &socfpga_noc_ddr_scheduler_base->
> > --
> > 2.20.1
> > 

      reply	other threads:[~2019-03-07 13:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 21:05 [U-Boot] [PATCH 1/2] ddr: socfpga: Fix IO in Arria10 DDR driver Marek Vasut
2019-03-06 21:05 ` [U-Boot] [PATCH 2/2] ddr: socfpga: Fix newline in debug print on A10 Marek Vasut
2019-03-07  8:13   ` Simon Goldschmidt
2019-03-07 13:58     ` Chee, Tien Fong
2019-03-07  8:14 ` [U-Boot] [PATCH 1/2] ddr: socfpga: Fix IO in Arria10 DDR driver Simon Goldschmidt
2019-03-07 13:55   ` Chee, Tien Fong [this message]

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=1551966920.9744.45.camel@intel.com \
    --to=tien.fong.chee@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox