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 <option.h>
4 #include <soc/meminit.h>
5 #include <soc/romstage.h>
6 #include <types.h>
7 
8 void mainboard_memory_init_params(FSPM_UPD *mupd)
9 {
10  const struct mb_cfg mem_config = {
12  };
13 
14  const bool half_populated = false;
15 
16  const struct mem_spd ddr4_spd_info = {
18  .smbus = {
19  [0] = {
20  .addr_dimm[0] = 0x50,
21  },
22  [1] = {
23  .addr_dimm[0] = 0x52,
24  },
25  },
26  };
27 
28  memcfg_init(mupd, &mem_config, &ddr4_spd_info, half_populated);
29 
30  const uint8_t vtd = get_uint_option("vtd", 1);
31  mupd->FspmConfig.VtdDisable = !vtd;
32 
33  const uint8_t ht = get_uint_option("hyper_threading",
34  mupd->FspmConfig.HyperThreading);
35  mupd->FspmConfig.HyperThreading = ht;
36 
37  /* Enable/Disable Thunderbolt based on CMOS settings */
38  if (get_uint_option("thunderbolt", 1) == 0) {
39  mupd->FspmConfig.VtdItbtEnable = 0;
40  mupd->FspmConfig.VtdBaseAddress[3] = 0;
41  mupd->FspmConfig.TcssDma0En = 0;
42  mupd->FspmConfig.TcssItbtPcie0En = 0;
43  }
44 };
void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg, const struct mem_spd *spd_info, bool half_populated)
Definition: meminit.c:238
@ MEM_TYPE_DDR4
Definition: meminit.h:11
@ MEM_TOPO_DIMM_MODULE
Definition: meminit.h:26
void mainboard_memory_init_params(FSPM_UPD *mupd)
Definition: romstage.c:22
static const struct mb_cfg mem_config
Definition: memory.c:11
unsigned int get_uint_option(const char *name, const unsigned int fallback)
Definition: option.c:116
unsigned char uint8_t
Definition: stdint.h:8
Definition: meminit.h:71
enum mem_type type
Definition: meminit.h:72
enum mem_topology topo
Definition: meminit.h:38