blob: a981f50a7b5d26f059d7554d7b058cd9a86be013 [file] [log] [blame]
Thomas Heijligen819d8722019-03-18 11:32:34 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <option.h>
4#include <soc/cnl_memcfg_init.h>
5#include <soc/gpio.h>
6#include <soc/romstage.h>
Felix Singere8774932020-11-24 19:27:47 +00007#include <variant.h>
Thomas Heijligen819d8722019-03-18 11:32:34 +01008
9static void mainboard_init(void)
10{
11 const struct pad_config *pads;
12 size_t num;
13
14 pads = variant_gpio_table(&num);
15 gpio_configure_pads(pads, num);
16}
17
18void mainboard_memory_init_params(FSPM_UPD *memupd)
19{
20 uint8_t vtd = 1;
21 const struct cnl_mb_cfg cfg = {
22 .spd = {
23 [0] = { READ_SMBUS, { 0x50 << 1 } },
24 [2] = { READ_SMBUS, { 0x52 << 1 } },
25 },
26 .rcomp_resistor = { 121, 75, 100 },
27 .rcomp_targets = { 50, 25, 20, 20, 26 },
28 .dq_pins_interleaved = 1,
29 .vref_ca_config = 2,
30 .ect = 0,
31 };
32 cannonlake_memcfg_init(&memupd->FspmConfig, &cfg);
33 memupd->FspmConfig.EccSupport = 1;
34 memupd->FspmConfig.UserBd = BOARD_TYPE_MOBILE;
35
36 get_option(&vtd, "vtd");
37 memupd->FspmTestConfig.VtdDisable = !vtd;
38 get_option(&memupd->FspmConfig.HyperThreading, "hyper_threading");
39
Nico Hubere4ab31b2019-07-10 16:42:55 +020040 variant_romstage_params(memupd);
41
Thomas Heijligen819d8722019-03-18 11:32:34 +010042 mainboard_init();
43}
Nico Hubere4ab31b2019-07-10 16:42:55 +020044
45__weak void variant_romstage_params(FSPM_UPD *const mupd)
46{
47}