blob: e51bd53be2e178e0a0e8f8d5adeb35eac4733c0b [file] [log] [blame]
Sean Rhodes11deb822023-04-14 21:25:19 +01001/* 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
8void mainboard_memory_init_params(FSPM_UPD *mupd)
9{
10 const struct mb_cfg mem_config = {
11 .type = MEM_TYPE_DDR4,
12 };
13
14 const bool half_populated = false;
15
16 const struct mem_spd ddr4_spd_info = {
17 .topo = MEM_TOPO_DIMM_MODULE,
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 /* Enable/Disable Wireless (RP05) based on CMOS settings */
34 if (get_uint_option("wireless", 1) == 0)
35 mupd->FspmConfig.PcieRpEnableMask &= ~(1 << 4);
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
45 mupd->FspmConfig.DmiMaxLinkSpeed = 4;
46};