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 <soc/cnl_memcfg_init.h>
4 #include <soc/romstage.h>
5 
6 #include "eeprom.h"
7 
8 static const struct cnl_mb_cfg baseboard_mem_cfg = {
9  /* Access memory info through SMBUS. */
10  .spd[0] = {
12  .spd_spec = {.spd_smbus_address = 0xa0}
13  },
14  .spd[1] = {
15  .read_type = READ_SMBUS,
16  .spd_spec = {.spd_smbus_address = 0xa2}
17  },
18  .spd[2] = {
19  .read_type = READ_SMBUS,
20  .spd_spec = {.spd_smbus_address = 0xa4}
21  },
22  .spd[3] = {
23  .read_type = READ_SMBUS,
24  .spd_spec = {.spd_smbus_address = 0xa6}
25  },
26 
27  /* Rcomp resistors on CFL-S are located on the CPU itself */
28  .rcomp_resistor = {121, 75, 100},
29 
30  /* Rcomp target values for CFL-S, DDR4 and 2 DIMMs per channel */
31  .rcomp_targets = {60, 26, 20, 20, 26},
32 
33  /* Baseboard is an interleaved design */
34  .dq_pins_interleaved = 1,
35 
36  /* Baseboard is using config 2 for vref_ca */
37  .vref_ca_config = 2,
38 
39  /* Disable Early Command Training */
40  .ect = 0,
41 };
42 
43 void mainboard_memory_init_params(FSPM_UPD *memupd)
44 {
45  memupd->FspmConfig.UserBd = BOARD_TYPE_SERVER;
46  memupd->FspmTestConfig.SmbusSpdWriteDisable = 0;
47  cannonlake_memcfg_init(&memupd->FspmConfig, &baseboard_mem_cfg);
48 
49  /* Overwrite memupd */
50  if (!check_signature(offsetof(struct eeprom_layout, mupd), FSPM_UPD_SIGNATURE))
51  return;
52 
53  READ_EEPROM_FSP_M(memupd, FspmConfig.RMT);
54  READ_EEPROM_FSP_M(memupd, FspmConfig.HyperThreading);
55  READ_EEPROM_FSP_M(memupd, FspmConfig.BootFrequency);
56  READ_EEPROM_FSP_M(memupd, FspmTestConfig.VtdDisable);
57 }
#define offsetof(TYPE, MEMBER)
Definition: helpers.h:84
void cannonlake_memcfg_init(FSP_M_CONFIG *mem_cfg, const struct cnl_mb_cfg *cnl_cfg)
@ READ_SMBUS
int check_signature(const size_t offset, const uint64_t signature)
Definition: eeprom.c:20
void mainboard_memory_init_params(FSPM_UPD *mupd)
Definition: romstage.c:22
#define READ_EEPROM_FSP_M(dest, opt_name)
Definition: eeprom.h:125
static const struct cnl_mb_cfg baseboard_mem_cfg
Definition: romstage.c:8
@ BOARD_TYPE_SERVER
Definition: romstage.h:18
struct spd_info spd[NUM_DIMM_SLOT]
enum mem_info_read_type read_type