summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorVladimir Serbinenko <phcoder@gmail.com>2014-05-18 11:05:56 +0200
committerVladimir Serbinenko <phcoder@gmail.com>2014-07-29 00:52:28 +0200
commit7686a56574a6773717b49a51786f301970d1c69c (patch)
tree40dcb474d1d0c88095e45c37044e25df5b6e2f20 /src/device
parentb37ee1ee7c69836cfb333c13f787a1c3ba580b8f (diff)
sandy/ivybridge: Native raminit.
Based on damo22's work and my X230 tracing. Works for my X230 in a variety of RAM configs. Also-By: Damien Zammit <damien@zamaudio.com> Change-Id: I1aa024c55a8416fc53b25e7123037df0e55a2769 Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Signed-off-by: Damien Zammit <damien@zamaudio.com> Reviewed-on: http://review.coreboot.org/5786 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/device')
-rw-r--r--src/device/dram/ddr3.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/device/dram/ddr3.c b/src/device/dram/ddr3.c
index 9b4f490630..a43caed5ab 100644
--- a/src/device/dram/ddr3.c
+++ b/src/device/dram/ddr3.c
@@ -110,7 +110,7 @@ int spd_decode_ddr3(dimm_attr * dimm, spd_raw_data spd)
{
int ret;
u16 crc, spd_crc;
- u8 ftb_divisor, ftb_dividend, capacity_shift, bus_width, sdram_width;
+ u8 ftb_divisor, ftb_dividend, capacity_shift, bus_width;
u8 reg8;
u32 mtb; /* medium time base */
unsigned int val, param;
@@ -209,8 +209,8 @@ int spd_decode_ddr3(dimm_attr * dimm, spd_raw_data spd)
printram(" Invalid SDRAM width\n");
ret = SPD_STATUS_INVALID_FIELD;
}
- sdram_width = (4 << val);
- printram(" SDRAM width : %u\n", sdram_width);
+ dimm->width = (4 << val);
+ printram(" SDRAM width : %u\n", dimm->width);
/* Memory bus width */
reg8 = spd[8];
@@ -236,7 +236,7 @@ int spd_decode_ddr3(dimm_attr * dimm, spd_raw_data spd)
* capacity_shift
* The rest is the JEDEC formula */
dimm->size_mb = ((1 << (capacity_shift + (25 - 20))) * bus_width
- * dimm->ranks) / sdram_width;
+ * dimm->ranks) / dimm->width;
/* Fine Timebase (FTB) Dividend/Divisor */
/* Dividend */
@@ -334,6 +334,9 @@ int spd_decode_ddr3(dimm_attr * dimm, spd_raw_data spd)
printram(" DIMM Rank1 Address bits mirrored!!!\n");
}
+ dimm->reference_card = spd[62] & 0x1f;
+ printram(" DIMM Reference card %c\n", 'A' + dimm->reference_card);
+
return ret;
}