diff options
| author | Ondrej Čerman <ondrej.cerman@gmail.com> | 2019-06-19 23:01:14 +0200 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-06-19 15:39:39 -0700 | 
| commit | 324be4577a34abfeb186b5135e00d62e185d1d51 (patch) | |
| tree | a2c8473b87cb9e67e255ccddab1979f7eaca3fa4 /modules | |
| parent | e34bd5af3cccfa78b0ca4a9f6fd31aeec59b7b9d (diff) | |
devices/spd: Fixed DDR3 tCL
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/devices/spd-decode.c | 12 | 
1 files changed, 3 insertions, 9 deletions
| diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c index 5f863d49..9c9c5c7c 100644 --- a/modules/devices/spd-decode.c +++ b/modules/devices/spd-decode.c @@ -1277,27 +1277,21 @@ static void decode_ddr3_module_size(unsigned char *bytes, int *size) {  static void decode_ddr3_module_timings(unsigned char *bytes, float *trcd, float *trp, float *tras,                                         float *tcl) {      float ctime; -    float highest_cas = 0; -    int i;      float mtb = 0.125; +    float taa;      if (bytes[10] == 1 && bytes[11] == 8) mtb = 0.125;      if (bytes[10] == 1 && bytes[11] == 15) mtb = 0.0625;      ctime = mtb * bytes[12]; +    taa = bytes[16] * mtb; -    switch (bytes[14]) { -    case 6: highest_cas = 5; break; -    case 4: highest_cas = 6; break; -    case 0xc: highest_cas = 7; break; -    case 0x1e: highest_cas = 8; break; -    }      if (trcd) { *trcd = bytes[18] * mtb; }      if (trp) { *trp = bytes[20] * mtb; }      if (tras) { *tras = (bytes[22] + bytes[21] & 0xf) * mtb; } -    if (tcl) { *tcl = highest_cas; } +    if (tcl) { *tcl = ceil(taa/ctime); }  }  static void decode_ddr3_module_type(unsigned char *bytes, const char **type) { | 
