From f3214d02482a4104d7276f06d6b326b2a54c4262 Mon Sep 17 00:00:00 2001 From: Tim Chen Date: Tue, 14 Oct 2014 20:17:11 +0800 Subject: [PATCH] auron: fix can not recognize 4G memory Part of the following patch was lost in the merge from chromium. This patch fixes up the spd_index for the copy from the SPD file. In spd.c "spd_index *= SPD_LEN" will change the original spd_index from gpio and let the following if(spd_index>3) to misjudge and disable channel 1 incorrectly. So we calculate the index for spd file memcpy when calling memcpy(). BUG=chrome-os-partner:32879 TEST=Can get total memory 4G on yuna 4G SKU BRANCH=Auron Original-Change-Id: Iebc49e20e4ca15ef6db8c4defe43cc22382a28bf Original-Signed-off-by: Tim Chen Original-Reviewed-on: https://chromium-review.googlesource.com/234420 Original-Reviewed-by: Shawn N Original-Commit-Queue: Shawn N Original-Tested-by: Shawn N (cherry picked from commit 3b1fce58b7b4b15e947b40fd011174d4e8e294bc) Signed-off-by: Marc Jones Change-Id: I03f9d63623e083c99d349d938fd802d828858f70 Reviewed-on: http://review.coreboot.org/11911 Reviewed-by: Aaron Durbin Reviewed-by: Nico Huber Reviewed-by: Georg Wicherski Tested-by: build bot (Jenkins) --- src/mainboard/google/auron/spd/spd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mainboard/google/auron/spd/spd.c b/src/mainboard/google/auron/spd/spd.c index 2f3f20c2e2..4f35477e4a 100644 --- a/src/mainboard/google/auron/spd/spd.c +++ b/src/mainboard/google/auron/spd/spd.c @@ -122,14 +122,14 @@ void mainboard_fill_spd_data(struct pei_data *pei_data) die("Missing SPD data."); memcpy(pei_data->spd_data[0][0], - spd_file + spd_index, SPD_LEN); + spd_file + (spd_index * SPD_LEN), SPD_LEN); /* Index 0-2 are 4GB config with both CH0 and CH1. * Index 4-6 are 2GB config with CH0 only. */ if (spd_index > 3) pei_data->dimm_channel1_disabled = 3; else memcpy(pei_data->spd_data[1][0], - spd_file + spd_index, SPD_LEN); + spd_file + (spd_index * SPD_LEN), SPD_LEN); /* Make sure a valid SPD was found */ if (pei_data->spd_data[0][0][0] == 0)