diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2021-02-16 13:16:25 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-02-24 11:27:03 +0000 |
commit | 52ef869b94b43ec9065350dc17ba9057b8a509e1 (patch) | |
tree | 6e5bfc73e54929defa5833a8471fb0ddaa9ba52a | |
parent | e1152c401a74a5a24811aa1425138353694346ba (diff) |
mb/prodrive/hermes/mb: Update SoC config in PRE_DEVICE
As one option is consumed by MPinit, update the soc config even earlier.
Tested on Prodrive hermes:
Turbo can be disabled and cores won't exceed their base frequency.
Change-Id: I9f444c3b91d2ee1a613ebac1922f1e6b60363c0b
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50798
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r-- | src/mainboard/prodrive/hermes/mainboard.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/mainboard/prodrive/hermes/mainboard.c b/src/mainboard/prodrive/hermes/mainboard.c index c9ed7c12fb..2bc719a392 100644 --- a/src/mainboard/prodrive/hermes/mainboard.c +++ b/src/mainboard/prodrive/hermes/mainboard.c @@ -5,6 +5,7 @@ #include <cbmem.h> #include <console/console.h> #include <crc_byte.h> +#include <bootstate.h> #include <device/device.h> #include <device/dram/spd.h> #include <intelblocks/pmclib.h> @@ -136,11 +137,6 @@ static void mainboard_init(void *chip_info) if (!board_cfg) return; - /* Set Deep Sx */ - config_t *config = config_of_soc(); - config->deep_s5_enable_ac = board_cfg->deep_sx_enabled; - config->deep_s5_enable_dc = board_cfg->deep_sx_enabled; - /* Enable internal speaker amplifier */ if (board_cfg->internal_audio_connection == 2) mb_hda_amp_enable(1); @@ -222,3 +218,29 @@ struct chip_operations mainboard_ops = { .init = mainboard_init, .enable_dev = mainboard_enable, }; + +/* Must happen before MPinit */ +static void mainboard_early(void *unused) +{ + const struct eeprom_board_settings *const board_cfg = get_board_settings(); + config_t *config = config_of_soc(); + + if (board_cfg) { + /* Set Deep Sx */ + config->deep_s5_enable_ac = board_cfg->deep_sx_enabled; + config->deep_s5_enable_dc = board_cfg->deep_sx_enabled; + } + + if (check_signature(offsetof(struct eeprom_layout, supd), FSPS_UPD_SIGNATURE)) { + struct { + struct { + u8 TurboMode; + } FspsConfig; + } supd = {0}; + + READ_EEPROM_FSP_S((&supd), FspsConfig.TurboMode); + config->cpu_turbo_disable = !supd.FspsConfig.TurboMode; + } +} + +BOOT_STATE_INIT_ENTRY(BS_PRE_DEVICE, BS_ON_EXIT, mainboard_early, NULL); |