public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] question about U-Boot's cpu/ppc4xx/44x_spd_ddr2.c
Date: Mon, 19 Jan 2009 17:09:56 +0100	[thread overview]
Message-ID: <200901191709.56561.sr@denx.de> (raw)
In-Reply-To: <2BA6BDB4C941C94BBD8375D55E05CCF91248049192@us-bv-m12.global.tektronix.net>

Hi Carolyn,

On Thursday 15 January 2009, carolyn.j.smith at tektronix.com wrote:
> I have a question about some of the code in U-Boot's
> cpu/ppc4xx/44x_spd_ddr2.c, in particular the program_codt function and
> these lines of code:
>
>         mfsdram(SDRAM_CODT, codt);
>         codt |= (SDRAM_CODT_IO_NMODE
>                  & (~SDRAM_CODT_DQS_SINGLE_END
>                     & ~SDRAM_CODT_CKSE_SINGLE_END
>                     & ~SDRAM_CODT_FEEBBACK_RCV_SINGLE_END
>                     & ~SDRAM_CODT_FEEBBACK_DRV_SINGLE_END));
>
> What is the intention of this code? As far as I can tell, all it is doing
> is or'ing SDRAM_CODT_IO_NMODE (= 0x00000001) into the codt variable and the
>
>                  & (~SDRAM_CODT_DQS_SINGLE_END
>                     & ~SDRAM_CODT_CKSE_SINGLE_END
>                     & ~SDRAM_CODT_FEEBBACK_RCV_SINGLE_END
>                     & ~SDRAM_CODT_FEEBBACK_DRV_SINGLE_END)
>
> part of it has no real effect.

Good catch.

> Was the intention to turn on the SDRAM_CODT_IO_NMODE bit and turn off the
> SDRAM_CODT_DQS_SINGLE_END, SDRAM_CODT_CKSE_SINGLE_END,
> SDRAM_CODT_FEEBBACK_RCV_SINGLE_END and SDRAM_CODT_FEEBBACK_DRV_SINGLE_END
> bits in which case the code should be something like this?
>
>         codt |= SDRAM_CODT_IO_NMODE;
>
>         codt &= ~(SDRAM_CODT_DQS_SINGLE_END | SDRAM_CODT_CKSE_SINGLE_END |
>                   SDRAM_CODT_FEEBBACK_RCV_SINGLE_END |
> SDRAM_CODT_FEEBBACK_DRV_SINGLE_END);

Not being the original author of this code, I can only guess that this is what 
this code *should* do. Please send a patch to fix this.

> Also the 460EX manual I have (revision 1.16 - November 17, 2008) shows bits
> 29 and 30 of the CODT register as Reserved (in which case they shouldn't be
> modified) while U-Boot has them as
>
> #define SDRAM_CODT_FEEBBACK_RCV_SINGLE_END      0x00000004
> #define SDRAM_CODT_FEEBBACK_DRV_SINGLE_END      0x00000002
>
> Do I have an out-of-date manual or are they reserved only for the 460EX and
> not for other processors using this code?

No, you seem to be correct here too. I couldn't find those defines in the 
460EX users manual (same version) or in the current 440SPe users manual.

Perhaps somebody from AMCC could jump in here. Adam? Any ideas on this?

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2009-01-19 16:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 17:18 [U-Boot] question about U-Boot's cpu/ppc4xx/44x_spd_ddr2.c carolyn.j.smith at tektronix.com
2009-01-19 16:09 ` Stefan Roese [this message]
2009-01-20  2:41   ` Adam Graham
2009-01-21  1:06     ` Adam Graham

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=200901191709.56561.sr@denx.de \
    --to=sr@denx.de \
    --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