Rizwan Qureshi | 06868f8 | 2016-08-23 13:38:19 +0530 | [diff] [blame] | 1 | /* |
| 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 Qureshi | 5ff7390 | 2016-08-24 20:50:54 +0530 | [diff] [blame] | 16 | #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 Qureshi | 06868f8 | 2016-08-23 13:38:19 +0530 | [diff] [blame] | 22 | #include <soc/romstage.h> |
Rizwan Qureshi | 5ff7390 | 2016-08-24 20:50:54 +0530 | [diff] [blame] | 23 | #include <soc/gpio.h> |
| 24 | #include "spd/spd.h" |
| 25 | #include <string.h> |
Rizwan Qureshi | 06868f8 | 2016-08-23 13:38:19 +0530 | [diff] [blame] | 26 | |
Rizwan Qureshi | 5ff7390 | 2016-08-24 20:50:54 +0530 | [diff] [blame] | 27 | void mainboard_memory_init_params(FSPM_UPD *mupd) |
Rizwan Qureshi | 06868f8 | 2016-08-23 13:38:19 +0530 | [diff] [blame] | 28 | { |
Rizwan Qureshi | 5ff7390 | 2016-08-24 20:50:54 +0530 | [diff] [blame] | 29 | 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 Qureshi | 06868f8 | 2016-08-23 13:38:19 +0530 | [diff] [blame] | 42 | } |