Thomas Heijligen | 819d872 | 2019-03-18 11:32:34 +0100 | [diff] [blame] | 1 | /* 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 | |
| 10 | static 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 | |
| 19 | void 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 Huber | e4ab31b | 2019-07-10 16:42:55 +0200 | [diff] [blame^] | 41 | variant_romstage_params(memupd); |
| 42 | |
Thomas Heijligen | 819d872 | 2019-03-18 11:32:34 +0100 | [diff] [blame] | 43 | mainboard_init(); |
| 44 | } |
Nico Huber | e4ab31b | 2019-07-10 16:42:55 +0200 | [diff] [blame^] | 45 | |
| 46 | __weak void variant_romstage_params(FSPM_UPD *const mupd) |
| 47 | { |
| 48 | } |