blob: d4fd1131f70355fff9878c44b4247dcf3e8da162 [file] [log] [blame]
Rizwan Qureshi06868f82016-08-23 13:38:19 +05301/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2016 Intel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
Rizwan Qureshi5ff73902016-08-24 20:50:54 +053016#include <arch/byteorder.h>
17#include <cbfs.h>
18#include <console/console.h>
19#include <fsp/api.h>
20#include <gpio.h>
21#include "gpio.h"
Rizwan Qureshi06868f82016-08-23 13:38:19 +053022#include <soc/romstage.h>
Rizwan Qureshi5ff73902016-08-24 20:50:54 +053023#include <soc/gpio.h>
24#include "spd/spd.h"
25#include <string.h>
Rizwan Qureshi06868f82016-08-23 13:38:19 +053026
Rizwan Qureshi5ff73902016-08-24 20:50:54 +053027void mainboard_memory_init_params(FSPM_UPD *mupd)
Rizwan Qureshi06868f82016-08-23 13:38:19 +053028{
Rizwan Qureshi5ff73902016-08-24 20:50:54 +053029 FSP_M_CONFIG *mem_cfg;
30 mem_cfg = &mupd->FspmConfig;
31
32 mainboard_fill_dq_map_data(&mem_cfg->DqByteMapCh0);
33 mainboard_fill_dqs_map_data(&mem_cfg->DqsMapCpu2DramCh0);
34 mainboard_fill_rcomp_res_data(&mem_cfg->RcompResistor);
35 mainboard_fill_rcomp_strength_data(&mem_cfg->RcompTarget);
36
37 mem_cfg->DqPinsInterleaved = 0;
38 mem_cfg->MemorySpdPtr00 = mainboard_get_spd_data();
39 if (mainboard_has_dual_channel_mem())
40 mem_cfg->MemorySpdPtr10 = mem_cfg->MemorySpdPtr00;
41 mem_cfg->MemorySpdDataLen = SPD_LEN;
Rizwan Qureshi06868f82016-08-23 13:38:19 +053042}