aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/intel/kunimitsu/spd/spd.c
diff options
context:
space:
mode:
authorRizwan Qureshi <rizwan.qureshi@intel.com>2016-08-24 20:50:54 +0530
committerMartin Roth <martinroth@google.com>2016-09-15 01:15:27 +0200
commit5ff7390fcd74fe1cd94d2507cf7c04b1c1eff620 (patch)
tree88ed9f3dc2f5f00aca84af5773debfabd3166120 /src/mainboard/intel/kunimitsu/spd/spd.c
parent5bf42c6c23b462d9292e6854d3f334cf17e42825 (diff)
kunimitsu: Add FSP 2.0 support in romstage
Populate mainboard related Memory Init Params i.e, SPD Rcomp values, DQ and DQs values. Change-Id: Id62c43a72a0e34fa2e8d177ce895d395418e2347 Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com> Signed-off-by: Naresh G Solanki <naresh.solanki@intel.com> Reviewed-on: https://review.coreboot.org/16316 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/intel/kunimitsu/spd/spd.c')
-rw-r--r--src/mainboard/intel/kunimitsu/spd/spd.c36
1 files changed, 5 insertions, 31 deletions
diff --git a/src/mainboard/intel/kunimitsu/spd/spd.c b/src/mainboard/intel/kunimitsu/spd/spd.c
index faf67913e2..fe30621316 100644
--- a/src/mainboard/intel/kunimitsu/spd/spd.c
+++ b/src/mainboard/intel/kunimitsu/spd/spd.c
@@ -77,39 +77,13 @@ static void mainboard_print_spd_info(uint8_t spd[])
/* Copy SPD data for on-board memory */
void mainboard_fill_spd_data(struct pei_data *pei_data)
{
- char *spd_file;
- size_t spd_file_len;
- int spd_index, spd_span;
+ uintptr_t spd_data;
+ spd_data = mainboard_get_spd_data();
+ memcpy(pei_data->spd_data[0][0], (void *)spd_data, SPD_LEN);
- spd_index = pei_data->mem_cfg_id;
- printk(BIOS_INFO, "SPD index %d\n", spd_index);
-
- /* Load SPD data from CBFS */
- spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
- &spd_file_len);
- if (!spd_file)
- die("SPD data not found.");
-
- /* make sure we have at least one SPD in the file. */
- if (spd_file_len < SPD_LEN)
- die("Missing SPD data.");
-
- /* Make sure we did not overrun the buffer */
- if (spd_file_len < ((spd_index + 1) * SPD_LEN)) {
- printk(BIOS_ERR, "SPD index override to 0 - old hardware?\n");
- spd_index = 0;
- }
-
- /* Assume same memory in both channels */
- spd_span = spd_index * SPD_LEN;
- memcpy(pei_data->spd_data[0][0], spd_file + spd_span, SPD_LEN);
-
- if (spd_index != HYNIX_SINGLE_CHAN && spd_index != SAMSUNG_SINGLE_CHAN
- && spd_index != MIC_SINGLE_CHAN) {
- memcpy(pei_data->spd_data[1][0], spd_file + spd_span, SPD_LEN);
- printk(BIOS_INFO, "Dual channel SPD detected writing second channel\n");
- }
+ if (mainboard_has_dual_channel_mem())
+ memcpy(pei_data->spd_data[1][0], (void *)spd_data, SPD_LEN);
/* Make sure a valid SPD was found */
if (pei_data->spd_data[0][0][0] == 0)