aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/slippy/variants/leon
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2017-05-29 19:10:57 -0500
committerMartin Roth <martinroth@google.com>2017-06-04 18:44:15 +0200
commitcadd7c7ed31e7901c56e6d0dc7a0aba7e34c776d (patch)
tree8d2c2bd3d8f1e6f2605b13ebd6ed513b71031c1b /src/mainboard/google/slippy/variants/leon
parentaf4c0a431c24a38519815a6e44325d29f9073da7 (diff)
google/slippy: populate PEI SPD data for all channels
Since dual-channel setups use same RAM/SPD for both channels, populate spd_data[1] with same SPD data as spd_data[0], allowing info for both channels to propogate into the SBMIOS tables. Clean up calculations using SPD length to avoid repetition. Changes modeled after google/auron variants. Change-Id: I7e14b35642a3fbaecaeb7d1d33b5a7c1405bac45 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/19981 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/mainboard/google/slippy/variants/leon')
-rw-r--r--src/mainboard/google/slippy/variants/leon/romstage.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mainboard/google/slippy/variants/leon/romstage.c b/src/mainboard/google/slippy/variants/leon/romstage.c
index c9cf07be3a..132f586f69 100644
--- a/src/mainboard/google/slippy/variants/leon/romstage.c
+++ b/src/mainboard/google/slippy/variants/leon/romstage.c
@@ -74,6 +74,7 @@ static void copy_spd(struct pei_data *peid)
int spd_index = get_gpios(gpio_vector);
char *spd_file;
size_t spd_file_len;
+ size_t spd_len = sizeof(peid->spd_data[0]);
printk(BIOS_DEBUG, "SPD index %d\n", spd_index);
spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
@@ -81,25 +82,24 @@ static void copy_spd(struct pei_data *peid)
if (!spd_file)
die("SPD data not found.");
- /* Limiting to a single dimm for 2GB configuration
- * Identified by bit 3
- */
- if (spd_index & 0x4)
- peid->dimm_channel1_disabled = 3;
-
- if (spd_file_len <
- ((spd_index + 1) * sizeof(peid->spd_data[0]))) {
+ if (spd_file_len < ((spd_index + 1) * spd_len)) {
printk(BIOS_ERR, "SPD index override to 0 - old hardware?\n");
spd_index = 0;
}
- if (spd_file_len < sizeof(peid->spd_data[0]))
+ if (spd_file_len < spd_len)
die("Missing SPD data.");
- memcpy(peid->spd_data[0],
- spd_file +
- spd_index * sizeof(peid->spd_data[0]),
- sizeof(peid->spd_data[0]));
+ memcpy(peid->spd_data[0], spd_file + (spd_index * spd_len), spd_len);
+
+ /* Limiting to a single dimm for 2GB configuration
+ * Identified by bit 3
+ */
+ if (spd_index & 0x4)
+ peid->dimm_channel1_disabled = 3;
+ else
+ memcpy(peid->spd_data[1],
+ spd_file + (spd_index * spd_len), spd_len);
}
void variant_romstage_entry(unsigned long bist)