blob: 4f1b7e05d57da51928616f9c9d257914fa58b147 [file] [log] [blame]
Sean Rhodes2e665eb2021-06-01 22:55:07 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <assert.h>
4#include <console/console.h>
5#include <soc/romstage.h>
6#include <spd_bin.h>
7#include "spd/spd_util.c"
8#include "spd/spd.h"
9#include <ec/acpi/ec.h>
10#include <stdint.h>
11
12void mainboard_memory_init_params(FSPM_UPD *mupd)
13{
14 FSP_M_CONFIG *mem_cfg;
15 mem_cfg = &mupd->FspmConfig;
16
17 /* Use the correct entry in the SPD table defined in Makefile.inc */
18 u8 spd_index = 6;
19 printk(BIOS_INFO, "SPD index %d\n", spd_index);
20
21 mainboard_fill_dq_map_data(&mem_cfg->DqByteMapCh0);
22 mainboard_fill_dqs_map_data(&mem_cfg->DqsMapCpu2DramCh0);
23 mainboard_fill_rcomp_res_data(&mem_cfg->RcompResistor);
24 mainboard_fill_rcomp_strength_data(&mem_cfg->RcompTarget);
25
26 mem_cfg->DqPinsInterleaved = 0;
27 mem_cfg->MemorySpdDataLen = CONFIG_DIMM_SPD_SIZE;
28 /* Memory leak is ok since we have memory mapped boot media */
29 // TODO evaluate google/eve way of loading
30 mem_cfg->MemorySpdPtr00 = spd_cbfs_map(spd_index);
31 if (!mem_cfg->MemorySpdPtr00)
32 die("spd.bin not found\n");
33 mem_cfg->MemorySpdPtr10 = mem_cfg->MemorySpdPtr00;
34
35 mupd->FspmTestConfig.DmiVc1 = 1;
36}