aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/prodrive/hermes/ramstage.c
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2020-12-21 19:46:03 +0100
committerAngel Pons <th3fanbus@gmail.com>2021-02-16 09:43:32 +0000
commit20eb3506ca3d29ef59de81fb0070628582682751 (patch)
tree205e5f3ffdd91be1663a7b804c06288812c3ea5e /src/mainboard/prodrive/hermes/ramstage.c
parentf5502310e2ad02f4a7c3b98faa3a9a2dadf0525e (diff)
mb/prodrive/hermes: Improve board config EEPROM handling
* Check and print errors returned from reading from I2C * Rework offset calculation by using more macros * Get rid of stage-specific preprocessor code * Define the EEPROM layout as struct * Make use of the defined EEPROM layout to calculate offsets * Read the UPD to disable VT-d from EEPROM Change-Id: Iad77811318c7dfd3a3a4f8d523cfa0f457f168b6 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48808 Reviewed-by: Patrick Rudolph <siro@das-labor.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/prodrive/hermes/ramstage.c')
-rw-r--r--src/mainboard/prodrive/hermes/ramstage.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/mainboard/prodrive/hermes/ramstage.c b/src/mainboard/prodrive/hermes/ramstage.c
index b879be7795..917f3b93cf 100644
--- a/src/mainboard/prodrive/hermes/ramstage.c
+++ b/src/mainboard/prodrive/hermes/ramstage.c
@@ -4,10 +4,6 @@
#include <variant/gpio.h>
#include "variants/baseboard/include/eeprom.h"
-static fsp_params parmas_list[] = {
- /* FIXME: Fill with additional options */
-};
-
void mainboard_silicon_init_params(FSPS_UPD *supd)
{
FSP_S_CONFIG *params = &supd->FspsConfig;
@@ -19,15 +15,9 @@ void mainboard_silicon_init_params(FSPS_UPD *supd)
params->SataLedEnable = 1;
/* Overwrite params */
- if (!check_signature(EEPROM_OFFSET_FSP_SIGNATURE, FSP_UPD_SIGNATURE))
+ if (!check_signature(offsetof(struct eeprom_layout, supd), FSPS_UPD_SIGNATURE))
return;
- for (u8 i = 0; i <= ARRAY_SIZE(parmas_list); i++) {
- if (ARRAY_SIZE(parmas_list) == 0)
- break;
- read_write_config(params, EEPROM_OFFSET_FSP_CONFIG +
- parmas_list[i].offset,
- EEPROM_OFFSET_FSP_CONFIG + parmas_list[i].offset,
- parmas_list[i].size);
- }
+ READ_EEPROM_FSP_S(supd, FspsTestConfig.VtdDisableDeprecated);
+ READ_EEPROM_FSP_S(supd, FspsConfig.PchPmWolEnableOverride);
}