blob: c1ec7e49824271f51063bb17aed9cd3840747cce [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>
7
8#include "variant.h"
9
10static void mainboard_init(void)
11{
12 const struct pad_config *pads;
13 size_t num;
14
15 pads = variant_gpio_table(&num);
16 gpio_configure_pads(pads, num);
17}
18
19void mainboard_memory_init_params(FSPM_UPD *memupd)
20{
21 uint8_t vtd = 1;
22 const struct cnl_mb_cfg cfg = {
23 .spd = {
24 [0] = { READ_SMBUS, { 0x50 << 1 } },
25 [2] = { READ_SMBUS, { 0x52 << 1 } },
26 },
27 .rcomp_resistor = { 121, 75, 100 },
28 .rcomp_targets = { 50, 25, 20, 20, 26 },
29 .dq_pins_interleaved = 1,
30 .vref_ca_config = 2,
31 .ect = 0,
32 };
33 cannonlake_memcfg_init(&memupd->FspmConfig, &cfg);
34 memupd->FspmConfig.EccSupport = 1;
35 memupd->FspmConfig.UserBd = BOARD_TYPE_MOBILE;
36
37 get_option(&vtd, "vtd");
38 memupd->FspmTestConfig.VtdDisable = !vtd;
39 get_option(&memupd->FspmConfig.HyperThreading, "hyper_threading");
40
Nico Hubere4ab31b2019-07-10 16:42:55 +020041 variant_romstage_params(memupd);
42
Thomas Heijligen819d8722019-03-18 11:32:34 +010043 mainboard_init();
44}
Nico Hubere4ab31b2019-07-10 16:42:55 +020045
46__weak void variant_romstage_params(FSPM_UPD *const mupd)
47{
48}