[U-Boot-Users] Question about spd_sdram function

Arcady Gilinsky arcadyg at gmail.com
Tue Dec 18 15:00:37 CET 2007


I'm working with MPC8548 based board and use U-Boot 1.2.0.
I use hard-coded values for memory controller,
but in nearest future I want to use SPD based initialization,
so there is a question related to SPD code.

Looking at spd_sdram function at next code:
/---- start of code ----/
     * Convert trfc_clk to DDR controller fields.  DDR I should
     * fit in the REFREC field (16-19) of TIMING_CFG_1, but the
     * 8548 controller has an extended REFREC field of three bits.
     * The controller automatically adds 8 clocks to this value,
     * so preadjust it down 8 first before splitting it up.
    trfc_low = (trfc_clk - 8) & 0xf;
    trfc_high = ((trfc_clk - 8) >> 4) & 0x3;
/---- end of code ----/

there is inconsistency in code and comment  - the value of REFREC extended
field (EXT_REFREC)
stored at trfc_high variable and contains only two bits of calculation,
but comments above and spec of MPC8548 say that the EXT_REFREC field is 3
bit long
(i.e. should be trfc_high = ((trfc_clk - 8) >> 4) & 0x7; ).

Is it a bug ?

Best regards
Arcady Gilinsky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20071218/c46b5ae7/attachment.htm 

More information about the U-Boot mailing list