device/dram/ddr2: Fix decoding tRR

Bit 7 is set on all options so only the default option in the switch
statement is returned.

Change-Id: I6a698ec9c15a2611a34c5965edf93638553775f0
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/21457
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Arthur Heymans 2017-09-08 23:56:29 +02:00 committed by Martin Roth
parent 18f8f622d5
commit 4ea66e6b6f
1 changed files with 9 additions and 6 deletions

View File

@ -181,17 +181,20 @@ static u32 spd_decode_tRR_time(u8 c)
{ {
switch (c) { switch (c) {
default: default:
case 0: printk(BIOS_WARNING,
"Unknown tRR value, using default of 15.6us.");
/* Fallthrough */
case 0x80:
return 15625 << 8; return 15625 << 8;
case 1: case 0x81:
return 15625 << 6; return 15625 << 6;
case 2: case 0x82:
return 15625 << 7; return 15625 << 7;
case 3: case 0x83:
return 15625 << 9; return 15625 << 9;
case 4: case 0x84:
return 15625 << 10; return 15625 << 10;
case 5: case 0x85:
return 15625 << 11; return 15625 << 11;
} }
} }