public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] question about U-Boot's cpu/ppc4xx/44x_spd_ddr2.c
@ 2009-01-15 17:18 carolyn.j.smith at tektronix.com
  2009-01-19 16:09 ` Stefan Roese
  0 siblings, 1 reply; 4+ messages in thread
From: carolyn.j.smith at tektronix.com @ 2009-01-15 17:18 UTC (permalink / raw)
  To: u-boot

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.

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);

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?

Thanks,
Carolyn

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-21  1:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2009-01-20  2:41   ` Adam Graham
2009-01-21  1:06     ` Adam Graham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox