aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/prodrive/hermes/eeprom.c
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2021-02-15 16:35:24 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-02-19 08:37:49 +0000
commitb67f385b69f394cf235693db50c98db760411320 (patch)
tree43339234df989099f477957cd2e35b47492e9435 /src/mainboard/prodrive/hermes/eeprom.c
parent2091965973f49e465b0f7f0dc3cafc676f7a1ee1 (diff)
mb/prodrive/eeprom: Add BMC settings
Add settings describing the BMC. Will be used by the following patch to read the board revision. Change-Id: If464138fc1bdf02a45a21f638b179048d68d974d Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50787 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/prodrive/hermes/eeprom.c')
-rw-r--r--src/mainboard/prodrive/hermes/eeprom.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mainboard/prodrive/hermes/eeprom.c b/src/mainboard/prodrive/hermes/eeprom.c
index 58099d3aa8..9bdec4a79b 100644
--- a/src/mainboard/prodrive/hermes/eeprom.c
+++ b/src/mainboard/prodrive/hermes/eeprom.c
@@ -70,6 +70,25 @@ struct eeprom_board_settings *get_board_settings(void)
return checked_valid > 0 ? &board_cfg : NULL;
}
+struct eeprom_bmc_settings *get_bmc_settings(void)
+{
+ const size_t bmc_settings_offset = offsetof(struct eeprom_layout, BMCSettings);
+ static struct eeprom_bmc_settings bmc_cfg = {0};
+
+ /* 0: uninitialized, 1: settings are valid */
+ static int valid = 0;
+
+ if (valid == 0) {
+ if (read_write_config(&bmc_cfg, bmc_settings_offset, 0, sizeof(bmc_cfg))) {
+ printk(BIOS_ERR, "CFG EEPROM: Failed to read BMC settings\n");
+ return NULL;
+ }
+ valid = 1;
+ }
+ return &bmc_cfg;
+}
+
+
/* Read data from offset and write it to offset in UPD */
bool read_write_config(void *blob, size_t read_offset, size_t write_offset, size_t size)
{