diff options
Diffstat (limited to 'src/mainboard/prodrive/hermes/eeprom.c')
-rw-r--r-- | src/mainboard/prodrive/hermes/eeprom.c | 19 |
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) { |