Changeset 3689 for trunk/coreboot-v2

Show
Ignore:
Timestamp:
10/23/08 00:26:09 (3 months ago)
Author:
mjones
Message:

Changed RAM speed calculation to fix RAM modules getting rejected only
due to integer rounding errors. Previously, the formula was:

speed = 2 * (10000/spd_value)

For spd_value=60 this means speed = 2 * 166 = 332, which is less than
333 and coreboot died saying RAM was incompatible. The new formula is:

speed = 20000 / spd_value

For spd_value=60, speed=333, which is fine.

Signed-off-by: Jens Rottmann <JRottmann@…>
Acked-by: Marc Jones <marc.jones@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/coreboot-v2/src/northbridge/amd/lx/raminit.c

    r3052 r3689  
    195195 
    196196        /* Turn SPD ns time into MHZ. Check what the asm does to this math. */ 
    197         speed = 2 * ((10000 / (((spd_byte0 >> 4) * 10) + (spd_byte0 & 0x0F)))); 
     197        speed = 20000 / (((spd_byte0 >> 4) * 10) + (spd_byte0 & 0x0F)); 
    198198 
    199199        /* current speed > max speed? */ 
     
    275275                if (spd_byte != 0) { 
    276276                        /* Turn SPD ns time into MHZ. Check what the asm does to this math. */ 
    277                         dimm_speed = 2 * (10000 / (((spd_byte >> 4) * 10) + 
    278                                                 (spd_byte & 0x0F))); 
     277                        dimm_speed = 20000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F)); 
    279278                        if (dimm_speed >= glspeed) { 
    280279                                casmap_shift = 1; /* -.5 is a shift of 1 */ 
     
    283282                                if (spd_byte != 0) { 
    284283                                        /* Turn SPD ns time into MHZ. Check what the asm does to this math. */ 
    285                                         dimm_speed = 2 * (10000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F))); 
     284                                        dimm_speed = 20000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F)); 
    286285                                        if (dimm_speed >= glspeed) { 
    287286                                                casmap_shift = 2; /* -1 is a shift of 2 */ 
     
    307306                if (spd_byte != 0) { 
    308307                        /* Turn SPD ns time into MHZ. Check what the asm does to this math. */ 
    309                         dimm_speed = 2 * (10000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F))); 
     308                        dimm_speed = 20000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F)); 
    310309                        if (dimm_speed >= glspeed) { 
    311310                                casmap_shift = 1; /* -.5 is a shift of 1 */ 
     
    314313                                if (spd_byte != 0) { 
    315314                                        /* Turn SPD ns time into MHZ. Check what the asm does to this math. */ 
    316                                         dimm_speed = 2 * (10000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F))); 
     315                                        dimm_speed = 20000 / (((spd_byte >> 4) * 10) + (spd_byte & 0x0F)); 
    317316                                        if (dimm_speed >= glspeed) { 
    318317                                                casmap_shift = 2; /* -1 is a shift of 2 */