Attention is currently required from: Patrick Rudolph, Christian Walter.
Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/67381 )
Change subject: [RFC] mb/prodrive/hermes: Make board settings less error-prone ......................................................................
[RFC] mb/prodrive/hermes: Make board settings less error-prone
If the board settings definition differs between coreboot and the BMC, the CRC will not match. Allow coreboot to use the BMC settings provided by older BMC firmware revisions which have less settings, if the CRC of the first N bytes matches the expected CRC.
TEST=Boot coreboot master with BMC FW 4.05, observe board settings being honored even though coreboot's definition has an extra option.
Change-Id: I0f009b21ef0850a2af6edef1818c770171358314 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/mainboard/prodrive/hermes/eeprom.c 1 file changed, 32 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/67381/1
diff --git a/src/mainboard/prodrive/hermes/eeprom.c b/src/mainboard/prodrive/hermes/eeprom.c index 7a92fe3..8ce671b 100644 --- a/src/mainboard/prodrive/hermes/eeprom.c +++ b/src/mainboard/prodrive/hermes/eeprom.c @@ -51,6 +51,20 @@
if (crc != board_cfg->signature) { printk(BIOS_ERR, "CFG EEPROM: Board settings have invalid checksum\n"); + + /* + * coreboot's board settings definition may be newer than the BMC's, + * try to see if the CRC of the first i bytes matches the expected CRC. + */ + for (size_t i = 1; i < sizeof(board_cfg->raw_settings); i++) { + const uint32_t crc_part = CRC(&board_cfg->raw_settings, i, crc32_byte); + if (crc_part == board_cfg->signature) { + for (; i < sizeof(board_cfg->raw_settings); i++) + board_cfg->raw_settings[i] = 0; + printk(BIOS_ERR, "CFG EEPROM: Checksum OK for %zu bytes\n", i); + return true; + } + } return false; } return true;