blob: ddcc2cc87c481efcd2150043bbc3d3981eb76189 [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>
Felix Singer8ed7faf2020-12-04 09:18:49 +01008#include <variant/gpio.h>
Thomas Heijligen819d8722019-03-18 11:32:34 +01009
Thomas Heijligen819d8722019-03-18 11:32:34 +010010void mainboard_memory_init_params(FSPM_UPD *memupd)
11{
Thomas Heijligen819d8722019-03-18 11:32:34 +010012 const struct cnl_mb_cfg cfg = {
13 .spd = {
14 [0] = { READ_SMBUS, { 0x50 << 1 } },
15 [2] = { READ_SMBUS, { 0x52 << 1 } },
16 },
17 .rcomp_resistor = { 121, 75, 100 },
18 .rcomp_targets = { 50, 25, 20, 20, 26 },
19 .dq_pins_interleaved = 1,
20 .vref_ca_config = 2,
21 .ect = 0,
22 };
23 cannonlake_memcfg_init(&memupd->FspmConfig, &cfg);
24 memupd->FspmConfig.EccSupport = 1;
25 memupd->FspmConfig.UserBd = BOARD_TYPE_MOBILE;
26
Angel Pons88dcb312021-04-26 17:10:28 +020027 const uint8_t vtd = get_uint_option("vtd", 1);
Thomas Heijligen819d8722019-03-18 11:32:34 +010028 memupd->FspmTestConfig.VtdDisable = !vtd;
Angel Pons88dcb312021-04-26 17:10:28 +020029 const uint8_t ht = get_uint_option("hyper_threading", memupd->FspmConfig.HyperThreading);
Angel Ponsf8a5eb22020-11-02 22:49:51 +010030 memupd->FspmConfig.HyperThreading = ht;
Thomas Heijligen819d8722019-03-18 11:32:34 +010031
Nico Hubere4ab31b2019-07-10 16:42:55 +020032 variant_romstage_params(memupd);
33
Felix Singer8ed7faf2020-12-04 09:18:49 +010034 variant_configure_gpios();
Thomas Heijligen819d8722019-03-18 11:32:34 +010035}
Nico Hubere4ab31b2019-07-10 16:42:55 +020036
37__weak void variant_romstage_params(FSPM_UPD *const mupd)
38{
39}