coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
romstage.c
Go to the documentation of this file.
1 /* 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.h"
8 #include <ec/acpi/ec.h>
9 #include <stdint.h>
10 
11 #define SPD_4X_2GB 0
12 #define SPD_4X_4GB 1
13 
14 void mainboard_memory_init_params(FSPM_UPD *mupd)
15 {
16  FSP_M_CONFIG *mem_cfg;
17  mem_cfg = &mupd->FspmConfig;
18 
19 
20 #if CONFIG(BOARD_RAZER_BLADE_STEALTH_KBL_16GB)
22 #else
24 #endif
25 
26  printk(BIOS_INFO, "SPD index %d\n", spd_index);
27 
28  mainboard_fill_dq_map_data(&mem_cfg->DqByteMapCh0);
29  mainboard_fill_dqs_map_data(&mem_cfg->DqsMapCpu2DramCh0);
30  mainboard_fill_rcomp_res_data(&mem_cfg->RcompResistor);
31  mainboard_fill_rcomp_strength_data(&mem_cfg->RcompTarget);
32 
33  mem_cfg->DqPinsInterleaved = 0;
34  mem_cfg->MemorySpdDataLen = CONFIG_DIMM_SPD_SIZE;
35  /* Memory leak is ok since we have memory mapped boot media */
36  // TODO evaluate google/eve way of loading
37  mem_cfg->MemorySpdPtr00 = spd_cbfs_map(spd_index);
38  if (!mem_cfg->MemorySpdPtr00)
39  die("spd.bin not found\n");
40  mem_cfg->MemorySpdPtr10 = mem_cfg->MemorySpdPtr00;
41 
42  mupd->FspmTestConfig.DmiVc1 = 1;
43 }
#define printk(level,...)
Definition: stdlib.h:16
void __noreturn die(const char *fmt,...)
Definition: die.c:17
#define FSP_M_CONFIG
Definition: fsp_upd.h:8
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
void mainboard_memory_init_params(FSPM_UPD *mupd)
Definition: romstage.c:22
static const int spd_index[32]
Definition: memory.c:10
static void mainboard_fill_dq_map_data(void *dq_map_ch0, void *dq_map_ch1)
Definition: romstage.c:8
static void mainboard_fill_dqs_map_data(void *dqs_map_ch0, void *dqs_map_ch1)
Definition: romstage.c:19
#define SPD_4X_2GB
Definition: romstage.c:11
#define SPD_4X_4GB
Definition: romstage.c:12
static void mainboard_fill_rcomp_res_data(void *rcomp_ptr)
Definition: romstage.c:7
static void mainboard_fill_rcomp_strength_data(void *rcomp_strength_ptr)
Definition: romstage.c:13
uintptr_t spd_cbfs_map(u8 spd_index)
Definition: spd_bin.c:217
uint8_t u8
Definition: stdint.h:45